@types/three 0.167.2 → 0.168.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- three/README.md +2 -2
- three/examples/jsm/Addons.d.ts +5 -1
- three/examples/jsm/capabilities/WebGL.d.ts +11 -3
- three/examples/jsm/controls/ArcballControls.d.ts +111 -77
- three/examples/jsm/controls/DragControls.d.ts +56 -27
- three/examples/jsm/controls/FirstPersonControls.d.ts +82 -12
- three/examples/jsm/controls/FlyControls.d.ts +35 -11
- three/examples/jsm/controls/OrbitControls.d.ts +84 -137
- three/examples/jsm/controls/PointerLockControls.d.ts +68 -9
- three/examples/jsm/controls/TrackballControls.d.ts +110 -26
- three/examples/jsm/effects/AnaglyphEffect.d.ts +11 -5
- three/examples/jsm/effects/ParallaxBarrierEffect.d.ts +7 -4
- three/examples/jsm/environments/RoomEnvironment.d.ts +2 -2
- three/examples/jsm/loaders/KTX2Loader.d.ts +4 -0
- three/examples/jsm/objects/SkyMesh.d.ts +17 -0
- three/examples/jsm/objects/Water2.d.ts +2 -2
- three/examples/jsm/objects/Water2Mesh.d.ts +42 -0
- three/examples/jsm/objects/WaterMesh.d.ts +31 -0
- three/examples/jsm/postprocessing/OutlinePass.d.ts +1 -1
- three/examples/jsm/postprocessing/SSAARenderPass.d.ts +11 -2
- three/package.json +4 -3
- three/src/Three.WebGPU.d.ts +6 -0
- three/src/Three.d.ts +1 -0
- three/src/core/EventDispatcher.d.ts +0 -3
- three/src/core/Object3D.d.ts +2 -0
- three/src/extras/Controls.d.ts +54 -0
- three/src/{nodes/loaders → loaders/nodes}/NodeLoader.d.ts +3 -3
- three/src/{nodes/loaders → loaders/nodes}/NodeMaterialLoader.d.ts +1 -1
- three/src/{nodes/loaders → loaders/nodes}/NodeObjectLoader.d.ts +1 -1
- three/src/materials/Material.d.ts +17 -13
- three/src/materials/nodes/InstancedPointsNodeMaterial.d.ts +33 -0
- three/src/{nodes/materials → materials/nodes}/Line2NodeMaterial.d.ts +2 -2
- three/src/{nodes/materials → materials/nodes}/LineBasicNodeMaterial.d.ts +1 -1
- three/src/materials/nodes/LineDashedNodeMaterial.d.ts +29 -0
- three/src/{nodes/materials → materials/nodes}/MeshBasicNodeMaterial.d.ts +1 -1
- three/src/materials/nodes/MeshLambertNodeMaterial.d.ts +49 -0
- three/src/{nodes/materials → materials/nodes}/MeshMatcapNodeMaterial.d.ts +2 -2
- three/src/{nodes/materials → materials/nodes}/MeshNormalNodeMaterial.d.ts +1 -1
- three/src/{nodes/materials → materials/nodes}/MeshPhongNodeMaterial.d.ts +2 -2
- three/src/{nodes/materials → materials/nodes}/MeshPhysicalNodeMaterial.d.ts +5 -2
- three/src/{nodes/materials → materials/nodes}/MeshSSSNodeMaterial.d.ts +2 -2
- three/src/{nodes/materials → materials/nodes}/MeshStandardNodeMaterial.d.ts +3 -3
- three/src/{nodes/materials → materials/nodes}/MeshToonNodeMaterial.d.ts +2 -2
- three/src/materials/nodes/NodeMaterial.d.ts +91 -0
- three/src/{nodes/materials/Materials.d.ts → materials/nodes/NodeMaterials.d.ts} +5 -2
- three/src/{nodes/materials → materials/nodes}/PointsNodeMaterial.d.ts +1 -2
- three/src/{nodes/materials → materials/nodes}/ShadowNodeMaterial.d.ts +1 -1
- three/src/{nodes/materials → materials/nodes}/SpriteNodeMaterial.d.ts +2 -2
- three/src/{nodes/materials → materials/nodes}/VolumeNodeMaterial.d.ts +1 -1
- three/src/nodes/Nodes.d.ts +117 -362
- three/src/nodes/TSL.d.ts +269 -0
- three/src/nodes/accessors/AccessorsUtils.d.ts +1 -1
- three/src/nodes/accessors/BatchNode.d.ts +1 -2
- three/src/nodes/accessors/{BitangentNode.d.ts → Bitangent.d.ts} +1 -1
- three/src/nodes/accessors/BufferAttributeNode.d.ts +4 -4
- three/src/nodes/accessors/BufferNode.d.ts +1 -1
- three/src/nodes/accessors/{CameraNode.d.ts → Camera.d.ts} +1 -1
- three/src/nodes/accessors/ClippingNode.d.ts +1 -1
- three/src/nodes/accessors/CubeTextureNode.d.ts +1 -7
- three/src/nodes/accessors/InstanceNode.d.ts +1 -1
- three/src/nodes/accessors/MaterialNode.d.ts +3 -3
- three/src/nodes/accessors/MaterialProperties.d.ts +4 -0
- three/src/nodes/accessors/MaterialReferenceNode.d.ts +3 -1
- three/src/nodes/accessors/ModelNode.d.ts +1 -1
- three/src/nodes/accessors/ModelViewProjectionNode.d.ts +1 -1
- three/src/nodes/accessors/MorphNode.d.ts +15 -0
- three/src/nodes/accessors/{NormalNode.d.ts → Normal.d.ts} +11 -4
- three/src/nodes/accessors/Object3DNode.d.ts +1 -1
- three/src/nodes/accessors/PointUVNode.d.ts +1 -1
- three/src/nodes/accessors/{PositionNode.d.ts → Position.d.ts} +2 -1
- three/src/nodes/accessors/ReferenceBaseNode.d.ts +27 -0
- three/src/nodes/accessors/ReferenceNode.d.ts +7 -5
- three/src/nodes/accessors/{ReflectVectorNode.d.ts → ReflectVector.d.ts} +1 -1
- three/src/nodes/accessors/RendererReferenceNode.d.ts +1 -1
- three/src/nodes/accessors/SceneNode.d.ts +20 -0
- three/src/nodes/accessors/SkinningNode.d.ts +11 -1
- three/src/nodes/accessors/StorageBufferNode.d.ts +2 -2
- three/src/nodes/accessors/StorageTextureNode.d.ts +1 -1
- three/src/nodes/accessors/{TangentNode.d.ts → Tangent.d.ts} +1 -1
- three/src/nodes/accessors/Texture3DNode.d.ts +1 -1
- three/src/nodes/accessors/TextureBicubic.d.ts +4 -0
- three/src/nodes/accessors/TextureNode.d.ts +26 -7
- three/src/nodes/accessors/TextureSizeNode.d.ts +18 -0
- three/src/nodes/accessors/{UVNode.d.ts → UV.d.ts} +1 -1
- three/src/nodes/accessors/UniformArrayNode.d.ts +30 -0
- three/src/nodes/accessors/UserDataNode.d.ts +1 -1
- three/src/nodes/accessors/VelocityNode.d.ts +15 -0
- three/src/nodes/accessors/VertexColorNode.d.ts +1 -1
- three/src/nodes/code/CodeNode.d.ts +1 -1
- three/src/nodes/code/ExpressionNode.d.ts +1 -1
- three/src/nodes/code/FunctionCallNode.d.ts +2 -2
- three/src/nodes/code/FunctionNode.d.ts +5 -6
- three/src/nodes/code/ScriptableNode.d.ts +22 -0
- three/src/nodes/code/ScriptableValueNode.d.ts +10 -0
- three/src/nodes/core/AssignNode.d.ts +2 -2
- three/src/nodes/core/AttributeNode.d.ts +2 -5
- three/src/nodes/core/BypassNode.d.ts +2 -2
- three/src/nodes/core/CacheNode.d.ts +2 -2
- three/src/nodes/core/ContextNode.d.ts +10 -7
- three/src/nodes/core/IndexNode.d.ts +11 -3
- three/src/nodes/core/MRTNode.d.ts +7 -2
- three/src/nodes/core/Node.d.ts +8 -2
- three/src/nodes/core/OutputStructNode.d.ts +1 -1
- three/src/nodes/core/ParameterNode.d.ts +12 -0
- three/src/nodes/core/PropertyNode.d.ts +1 -1
- three/src/nodes/core/StackNode.d.ts +12 -2
- three/src/nodes/core/UniformNode.d.ts +1 -1
- three/src/nodes/core/VarNode.d.ts +2 -10
- three/src/nodes/core/VaryingNode.d.ts +2 -2
- three/src/nodes/display/AfterImageNode.d.ts +1 -7
- three/src/nodes/display/AnaglyphPassNode.d.ts +14 -0
- three/src/nodes/display/AnamorphicNode.d.ts +1 -7
- three/src/nodes/display/BleachBypass.d.ts +4 -0
- three/src/nodes/display/BlendMode.d.ts +10 -0
- three/src/nodes/display/BloomNode.d.ts +1 -7
- three/src/nodes/display/BumpMapNode.d.ts +16 -0
- three/src/nodes/display/ColorAdjustment.d.ts +27 -0
- three/src/nodes/display/ColorSpaceFunctions.d.ts +6 -0
- three/src/nodes/display/ColorSpaceNode.d.ts +23 -23
- three/src/nodes/display/DenoiseNode.d.ts +3 -9
- three/src/nodes/display/DepthOfFieldNode.d.ts +4 -8
- three/src/nodes/display/DotScreenNode.d.ts +4 -8
- three/src/nodes/display/FXAANode.d.ts +3 -9
- three/src/nodes/display/FilmNode.d.ts +3 -9
- three/src/nodes/display/FrontFacingNode.d.ts +4 -2
- three/src/nodes/display/GTAONode.d.ts +3 -9
- three/src/nodes/display/GaussianBlurNode.d.ts +4 -8
- three/src/nodes/display/Lut3DNode.d.ts +3 -9
- three/src/nodes/display/MotionBlur.d.ts +8 -0
- three/src/nodes/display/NormalMapNode.d.ts +4 -8
- three/src/nodes/display/ParallaxBarrierPassNode.d.ts +14 -0
- three/src/nodes/display/PassNode.d.ts +11 -2
- three/src/nodes/display/PixelationPassNode.d.ts +1 -37
- three/src/nodes/display/PosterizeNode.d.ts +1 -7
- three/src/nodes/display/RGBShiftNode.d.ts +1 -7
- three/src/nodes/display/RenderOutputNode.d.ts +2 -2
- three/src/nodes/display/SSAAPassNode.d.ts +26 -0
- three/src/nodes/display/Sepia.d.ts +4 -0
- three/src/nodes/display/SobelOperatorNode.d.ts +4 -8
- three/src/nodes/display/StereoCompositePassNode.d.ts +17 -0
- three/src/nodes/display/StereoPassNode.d.ts +17 -0
- three/src/nodes/display/ToneMappingFunctions.d.ts +14 -0
- three/src/nodes/display/ToneMappingNode.d.ts +5 -6
- three/src/nodes/display/TransitionNode.d.ts +3 -9
- three/src/nodes/display/ViewportDepthNode.d.ts +6 -2
- three/src/nodes/display/ViewportDepthTextureNode.d.ts +4 -2
- three/src/nodes/display/ViewportNode.d.ts +23 -16
- three/src/nodes/display/ViewportSharedTextureNode.d.ts +4 -8
- three/src/nodes/display/ViewportTextureNode.d.ts +4 -9
- three/src/nodes/fog/FogExp2Node.d.ts +4 -8
- three/src/nodes/fog/FogNode.d.ts +4 -8
- three/src/nodes/fog/FogRangeNode.d.ts +4 -8
- three/src/nodes/functions/BSDF/BRDF_GGX.d.ts +1 -1
- three/src/nodes/functions/BSDF/BRDF_Lambert.d.ts +1 -1
- three/src/nodes/functions/BSDF/BRDF_Sheen.d.ts +1 -1
- three/src/nodes/functions/BSDF/DFGApprox.d.ts +1 -1
- three/src/nodes/functions/BSDF/D_GGX.d.ts +1 -1
- three/src/nodes/functions/BSDF/D_GGX_Anisotropic.d.ts +1 -1
- three/src/nodes/functions/BSDF/F_Schlick.d.ts +1 -1
- three/src/nodes/functions/BSDF/Schlick_to_F0.d.ts +10 -0
- three/src/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts +1 -1
- three/src/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.d.ts +1 -1
- three/src/nodes/functions/ShadowMaskModel.d.ts +1 -1
- three/src/nodes/functions/material/getGeometryRoughness.d.ts +1 -1
- three/src/nodes/functions/material/getRoughness.d.ts +1 -1
- three/src/nodes/geometry/RangeNode.d.ts +1 -1
- three/src/nodes/gpgpu/ComputeNode.d.ts +2 -2
- three/src/nodes/lighting/AmbientLightNode.d.ts +8 -0
- three/src/nodes/lighting/DirectionalLightNode.d.ts +8 -0
- three/src/nodes/lighting/IESSpotLightNode.d.ts +5 -0
- three/src/nodes/lighting/LightNode.d.ts +18 -0
- three/src/nodes/lighting/LightProbeNode.d.ts +11 -0
- three/src/nodes/lighting/LightUtils.d.ts +3 -3
- three/src/nodes/lighting/LightingContextNode.d.ts +1 -7
- three/src/nodes/lighting/LightsNode.d.ts +9 -13
- three/src/nodes/materialx/MaterialXNodes.d.ts +1 -1
- three/src/nodes/materialx/lib/mx_hsv.d.ts +2 -2
- three/src/nodes/materialx/lib/mx_noise.d.ts +1 -1
- three/src/nodes/materialx/lib/mx_transform_color.d.ts +1 -1
- three/src/nodes/math/ConditionalNode.d.ts +39 -0
- three/src/nodes/math/Hash.d.ts +4 -0
- three/src/nodes/math/MathNode.d.ts +2 -2
- three/src/nodes/math/MathUtils.d.ts +0 -10
- three/src/nodes/math/OperatorNode.d.ts +18 -4
- three/src/nodes/math/TriNoise3D.d.ts +1 -1
- three/src/nodes/parsers/GLSLNodeFunction.d.ts +9 -0
- three/src/nodes/parsers/GLSLNodeParser.d.ts +8 -0
- three/src/nodes/pmrem/PMREMNode.d.ts +4 -2
- three/src/nodes/pmrem/PMREMUtils.d.ts +28 -0
- three/src/nodes/procedural/Checker.d.ts +4 -0
- three/src/nodes/tsl/TSLBase.d.ts +21 -0
- three/src/nodes/{shadernode/ShaderNode.d.ts → tsl/TSLCore.d.ts} +23 -23
- three/src/nodes/utils/CubeMapNode.d.ts +13 -0
- three/src/nodes/utils/Discard.d.ts +11 -0
- three/src/nodes/utils/EquirectUVNode.d.ts +1 -1
- three/src/nodes/utils/FunctionOverloadingNode.d.ts +13 -0
- three/src/nodes/utils/LoopNode.d.ts +22 -0
- three/src/nodes/utils/MatcapUVNode.d.ts +1 -1
- three/src/nodes/utils/MaxMipLevelNode.d.ts +1 -1
- three/src/nodes/utils/OscNode.d.ts +1 -1
- three/src/nodes/utils/Packing.d.ts +5 -0
- three/src/nodes/utils/RTTNode.d.ts +7 -7
- three/src/nodes/utils/ReflectorNode.d.ts +1 -1
- three/src/nodes/utils/RemapNode.d.ts +2 -2
- three/src/nodes/utils/RotateNode.d.ts +1 -7
- three/src/nodes/utils/SetNode.d.ts +11 -0
- three/src/nodes/utils/SplitNode.d.ts +1 -1
- three/src/nodes/utils/SpriteSheetUVNode.d.ts +1 -1
- three/src/nodes/utils/SpriteUtils.d.ts +6 -0
- three/src/nodes/utils/{StoargeArrayElementNode.d.ts → StorageArrayElementNode.d.ts} +1 -7
- three/src/nodes/utils/TimerNode.d.ts +1 -1
- three/src/nodes/utils/TriplanarTexturesNode.d.ts +1 -7
- three/src/nodes/utils/UVUtils.d.ts +14 -0
- three/src/nodes/utils/ViewportUtils.d.ts +4 -0
- three/src/renderers/common/BindGroup.d.ts +8 -1
- three/src/renderers/common/Bindings.d.ts +2 -2
- three/src/renderers/common/ClippingContext.d.ts +1 -0
- three/src/renderers/common/QuadMesh.d.ts +2 -0
- three/src/renderers/common/RenderContext.d.ts +2 -0
- three/src/renderers/common/RenderContexts.d.ts +6 -4
- three/src/renderers/common/RenderObjects.d.ts +1 -1
- three/src/renderers/common/Renderer.d.ts +16 -4
- three/src/renderers/common/SampledTexture.d.ts +7 -1
- three/src/renderers/common/StandardRenderer.d.ts +12 -0
- three/src/renderers/common/Textures.d.ts +1 -0
- three/src/renderers/common/nodes/NodeLibrary.d.ts +56 -0
- three/src/renderers/common/nodes/NodeSampledTexture.d.ts +3 -3
- three/src/renderers/common/nodes/Nodes.d.ts +7 -9
- three/src/renderers/common/nodes/StandardNodeLibrary.d.ts +5 -0
- three/src/renderers/webgl/WebGLProperties.d.ts +5 -4
- three/src/renderers/webgpu/WebGPUBackend.d.ts +6 -2
- three/src/renderers/webgpu/WebGPURenderer.d.ts +3 -3
- three/src/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts +2 -2
- three/src/renderers/webxr/WebXRManager.d.ts +0 -2
- three/examples/jsm/loaders/LogLuvLoader.d.ts +0 -19
- three/src/nodes/accessors/TextureBicubicNode.d.ts +0 -18
- three/src/nodes/accessors/UniformsNode.d.ts +0 -23
- three/src/nodes/core/NodeKeywords.d.ts +0 -17
- three/src/nodes/display/BlendModeNode.d.ts +0 -47
- three/src/nodes/display/ColorAdjustmentNode.d.ts +0 -47
- three/src/nodes/materials/NodeMaterial.d.ts +0 -124
- three/src/nodes/math/CondNode.d.ts +0 -22
- three/src/nodes/math/HashNode.d.ts +0 -16
- three/src/nodes/procedural/CheckerNode.d.ts +0 -15
- three/src/nodes/utils/DiscardNode.d.ts +0 -17
- three/src/nodes/utils/PackingNode.d.ts +0 -24
- three/src/nodes/utils/RotateUVNode.d.ts +0 -19
|
@@ -37,5 +37,7 @@ declare class RenderContext {
|
|
|
37
37
|
activeMipmapLevel?: number | undefined;
|
|
38
38
|
occlusionQueryCount?: number | undefined;
|
|
39
39
|
constructor();
|
|
40
|
+
getCacheKey(): string;
|
|
40
41
|
}
|
|
42
|
+
export declare function getCacheKey(renderContext: RenderContext): string;
|
|
41
43
|
export default RenderContext;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { Camera } from "../../cameras/Camera.js";
|
|
2
|
+
import { Object3D } from "../../core/Object3D.js";
|
|
2
3
|
import { RenderTarget } from "../../core/RenderTarget.js";
|
|
3
|
-
import { Scene } from "../../scenes/Scene.js";
|
|
4
4
|
import ChainMap from "./ChainMap.js";
|
|
5
5
|
import RenderContext from "./RenderContext.js";
|
|
6
6
|
declare class RenderContexts {
|
|
7
7
|
chainMaps: {
|
|
8
|
-
[attachmentState: string]: ChainMap<readonly [
|
|
8
|
+
[attachmentState: string]: ChainMap<readonly [Object3D, Camera], RenderContext> | undefined;
|
|
9
9
|
};
|
|
10
10
|
constructor();
|
|
11
|
-
get(scene:
|
|
12
|
-
getChainMap(
|
|
11
|
+
get(scene: Object3D, camera: Camera, renderTarget?: RenderTarget | null): RenderContext;
|
|
12
|
+
getChainMap(
|
|
13
|
+
attachmentState: string,
|
|
14
|
+
): ChainMap<readonly [Object3D<import("../../core/Object3D.js").Object3DEventMap>, Camera], RenderContext>;
|
|
13
15
|
dispose(): void;
|
|
14
16
|
}
|
|
15
17
|
export default RenderContexts;
|
|
@@ -10,7 +10,9 @@ import { Color } from "../../math/Color.js";
|
|
|
10
10
|
import { Plane } from "../../math/Plane.js";
|
|
11
11
|
import { Vector2 } from "../../math/Vector2.js";
|
|
12
12
|
import { Vector4 } from "../../math/Vector4.js";
|
|
13
|
-
import
|
|
13
|
+
import MRTNode from "../../nodes/core/MRTNode.js";
|
|
14
|
+
import ComputeNode from "../../nodes/gpgpu/ComputeNode.js";
|
|
15
|
+
import LightsNode from "../../nodes/lighting/LightsNode.js";
|
|
14
16
|
import { Scene } from "../../scenes/Scene.js";
|
|
15
17
|
import { FramebufferTexture } from "../../textures/FramebufferTexture.js";
|
|
16
18
|
import { Texture } from "../../textures/Texture.js";
|
|
@@ -22,6 +24,7 @@ import Bindings from "./Bindings.js";
|
|
|
22
24
|
import Color4 from "./Color4.js";
|
|
23
25
|
import Geometries from "./Geometries.js";
|
|
24
26
|
import Info from "./Info.js";
|
|
27
|
+
import NodeLibrary from "./nodes/NodeLibrary.js";
|
|
25
28
|
import Nodes from "./nodes/Nodes.js";
|
|
26
29
|
import Pipelines from "./Pipelines.js";
|
|
27
30
|
import QuadMesh from "./QuadMesh.js";
|
|
@@ -38,6 +41,7 @@ export interface RendererParameters {
|
|
|
38
41
|
alpha?: boolean | undefined;
|
|
39
42
|
antialias?: boolean | undefined;
|
|
40
43
|
samples?: number | undefined;
|
|
44
|
+
getFallback?: ((error: unknown) => Backend) | null | undefined;
|
|
41
45
|
}
|
|
42
46
|
declare class Renderer {
|
|
43
47
|
readonly isRenderer: true;
|
|
@@ -58,6 +62,10 @@ declare class Renderer {
|
|
|
58
62
|
stencil: boolean;
|
|
59
63
|
clippingPlanes: readonly Plane[];
|
|
60
64
|
info: Info;
|
|
65
|
+
nodes: {
|
|
66
|
+
library: NodeLibrary;
|
|
67
|
+
};
|
|
68
|
+
_getFallback: ((error: unknown) => Backend) | null;
|
|
61
69
|
_pixelRatio: number;
|
|
62
70
|
_width: number;
|
|
63
71
|
_height: number;
|
|
@@ -142,12 +150,16 @@ declare class Renderer {
|
|
|
142
150
|
glFragmentShader: WebGLShader,
|
|
143
151
|
) => void)
|
|
144
152
|
| null;
|
|
153
|
+
getShaderAsync: (scene: Scene, camera: Camera, object: Object3D) => Promise<{
|
|
154
|
+
fragmentShader: string | null;
|
|
155
|
+
vertexShader: string | null;
|
|
156
|
+
}>;
|
|
145
157
|
};
|
|
146
158
|
localClippingEnabled?: boolean | undefined;
|
|
147
159
|
constructor(backend: Backend, parameters?: RendererParameters);
|
|
148
160
|
init(): Promise<void>;
|
|
149
161
|
get coordinateSystem(): import("../../constants.js").CoordinateSystem;
|
|
150
|
-
compileAsync(scene:
|
|
162
|
+
compileAsync(scene: Object3D, camera: Camera, targetScene?: Object3D | null): Promise<void>;
|
|
151
163
|
renderAsync(scene: Scene, camera: Camera): Promise<void>;
|
|
152
164
|
setMRT(mrt: MRTNode | null): this;
|
|
153
165
|
getMRT(): MRTNode | null;
|
|
@@ -194,6 +206,7 @@ declare class Renderer {
|
|
|
194
206
|
clearColorAsync(): Promise<void>;
|
|
195
207
|
clearDepthAsync(): Promise<void>;
|
|
196
208
|
clearStencilAsync(): Promise<void>;
|
|
209
|
+
get currentToneMapping(): ToneMapping;
|
|
197
210
|
get currentColorSpace(): ColorSpace;
|
|
198
211
|
dispose(): void;
|
|
199
212
|
setRenderTarget(renderTarget: RenderTarget | null, activeCubeFace?: number, activeMipmapLevel?: number): void;
|
|
@@ -268,10 +281,9 @@ declare class Renderer {
|
|
|
268
281
|
scene: Scene,
|
|
269
282
|
camera: Camera,
|
|
270
283
|
lightsNode: LightsNode,
|
|
271
|
-
group: GeometryGroup,
|
|
272
284
|
passId?: string,
|
|
273
285
|
): void;
|
|
274
286
|
get compute(): (computeNodes: ComputeNode | ComputeNode[]) => Promise<void>;
|
|
275
|
-
get compile(): (scene:
|
|
287
|
+
get compile(): (scene: Object3D, camera: Camera, targetScene?: Object3D | null) => Promise<void>;
|
|
276
288
|
}
|
|
277
289
|
export default Renderer;
|
|
@@ -3,12 +3,18 @@ import Binding from "./Binding.js";
|
|
|
3
3
|
|
|
4
4
|
declare class SampledTexture extends Binding {
|
|
5
5
|
id: number;
|
|
6
|
+
|
|
6
7
|
texture: Texture | null;
|
|
7
8
|
version: number;
|
|
8
9
|
store: boolean;
|
|
10
|
+
generation: number | null;
|
|
11
|
+
|
|
9
12
|
readonly isSampledTexture: true;
|
|
13
|
+
|
|
10
14
|
constructor(name: string, texture: Texture | null);
|
|
11
|
-
|
|
15
|
+
|
|
16
|
+
needsBindingsUpdate(generation: number): boolean;
|
|
17
|
+
|
|
12
18
|
update(): boolean;
|
|
13
19
|
}
|
|
14
20
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import Backend from "./Backend.js";
|
|
2
|
+
import Renderer, { RendererParameters } from "./Renderer.js";
|
|
3
|
+
|
|
4
|
+
export interface StandardRendererParameters extends RendererParameters {}
|
|
5
|
+
|
|
6
|
+
declare class StandardRenderer extends Renderer {
|
|
7
|
+
readonly isStandardRenderer: true;
|
|
8
|
+
|
|
9
|
+
constructor(backend: Backend, parameters?: StandardRendererParameters);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default StandardRenderer;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ToneMapping } from "../../../constants.js";
|
|
2
|
+
import { Light } from "../../../lights/Light.js";
|
|
3
|
+
import { Material } from "../../../materials/Material.js";
|
|
4
|
+
import NodeMaterial from "../../../materials/nodes/NodeMaterial.js";
|
|
5
|
+
import Node from "../../../nodes/core/Node.js";
|
|
6
|
+
import { ColorSpaceMethod } from "../../../nodes/display/ColorSpaceNode.js";
|
|
7
|
+
import AnalyticLightNode from "../../../nodes/lighting/AnalyticLightNode.js";
|
|
8
|
+
import { NodeRepresentation, ShaderNodeObject } from "../../../nodes/tsl/TSLCore.js";
|
|
9
|
+
declare class NodeLibrary {
|
|
10
|
+
lightNodes: WeakMap<{
|
|
11
|
+
new(): Light;
|
|
12
|
+
}, {
|
|
13
|
+
new(light: Light): AnalyticLightNode<Light>;
|
|
14
|
+
}>;
|
|
15
|
+
materialNodes: Map<string, {
|
|
16
|
+
new(): NodeMaterial;
|
|
17
|
+
}>;
|
|
18
|
+
toneMappingNodes: Map<
|
|
19
|
+
ToneMapping,
|
|
20
|
+
(color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>
|
|
21
|
+
>;
|
|
22
|
+
colorSpaceNodes: Map<ColorSpaceMethod, (color: NodeRepresentation) => ShaderNodeObject<Node>>;
|
|
23
|
+
constructor();
|
|
24
|
+
fromMaterial(material: Material): Material | null;
|
|
25
|
+
addColorSpace(
|
|
26
|
+
colorSpaceNode: (color: NodeRepresentation) => ShaderNodeObject<Node>,
|
|
27
|
+
colorSpace: ColorSpaceMethod,
|
|
28
|
+
): void;
|
|
29
|
+
getColorSpaceFunction(colorSpace: ColorSpaceMethod): ((color: NodeRepresentation) => ShaderNodeObject<Node>) | null;
|
|
30
|
+
addToneMapping(
|
|
31
|
+
toneMappingNode: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>,
|
|
32
|
+
toneMapping: ToneMapping,
|
|
33
|
+
): void;
|
|
34
|
+
getToneMappingFunction(
|
|
35
|
+
toneMapping: ToneMapping,
|
|
36
|
+
): ((color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>) | null;
|
|
37
|
+
getMaterialNodeClass(materialType: string): (new() => NodeMaterial) | null;
|
|
38
|
+
addMaterial(materialNodeClass: {
|
|
39
|
+
new(): NodeMaterial;
|
|
40
|
+
}, materialClass: {
|
|
41
|
+
new(): Material;
|
|
42
|
+
}): void;
|
|
43
|
+
getLightNodeClass(light: Light): (new(light: Light) => AnalyticLightNode<Light>) | null;
|
|
44
|
+
addLight<TLight extends Light>(lightNodeClass: {
|
|
45
|
+
new(light: TLight): AnalyticLightNode<TLight>;
|
|
46
|
+
}, lightClass: {
|
|
47
|
+
new(): TLight;
|
|
48
|
+
}): void;
|
|
49
|
+
addType<TNodeClass, TType>(nodeClass: TNodeClass, type: TType, library: Map<TType, TNodeClass>): void;
|
|
50
|
+
addClass<TNodeClass, TBaseClass extends object>(
|
|
51
|
+
nodeClass: TNodeClass,
|
|
52
|
+
baseClass: TBaseClass,
|
|
53
|
+
library: WeakMap<TBaseClass, TNodeClass>,
|
|
54
|
+
): void;
|
|
55
|
+
}
|
|
56
|
+
export default NodeLibrary;
|
|
@@ -7,15 +7,15 @@ type GPUStorageTextureAccess = "read-only" | "read-write" | "write-only";
|
|
|
7
7
|
declare class NodeSampledTexture extends SampledTexture {
|
|
8
8
|
textureNode: TextureNode | undefined;
|
|
9
9
|
groupNode: UniformGroupNode;
|
|
10
|
+
|
|
10
11
|
access: "read-write" | "read-only" | "write-only";
|
|
12
|
+
|
|
11
13
|
constructor(
|
|
12
14
|
name: string,
|
|
13
15
|
textureNode: TextureNode | undefined,
|
|
14
16
|
groupNode: UniformGroupNode,
|
|
15
|
-
access
|
|
17
|
+
access?: GPUStorageTextureAccess | null,
|
|
16
18
|
);
|
|
17
|
-
get needsBindingsUpdate(): boolean;
|
|
18
|
-
update(): boolean;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
declare class NodeSampledCubeTexture extends NodeSampledTexture {
|
|
@@ -2,15 +2,13 @@ import { Camera } from "../../../cameras/Camera.js";
|
|
|
2
2
|
import { Object3D } from "../../../core/Object3D.js";
|
|
3
3
|
import { Material } from "../../../materials/Material.js";
|
|
4
4
|
import { Color } from "../../../math/Color.js";
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
UniformGroupNode,
|
|
13
|
-
} from "../../../nodes/Nodes.js";
|
|
5
|
+
import Node from "../../../nodes/core/Node.js";
|
|
6
|
+
import NodeBuilder from "../../../nodes/core/NodeBuilder.js";
|
|
7
|
+
import UniformGroupNode from "../../../nodes/core/UniformGroupNode.js";
|
|
8
|
+
import ComputeNode from "../../../nodes/gpgpu/ComputeNode.js";
|
|
9
|
+
import LightsNode from "../../../nodes/lighting/LightsNode.js";
|
|
10
|
+
import { NodeFrame } from "../../../nodes/Nodes.js";
|
|
11
|
+
import { ShaderNodeObject } from "../../../nodes/TSL.js";
|
|
14
12
|
import { Fog } from "../../../scenes/Fog.js";
|
|
15
13
|
import { FogExp2 } from "../../../scenes/FogExp2.js";
|
|
16
14
|
import { Scene } from "../../../scenes/Scene.js";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export class WebGLProperties {
|
|
2
2
|
constructor();
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
has: (object: unknown) => boolean;
|
|
5
|
+
get: (object: unknown) => unknown;
|
|
6
|
+
remove: (object: unknown) => void;
|
|
7
|
+
update: (object: unknown, key: unknown, value: unknown) => unknown;
|
|
8
|
+
dispose: () => void;
|
|
8
9
|
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
/// <reference types="@webgpu/types" />
|
|
2
|
+
|
|
1
3
|
import { CoordinateSystem } from "../../constants.js";
|
|
2
4
|
import Backend, { BackendParameters } from "../common/Backend.js";
|
|
3
5
|
|
|
4
6
|
export interface WebGPUBackendParameters extends BackendParameters {
|
|
5
7
|
alpha?: boolean | undefined;
|
|
6
|
-
|
|
7
|
-
sampleCount?: number | undefined;
|
|
8
|
+
requiredLimits?: Record<string, GPUSize64> | undefined;
|
|
8
9
|
trackTimestamp?: boolean | undefined;
|
|
10
|
+
device?: GPUDevice | undefined;
|
|
11
|
+
powerPreference?: GPUPowerPreference | undefined;
|
|
12
|
+
context?: GPUCanvasContext | undefined;
|
|
9
13
|
}
|
|
10
14
|
|
|
11
15
|
export default class WebGPUBackend extends Backend {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import StandardRenderer, { StandardRendererParameters } from "../common/StandardRenderer.js";
|
|
2
2
|
import { WebGPUBackendParameters } from "./WebGPUBackend.js";
|
|
3
3
|
|
|
4
|
-
export interface WebGPURendererParameters extends
|
|
4
|
+
export interface WebGPURendererParameters extends StandardRendererParameters, WebGPUBackendParameters {
|
|
5
5
|
forceWebGL?: boolean | undefined;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
export default class WebGPURenderer extends
|
|
8
|
+
export default class WebGPURenderer extends StandardRenderer {
|
|
9
9
|
constructor(parameters?: WebGPURendererParameters);
|
|
10
10
|
}
|
|
@@ -4,7 +4,7 @@ import NodeBuilder from "../../../nodes/core/NodeBuilder.js";
|
|
|
4
4
|
import NodeUniform from "../../../nodes/core/NodeUniform.js";
|
|
5
5
|
import NodeVar from "../../../nodes/core/NodeVar.js";
|
|
6
6
|
import StructTypeNode from "../../../nodes/core/StructTypeNode.js";
|
|
7
|
-
import { ShaderNode } from "../../../nodes/
|
|
7
|
+
import { ShaderNode } from "../../../nodes/tsl/TSLCore.js";
|
|
8
8
|
import { Texture } from "../../../textures/Texture.js";
|
|
9
9
|
import NodeUniformsGroup from "../../common/nodes/NodeUniformsGroup.js";
|
|
10
10
|
|
|
@@ -19,7 +19,7 @@ export default class WGSLNodeBuilder extends NodeBuilder {
|
|
|
19
19
|
builtins: { [key in BuiltinStage]: Map<string, BuiltinType> };
|
|
20
20
|
uniformGroups: { [key in NodeShaderStage]: NodeUniformsGroup };
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
needsToWorkingColorSpace(texture: Texture): boolean;
|
|
23
23
|
_generateTextureSample(
|
|
24
24
|
texture: Texture,
|
|
25
25
|
textureProperty: string,
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { DataTextureLoader, LoadingManager, PixelFormat, TextureDataType } from "three";
|
|
2
|
-
|
|
3
|
-
export interface LogLuv {
|
|
4
|
-
width: number;
|
|
5
|
-
height: number;
|
|
6
|
-
data: Uint16Array | Float32Array;
|
|
7
|
-
format: PixelFormat;
|
|
8
|
-
type: TextureDataType;
|
|
9
|
-
flipY: boolean;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export class LogLuvLoader extends DataTextureLoader {
|
|
13
|
-
type: TextureDataType;
|
|
14
|
-
constructor(manager?: LoadingManager);
|
|
15
|
-
|
|
16
|
-
parse(buffer: Iterable<number>): LogLuv;
|
|
17
|
-
|
|
18
|
-
setDataType(value: TextureDataType): this;
|
|
19
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import Node from "../core/Node.js";
|
|
2
|
-
import TempNode from "../core/TempNode.js";
|
|
3
|
-
import { NodeRepresentation, ShaderNodeObject } from "../shadernode/ShaderNode.js";
|
|
4
|
-
|
|
5
|
-
export default class TextureBicubicNode extends TempNode {
|
|
6
|
-
textureNode: Node;
|
|
7
|
-
blurNode: Node;
|
|
8
|
-
|
|
9
|
-
constructor(textureNode: Node, blurNode?: Node);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const textureBicubic: (textureNode: Node, blurNode?: NodeRepresentation) => ShaderNodeObject<TextureBicubicNode>;
|
|
13
|
-
|
|
14
|
-
declare module "../shadernode/ShaderNode.js" {
|
|
15
|
-
interface NodeElements {
|
|
16
|
-
bicubic: typeof textureBicubic;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import Node from "../core/Node.js";
|
|
2
|
-
import { ShaderNodeObject } from "../shadernode/ShaderNode.js";
|
|
3
|
-
import ArrayElementNode from "../utils/ArrayElementNode.js";
|
|
4
|
-
import BufferNode from "./BufferNode.js";
|
|
5
|
-
|
|
6
|
-
declare class UniformsElementNode extends ArrayElementNode {
|
|
7
|
-
constructor(arrayBuffer: Node, indexNode: Node);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export default class UniformsNode extends BufferNode {
|
|
11
|
-
array: unknown[];
|
|
12
|
-
elementType: string | null;
|
|
13
|
-
|
|
14
|
-
readonly isArrayBufferNode: true;
|
|
15
|
-
|
|
16
|
-
constructor(value: unknown[], elementType?: string | null);
|
|
17
|
-
|
|
18
|
-
getElementLength(): number;
|
|
19
|
-
|
|
20
|
-
element(indexNode: number): ShaderNodeObject<UniformsElementNode>;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export const uniforms: (values: unknown[], nodeType?: string | null) => ShaderNodeObject<UniformsNode>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import Node from "./Node.js";
|
|
2
|
-
import NodeBuilder from "./NodeBuilder.js";
|
|
3
|
-
declare class NodeKeywords {
|
|
4
|
-
keywords: string[];
|
|
5
|
-
nodes: {
|
|
6
|
-
[name: string]: Node;
|
|
7
|
-
};
|
|
8
|
-
keywordsCallback: {
|
|
9
|
-
[name: string]: (name: string) => Node;
|
|
10
|
-
};
|
|
11
|
-
constructor();
|
|
12
|
-
getNode(name: string): Node;
|
|
13
|
-
addKeyword(name: string, callback: (name: string) => Node): this;
|
|
14
|
-
parse(code: string): Node[];
|
|
15
|
-
include(builder: NodeBuilder, code: string): void;
|
|
16
|
-
}
|
|
17
|
-
export default NodeKeywords;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import Node from "../core/Node.js";
|
|
2
|
-
import TempNode from "../core/TempNode.js";
|
|
3
|
-
import { JoinNode } from "../Nodes.js";
|
|
4
|
-
import { NodeRepresentation, ShaderNode, ShaderNodeObject } from "../shadernode/ShaderNode.js";
|
|
5
|
-
|
|
6
|
-
export const BurnNode: (args: { base: Node; blend: Node }) => ShaderNodeObject<JoinNode>;
|
|
7
|
-
|
|
8
|
-
export const DodgeNode: (args: { base: Node; blend: Node }) => ShaderNodeObject<JoinNode>;
|
|
9
|
-
|
|
10
|
-
export const ScreenNode: (args: { base: Node; blend: Node }) => ShaderNodeObject<JoinNode>;
|
|
11
|
-
|
|
12
|
-
export const OverlayNode: (args: { base: Node; blend: Node }) => ShaderNodeObject<JoinNode>;
|
|
13
|
-
|
|
14
|
-
export type BlendMode =
|
|
15
|
-
| typeof BlendModeNode.BURN
|
|
16
|
-
| typeof BlendModeNode.DODGE
|
|
17
|
-
| typeof BlendModeNode.SCREEN
|
|
18
|
-
| typeof BlendModeNode.OVERLAY;
|
|
19
|
-
|
|
20
|
-
export default class BlendModeNode extends TempNode {
|
|
21
|
-
static BURN: "burn";
|
|
22
|
-
static DODGE: "dodge";
|
|
23
|
-
static SCREEN: "screen";
|
|
24
|
-
static OVERLAY: "overlay";
|
|
25
|
-
|
|
26
|
-
baseNode: Node;
|
|
27
|
-
blendMode: BlendMode;
|
|
28
|
-
blendNode: Node;
|
|
29
|
-
|
|
30
|
-
constructor(blendMode: BlendMode, baseNode: Node, blendNode: Node);
|
|
31
|
-
|
|
32
|
-
setup(): Node;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export const burn: (baseNode: NodeRepresentation, blendNode?: NodeRepresentation) => ShaderNodeObject<BlendModeNode>;
|
|
36
|
-
export const dodge: (baseNode: NodeRepresentation, blendNode?: NodeRepresentation) => ShaderNodeObject<BlendModeNode>;
|
|
37
|
-
export const overlay: (baseNode: NodeRepresentation, blendNode?: NodeRepresentation) => ShaderNodeObject<BlendModeNode>;
|
|
38
|
-
export const screen: (baseNode: NodeRepresentation, blendNode?: NodeRepresentation) => ShaderNodeObject<BlendModeNode>;
|
|
39
|
-
|
|
40
|
-
declare module "../shadernode/ShaderNode.js" {
|
|
41
|
-
interface NodeElements {
|
|
42
|
-
burn: typeof burn;
|
|
43
|
-
dodge: typeof dodge;
|
|
44
|
-
overlay: typeof overlay;
|
|
45
|
-
screen: typeof screen;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import TempNode from "../core/TempNode.js";
|
|
2
|
-
import MathNode from "../math/MathNode.js";
|
|
3
|
-
import { NodeRepresentation, ShaderNodeObject } from "../shadernode/ShaderNode.js";
|
|
4
|
-
|
|
5
|
-
export type ColorAdjustmentMethod =
|
|
6
|
-
| typeof ColorAdjustmentNode.SATURATION
|
|
7
|
-
| typeof ColorAdjustmentNode.VIBRANCE
|
|
8
|
-
| typeof ColorAdjustmentNode.HUE;
|
|
9
|
-
|
|
10
|
-
export default class ColorAdjustmentNode extends TempNode {
|
|
11
|
-
static SATURATION: "saturation";
|
|
12
|
-
static VIBRANCE: "vibrance";
|
|
13
|
-
static HUE: "hue";
|
|
14
|
-
|
|
15
|
-
method: ColorAdjustmentMethod;
|
|
16
|
-
|
|
17
|
-
colorNode: Node;
|
|
18
|
-
adjustmentNode: Node;
|
|
19
|
-
|
|
20
|
-
constructor(method: ColorAdjustmentMethod, colorNode: Node, adjustmentNode?: Node);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export const saturation: (
|
|
24
|
-
colorNode: NodeRepresentation,
|
|
25
|
-
adjustmentNode?: NodeRepresentation,
|
|
26
|
-
) => ShaderNodeObject<ColorAdjustmentNode>;
|
|
27
|
-
export const vibrance: (
|
|
28
|
-
colorNode: NodeRepresentation,
|
|
29
|
-
adjustmentNode?: NodeRepresentation,
|
|
30
|
-
) => ShaderNodeObject<ColorAdjustmentNode>;
|
|
31
|
-
export const hue: (
|
|
32
|
-
colorNode: NodeRepresentation,
|
|
33
|
-
adjustmentNode?: NodeRepresentation,
|
|
34
|
-
) => ShaderNodeObject<ColorAdjustmentNode>;
|
|
35
|
-
|
|
36
|
-
export const luminance: (a: NodeRepresentation, b: NodeRepresentation) => ShaderNodeObject<MathNode>;
|
|
37
|
-
|
|
38
|
-
export const threshold: (color: NodeRepresentation, thershold: NodeRepresentation) => ShaderNodeObject<MathNode>;
|
|
39
|
-
|
|
40
|
-
declare module "../shadernode/ShaderNode.js" {
|
|
41
|
-
interface NodeElements {
|
|
42
|
-
saturation: typeof saturation;
|
|
43
|
-
vibrance: typeof vibrance;
|
|
44
|
-
hue: typeof hue;
|
|
45
|
-
threshold: typeof threshold;
|
|
46
|
-
}
|
|
47
|
-
}
|