@types/three 0.170.0 → 0.172.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.
Files changed (197) hide show
  1. three/README.md +1 -1
  2. three/build/three.core.d.ts +1 -0
  3. three/build/three.core.min.d.ts +1 -0
  4. three/build/three.tsl.d.ts +1 -0
  5. three/build/three.tsl.min.d.ts +1 -0
  6. three/examples/jsm/Addons.d.ts +0 -5
  7. three/examples/jsm/controls/ArcballControls.d.ts +6 -1
  8. three/examples/jsm/controls/OrbitControls.d.ts +5 -0
  9. three/examples/jsm/controls/TransformControls.d.ts +1 -1
  10. three/examples/jsm/csm/CSMShadowNode.d.ts +2 -4
  11. three/examples/jsm/exporters/GLTFExporter.d.ts +23 -7
  12. three/examples/jsm/geometries/DecalGeometry.d.ts +1 -1
  13. three/examples/jsm/geometries/InstancedPointsGeometry.d.ts +13 -0
  14. three/examples/jsm/helpers/VertexNormalsHelper.d.ts +2 -0
  15. three/examples/jsm/lines/LineSegments2.d.ts +3 -1
  16. three/examples/jsm/materials/LDrawConditionalLineNodeMaterial.d.ts +1 -1
  17. three/examples/jsm/modifiers/CurveModifier.d.ts +1 -1
  18. three/examples/jsm/modifiers/CurveModifierGPU.d.ts +1 -1
  19. three/examples/jsm/objects/InstancedPoints.d.ts +10 -0
  20. three/examples/jsm/objects/SkyMesh.d.ts +2 -2
  21. three/examples/jsm/objects/Water2Mesh.d.ts +13 -2
  22. three/examples/jsm/objects/WaterMesh.d.ts +11 -2
  23. three/examples/jsm/postprocessing/OutlinePass.d.ts +1 -1
  24. three/examples/jsm/postprocessing/UnrealBloomPass.d.ts +1 -1
  25. three/examples/jsm/tsl/display/AfterImageNode.d.ts +2 -1
  26. three/examples/jsm/tsl/display/AnaglyphPassNode.d.ts +1 -1
  27. three/examples/jsm/tsl/display/AnamorphicNode.d.ts +2 -2
  28. three/examples/jsm/tsl/display/BleachBypass.d.ts +2 -1
  29. three/examples/jsm/tsl/display/BloomNode.d.ts +2 -1
  30. three/examples/jsm/tsl/display/DenoiseNode.d.ts +3 -4
  31. three/examples/jsm/tsl/display/DepthOfFieldNode.d.ts +2 -1
  32. three/examples/jsm/tsl/display/DotScreenNode.d.ts +2 -2
  33. three/examples/jsm/tsl/display/FXAANode.d.ts +2 -1
  34. three/examples/jsm/tsl/display/FilmNode.d.ts +2 -1
  35. three/examples/jsm/tsl/display/GTAONode.d.ts +5 -8
  36. three/examples/jsm/tsl/display/GaussianBlurNode.d.ts +2 -2
  37. three/examples/jsm/tsl/display/LensflareNode.d.ts +2 -2
  38. three/examples/jsm/tsl/display/Lut3DNode.d.ts +2 -2
  39. three/examples/jsm/tsl/display/MotionBlur.d.ts +2 -1
  40. three/examples/jsm/tsl/display/OutlineNode.d.ts +2 -2
  41. three/examples/jsm/tsl/display/ParallaxBarrierPassNode.d.ts +1 -1
  42. three/examples/jsm/tsl/display/PixelationPassNode.d.ts +2 -2
  43. three/examples/jsm/tsl/display/RGBShiftNode.d.ts +2 -1
  44. three/examples/jsm/tsl/display/SMAANode.d.ts +2 -1
  45. three/examples/jsm/tsl/display/SSAAPassNode.d.ts +2 -2
  46. three/examples/jsm/tsl/display/SSRNode.d.ts +2 -2
  47. three/examples/jsm/tsl/display/Sepia.d.ts +2 -1
  48. three/examples/jsm/tsl/display/SobelOperatorNode.d.ts +2 -1
  49. three/examples/jsm/tsl/display/StereoCompositePassNode.d.ts +1 -2
  50. three/examples/jsm/tsl/display/StereoPassNode.d.ts +2 -2
  51. three/examples/jsm/tsl/display/TRAAPassNode.d.ts +2 -2
  52. three/examples/jsm/tsl/display/TransitionNode.d.ts +2 -1
  53. three/examples/jsm/tsl/display/hashBlur.d.ts +2 -1
  54. three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts +2 -1
  55. three/examples/jsm/utils/ShadowMapViewer.d.ts +2 -2
  56. three/package.json +4 -4
  57. three/src/Three.Core.d.ts +159 -0
  58. three/src/Three.TSL.d.ts +533 -0
  59. three/src/Three.WebGPU.Nodes.d.ts +14 -195
  60. three/src/Three.WebGPU.d.ts +14 -196
  61. three/src/Three.d.ts +2 -158
  62. three/src/animation/AnimationClip.d.ts +3 -1
  63. three/src/cameras/CubeCamera.d.ts +19 -2
  64. three/src/core/Clock.d.ts +4 -6
  65. three/src/core/InterleavedBuffer.d.ts +12 -0
  66. three/src/core/RenderTarget.d.ts +3 -5
  67. three/src/core/RenderTarget3D.d.ts +9 -0
  68. three/src/core/RenderTargetArray.d.ts +9 -0
  69. three/src/materials/Material.d.ts +9 -5
  70. three/src/materials/MeshDepthMaterial.d.ts +0 -5
  71. three/src/materials/MeshDistanceMaterial.d.ts +0 -5
  72. three/src/materials/nodes/Line2NodeMaterial.d.ts +1 -0
  73. three/src/materials/nodes/LineDashedNodeMaterial.d.ts +3 -0
  74. three/src/materials/nodes/MeshSSSNodeMaterial.d.ts +6 -6
  75. three/src/materials/nodes/NodeMaterial.d.ts +7 -1
  76. three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +56 -0
  77. three/src/nodes/Nodes.d.ts +2 -7
  78. three/src/nodes/TSL.d.ts +10 -5
  79. three/src/nodes/accessors/Arrays.d.ts +7 -0
  80. three/src/nodes/accessors/BufferAttributeNode.d.ts +117 -0
  81. three/src/nodes/accessors/BufferNode.d.ts +4 -4
  82. three/src/nodes/accessors/BuiltinNode.d.ts +14 -0
  83. three/src/nodes/accessors/ClippingNode.d.ts +6 -0
  84. three/src/nodes/accessors/InstanceNode.d.ts +15 -3
  85. three/src/nodes/accessors/InstancedMeshNode.d.ts +11 -0
  86. three/src/nodes/accessors/Lights.d.ts +15 -0
  87. three/src/nodes/accessors/MaterialNode.d.ts +3 -3
  88. three/src/nodes/accessors/ModelNode.d.ts +10 -2
  89. three/src/nodes/accessors/ModelViewProjectionNode.d.ts +2 -6
  90. three/src/nodes/accessors/StorageBufferNode.d.ts +25 -12
  91. three/src/nodes/accessors/StorageTextureNode.d.ts +5 -3
  92. three/src/nodes/accessors/TextureNode.d.ts +5 -0
  93. three/src/nodes/accessors/UniformArrayNode.d.ts +3 -2
  94. three/src/nodes/core/IndexNode.d.ts +2 -0
  95. three/src/nodes/core/Node.d.ts +237 -0
  96. three/src/nodes/core/NodeAttribute.d.ts +13 -0
  97. three/src/nodes/core/NodeBuilder.d.ts +1 -2
  98. three/src/nodes/core/NodeCache.d.ts +21 -0
  99. three/src/nodes/core/NodeParser.d.ts +11 -0
  100. three/src/nodes/core/NodeUniform.d.ts +28 -0
  101. three/src/nodes/core/NodeUtils.d.ts +7 -0
  102. three/src/nodes/core/NodeVar.d.ts +12 -0
  103. three/src/nodes/core/NodeVarying.d.ts +14 -0
  104. three/src/nodes/core/StackNode.d.ts +6 -1
  105. three/src/nodes/core/StructTypeNode.d.ts +19 -1
  106. three/src/nodes/core/UniformNode.d.ts +44 -0
  107. three/src/nodes/core/VaryingNode.d.ts +3 -0
  108. three/src/nodes/core/constants.d.ts +41 -0
  109. three/src/nodes/display/BlendModes.d.ts +32 -0
  110. three/src/nodes/display/PassNode.d.ts +1 -1
  111. three/src/nodes/display/ScreenNode.d.ts +5 -0
  112. three/src/nodes/display/ViewportDepthNode.d.ts +3 -1
  113. three/src/nodes/fog/Fog.d.ts +26 -0
  114. three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +88 -0
  115. three/src/nodes/gpgpu/BarrierNode.d.ts +12 -0
  116. three/src/nodes/gpgpu/ComputeBuiltinNode.d.ts +13 -0
  117. three/src/nodes/gpgpu/ComputeNode.d.ts +6 -1
  118. three/src/nodes/gpgpu/WorkgroupInfoNode.d.ts +19 -0
  119. three/src/nodes/lighting/AnalyticLightNode.d.ts +11 -0
  120. three/src/nodes/lighting/LightsNode.d.ts +2 -2
  121. three/src/nodes/lighting/PointLightNode.d.ts +3 -0
  122. three/src/nodes/lighting/PointShadowNode.d.ts +30 -0
  123. three/src/nodes/lighting/ShadowBaseNode.d.ts +15 -0
  124. three/src/nodes/lighting/ShadowNode.d.ts +28 -4
  125. three/src/nodes/math/MathNode.d.ts +13 -4
  126. three/src/nodes/math/OperatorNode.d.ts +3 -0
  127. three/src/nodes/tsl/TSLBase.d.ts +5 -0
  128. three/src/nodes/tsl/TSLCore.d.ts +51 -16
  129. three/src/nodes/utils/EquirectUVNode.d.ts +2 -2
  130. three/src/nodes/utils/LoopNode.d.ts +23 -2
  131. three/src/nodes/utils/SplitNode.d.ts +1 -1
  132. three/src/objects/BatchedMesh.d.ts +4 -4
  133. three/src/objects/ClippingGroup.d.ts +41 -0
  134. three/src/renderers/WebGLRenderer.d.ts +10 -8
  135. three/src/renderers/common/Animation.d.ts +41 -4
  136. three/src/renderers/common/Attributes.d.ts +31 -0
  137. three/src/renderers/common/Backend.d.ts +11 -0
  138. three/src/renderers/common/Background.d.ts +22 -0
  139. three/src/renderers/common/BindGroup.d.ts +15 -0
  140. three/src/renderers/common/Binding.d.ts +24 -0
  141. three/src/renderers/common/Bindings.d.ts +54 -0
  142. three/src/renderers/common/Buffer.d.ts +31 -0
  143. three/src/renderers/common/BufferUtils.d.ts +26 -0
  144. three/src/renderers/common/BundleGroup.d.ts +22 -0
  145. three/src/renderers/common/ChainMap.d.ts +31 -1
  146. three/src/renderers/common/ClippingContext.d.ts +61 -14
  147. three/src/renderers/common/Color4.d.ts +36 -0
  148. three/src/renderers/common/ComputePipeline.d.ts +12 -0
  149. three/src/renderers/common/CubeRenderTarget.d.ts +13 -0
  150. three/src/renderers/common/DataMap.d.ts +30 -0
  151. three/src/renderers/common/Geometries.d.ts +52 -0
  152. three/src/renderers/common/Info.d.ts +27 -0
  153. three/src/renderers/common/Pipeline.d.ts +11 -0
  154. three/src/renderers/common/Pipelines.d.ts +104 -0
  155. three/src/renderers/common/ProgrammableStage.d.ts +19 -1
  156. three/src/renderers/common/RenderBundle.d.ts +15 -4
  157. three/src/renderers/common/RenderBundles.d.ts +20 -2
  158. three/src/renderers/common/RenderContext.d.ts +22 -0
  159. three/src/renderers/common/RenderContexts.d.ts +42 -3
  160. three/src/renderers/common/RenderList.d.ts +90 -0
  161. three/src/renderers/common/RenderLists.d.ts +21 -0
  162. three/src/renderers/common/RenderObject.d.ts +160 -5
  163. three/src/renderers/common/RenderObjects.d.ts +56 -0
  164. three/src/renderers/common/RenderPipeline.d.ts +13 -0
  165. three/src/renderers/common/Renderer.d.ts +596 -6
  166. three/src/renderers/common/{PostProcessingUtils.d.ts → RendererUtils.d.ts} +16 -4
  167. three/src/renderers/common/StorageBufferAttribute.d.ts +1 -1
  168. three/src/renderers/common/Textures.d.ts +66 -0
  169. three/src/renderers/common/Uniform.d.ts +106 -0
  170. three/src/renderers/common/UniformBuffer.d.ts +12 -0
  171. three/src/renderers/common/UniformsGroup.d.ts +104 -0
  172. three/src/renderers/common/extras/PMREMGenerator.d.ts +15 -1
  173. three/src/renderers/common/nodes/NodeBuilderState.d.ts +30 -0
  174. three/src/renderers/common/nodes/NodeLibrary.d.ts +73 -4
  175. three/src/renderers/common/nodes/NodeUniform.d.ts +161 -0
  176. three/src/renderers/common/nodes/NodeUniformsGroup.d.ts +14 -2
  177. three/src/renderers/common/nodes/Nodes.d.ts +185 -11
  178. three/src/renderers/webgl/WebGLState.d.ts +1 -1
  179. three/src/renderers/webgpu/nodes/BasicNodeLibrary.d.ts +10 -0
  180. three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +11 -0
  181. three/src/textures/Data3DTexture.d.ts +4 -2
  182. three/src/textures/DataArrayTexture.d.ts +1 -1
  183. three/src/textures/DataTexture.d.ts +7 -2
  184. three/src/textures/Texture.d.ts +3 -0
  185. three/examples/jsm/animation/MMDAnimationHelper.d.ts +0 -99
  186. three/examples/jsm/animation/MMDPhysics.d.ts +0 -128
  187. three/examples/jsm/exporters/MMDExporter.d.ts +0 -11
  188. three/examples/jsm/loaders/MMDLoader.d.ts +0 -60
  189. three/examples/jsm/shaders/MMDToonShader.d.ts +0 -15
  190. three/src/Three.Legacy.d.ts +0 -20
  191. three/src/nodes/core/UniformGroup.d.ts +0 -7
  192. three/src/nodes/display/BlendMode.d.ts +0 -10
  193. three/src/nodes/fog/FogExp2Node.d.ts +0 -14
  194. three/src/nodes/fog/FogNode.d.ts +0 -20
  195. three/src/nodes/fog/FogRangeNode.d.ts +0 -19
  196. three/src/nodes/lighting/LightNode.d.ts +0 -18
  197. three/src/textures/types.d.ts +0 -9
@@ -14,40 +14,201 @@ import {
14
14
  Vector3Uniform,
15
15
  Vector4Uniform,
16
16
  } from "../Uniform.js";
17
+ /**
18
+ * A special form of Number uniform binding type.
19
+ * It's value is managed by a node object.
20
+ *
21
+ * @private
22
+ * @augments NumberUniform
23
+ */
17
24
  declare class NumberNodeUniform extends NumberUniform {
18
25
  nodeUniform: NodeUniform<number>;
26
+ /**
27
+ * Constructs a new node-based Number uniform.
28
+ *
29
+ * @param {NodeUniform} nodeUniform - The node uniform.
30
+ */
19
31
  constructor(nodeUniform: NodeUniform<number>);
32
+ /**
33
+ * Overwritten to return the value of the node uniform.
34
+ *
35
+ * @return {Number} The value.
36
+ */
20
37
  getValue(): number;
38
+ /**
39
+ * Returns the node uniform data type.
40
+ *
41
+ * @return {String} The data type.
42
+ */
43
+ getType(): string | null;
21
44
  }
45
+ /**
46
+ * A special form of Vector2 uniform binding type.
47
+ * It's value is managed by a node object.
48
+ *
49
+ * @private
50
+ * @augments Vector2Uniform
51
+ */
22
52
  declare class Vector2NodeUniform extends Vector2Uniform {
23
53
  nodeUniform: NodeUniform<Vector2>;
54
+ /**
55
+ * Constructs a new node-based Vector2 uniform.
56
+ *
57
+ * @param {NodeUniform} nodeUniform - The node uniform.
58
+ */
24
59
  constructor(nodeUniform: NodeUniform<Vector2>);
60
+ /**
61
+ * Overwritten to return the value of the node uniform.
62
+ *
63
+ * @return {Vector2} The value.
64
+ */
25
65
  getValue(): Vector2;
66
+ /**
67
+ * Returns the node uniform data type.
68
+ *
69
+ * @return {String} The data type.
70
+ */
71
+ getType(): string | null;
26
72
  }
73
+ /**
74
+ * A special form of Vector3 uniform binding type.
75
+ * It's value is managed by a node object.
76
+ *
77
+ * @private
78
+ * @augments Vector3Uniform
79
+ */
27
80
  declare class Vector3NodeUniform extends Vector3Uniform {
28
81
  nodeUniform: NodeUniform<Vector3>;
82
+ /**
83
+ * Constructs a new node-based Vector3 uniform.
84
+ *
85
+ * @param {NodeUniform} nodeUniform - The node uniform.
86
+ */
29
87
  constructor(nodeUniform: NodeUniform<Vector3>);
88
+ /**
89
+ * Overwritten to return the value of the node uniform.
90
+ *
91
+ * @return {Vector3} The value.
92
+ */
30
93
  getValue(): Vector3;
94
+ /**
95
+ * Returns the node uniform data type.
96
+ *
97
+ * @return {String} The data type.
98
+ */
99
+ getType(): string | null;
31
100
  }
101
+ /**
102
+ * A special form of Vector4 uniform binding type.
103
+ * It's value is managed by a node object.
104
+ *
105
+ * @private
106
+ * @augments Vector4Uniform
107
+ */
32
108
  declare class Vector4NodeUniform extends Vector4Uniform {
33
109
  nodeUniform: NodeUniform<Vector4>;
110
+ /**
111
+ * Constructs a new node-based Vector4 uniform.
112
+ *
113
+ * @param {NodeUniform} nodeUniform - The node uniform.
114
+ */
34
115
  constructor(nodeUniform: NodeUniform<Vector4>);
116
+ /**
117
+ * Overwritten to return the value of the node uniform.
118
+ *
119
+ * @return {Vector4} The value.
120
+ */
35
121
  getValue(): Vector4;
122
+ /**
123
+ * Returns the node uniform data type.
124
+ *
125
+ * @return {String} The data type.
126
+ */
127
+ getType(): string | null;
36
128
  }
129
+ /**
130
+ * A special form of Color uniform binding type.
131
+ * It's value is managed by a node object.
132
+ *
133
+ * @private
134
+ * @augments ColorUniform
135
+ */
37
136
  declare class ColorNodeUniform extends ColorUniform {
38
137
  nodeUniform: NodeUniform<Color>;
138
+ /**
139
+ * Constructs a new node-based Color uniform.
140
+ *
141
+ * @param {NodeUniform} nodeUniform - The node uniform.
142
+ */
39
143
  constructor(nodeUniform: NodeUniform<Color>);
144
+ /**
145
+ * Overwritten to return the value of the node uniform.
146
+ *
147
+ * @return {Color} The value.
148
+ */
40
149
  getValue(): Color;
150
+ /**
151
+ * Returns the node uniform data type.
152
+ *
153
+ * @return {String} The data type.
154
+ */
155
+ getType(): string | null;
41
156
  }
157
+ /**
158
+ * A special form of Matrix3 uniform binding type.
159
+ * It's value is managed by a node object.
160
+ *
161
+ * @private
162
+ * @augments Matrix3Uniform
163
+ */
42
164
  declare class Matrix3NodeUniform extends Matrix3Uniform {
43
165
  nodeUniform: NodeUniform<Matrix3>;
166
+ /**
167
+ * Constructs a new node-based Matrix3 uniform.
168
+ *
169
+ * @param {NodeUniform} nodeUniform - The node uniform.
170
+ */
44
171
  constructor(nodeUniform: NodeUniform<Matrix3>);
172
+ /**
173
+ * Overwritten to return the value of the node uniform.
174
+ *
175
+ * @return {Matrix3} The value.
176
+ */
45
177
  getValue(): Matrix3;
178
+ /**
179
+ * Returns the node uniform data type.
180
+ *
181
+ * @return {String} The data type.
182
+ */
183
+ getType(): string | null;
46
184
  }
185
+ /**
186
+ * A special form of Matrix4 uniform binding type.
187
+ * It's value is managed by a node object.
188
+ *
189
+ * @private
190
+ * @augments Matrix4Uniform
191
+ */
47
192
  declare class Matrix4NodeUniform extends Matrix4Uniform {
48
193
  nodeUniform: NodeUniform<Matrix4>;
194
+ /**
195
+ * Constructs a new node-based Matrix4 uniform.
196
+ *
197
+ * @param {NodeUniform} nodeUniform - The node uniform.
198
+ */
49
199
  constructor(nodeUniform: NodeUniform<Matrix4>);
200
+ /**
201
+ * Overwritten to return the value of the node uniform.
202
+ *
203
+ * @return {Matrix4} The value.
204
+ */
50
205
  getValue(): Matrix4;
206
+ /**
207
+ * Returns the node uniform data type.
208
+ *
209
+ * @return {String} The data type.
210
+ */
211
+ getType(): string | null;
51
212
  }
52
213
  export {
53
214
  ColorNodeUniform,
@@ -1,10 +1,22 @@
1
- import { UniformGroupNode, UniformNode } from "../../../nodes/Nodes.js";
1
+ import { UniformGroupNode } from "../../../nodes/Nodes.js";
2
2
  import UniformsGroup from "../UniformsGroup.js";
3
+ /**
4
+ * A special form of uniforms group that represents
5
+ * the individual uniforms as node-based uniforms.
6
+ *
7
+ * @private
8
+ * @augments UniformsGroup
9
+ */
3
10
  declare class NodeUniformsGroup extends UniformsGroup {
4
11
  id: number;
5
12
  groupNode: UniformGroupNode;
6
13
  readonly isNodeUniformsGroup: true;
14
+ /**
15
+ * Constructs a new node-based uniforms group.
16
+ *
17
+ * @param {String} name - The group's name.
18
+ * @param {UniformGroupNode} groupNode - The uniform group node.
19
+ */
7
20
  constructor(name: string, groupNode: UniformGroupNode);
8
- getNodes(): UniformNode<unknown>[];
9
21
  }
10
22
  export default NodeUniformsGroup;
@@ -33,20 +33,33 @@ interface ComputeNodeData {
33
33
  }
34
34
  interface SceneData {
35
35
  background?: Color | Texture | CubeTexture | undefined;
36
- backgroundNode?: Node | undefined;
36
+ backgroundNode?: ShaderNodeObject<Node> | undefined;
37
37
  fog?: Fog | FogExp2 | undefined;
38
- fogNode?: Node | undefined;
38
+ fogNode?: ShaderNodeObject<Node> | undefined;
39
39
  environment?: Texture | undefined;
40
- environmentNode?: Node | undefined;
40
+ environmentNode?: ShaderNodeObject<Node> | undefined;
41
41
  }
42
42
  declare module "../../../scenes/Scene.js" {
43
43
  interface Scene {
44
- environmentNode?: Node | null | undefined;
45
- backgroundNode?: Node | null | undefined;
46
- fogNode?: Node | null | undefined;
44
+ environmentNode?: ShaderNodeObject<Node> | null | undefined;
45
+ backgroundNode?: ShaderNodeObject<Node> | null | undefined;
46
+ fogNode?: ShaderNodeObject<Node> | null | undefined;
47
47
  }
48
48
  }
49
+ /**
50
+ * This renderer module manages node-related objects and is the
51
+ * primary interface between the renderer and the node system.
52
+ *
53
+ * @private
54
+ * @augments DataMap
55
+ */
49
56
  declare class Nodes extends DataMap<{
57
+ /**
58
+ * Constructs a new nodes management component.
59
+ *
60
+ * @param {Renderer} renderer - The renderer.
61
+ * @param {Backend} backend - The renderer's backend.
62
+ */
50
63
  nodeUniformsGroup: {
51
64
  key: NodeUniformsGroup;
52
65
  value: NodeUniformsGroupData;
@@ -75,23 +88,132 @@ declare class Nodes extends DataMap<{
75
88
  groupsData: ChainMap<readonly [UniformGroupNode, NodeUniformsGroup], {
76
89
  version?: number;
77
90
  }>;
91
+ cacheLib: {
92
+ [type: string]: WeakMap<object, ShaderNodeObject<Node> | undefined>;
93
+ };
78
94
  constructor(renderer: Renderer, backend: Backend);
95
+ /**
96
+ * Returns `true` if the given node uniforms group must be updated or not.
97
+ *
98
+ * @param {NodeUniformsGroup} nodeUniformsGroup - The node uniforms group.
99
+ * @return {Boolean} Whether the node uniforms group requires an update or not.
100
+ */
79
101
  updateGroup(nodeUniformsGroup: NodeUniformsGroup): boolean;
102
+ /**
103
+ * Returns the cache key for the given render object.
104
+ *
105
+ * @param {RenderObject} renderObject - The render object.
106
+ * @return {Number} The cache key.
107
+ */
80
108
  getForRenderCacheKey(renderObject: RenderObject): string;
109
+ /**
110
+ * Returns a node builder state for the given render object.
111
+ *
112
+ * @param {RenderObject} renderObject - The render object.
113
+ * @return {NodeBuilderState} The node builder state.
114
+ */
81
115
  getForRender(renderObject: RenderObject): NodeBuilderState;
116
+ /**
117
+ * Deletes the given object from the internal data map
118
+ *
119
+ * @param {Any} object - The object to delete.
120
+ * @return {Object?} The deleted dictionary.
121
+ */
82
122
  delete(
83
123
  object: NodeUniformsGroup | RenderObject | ComputeNode | Scene,
84
124
  ): SceneData | RenderObjectData | NodeUniformsGroupData | ComputeNodeData;
125
+ /**
126
+ * Returns a node builder state for the given compute node.
127
+ *
128
+ * @param {Node} computeNode - The compute node.
129
+ * @return {NodeBuilderState} The node builder state.
130
+ */
85
131
  getForCompute(computeNode: ComputeNode): NodeBuilderState;
132
+ /**
133
+ * Creates a node builder state for the given node builder.
134
+ *
135
+ * @private
136
+ * @param {NodeBuilder} nodeBuilder - The node builder.
137
+ * @return {NodeBuilderState} The node builder state.
138
+ */
86
139
  _createNodeBuilderState(nodeBuilder: NodeBuilder): NodeBuilderState;
87
- getEnvironmentNode(scene: Scene): Node | null;
88
- getBackgroundNode(scene: Scene): Node | null;
89
- getFogNode(scene: Scene): Node | null;
140
+ /**
141
+ * Returns an environment node for the current configured
142
+ * scene environment.
143
+ *
144
+ * @param {Scene} scene - The scene.
145
+ * @return {Node} A node representing the current scene environment.
146
+ */
147
+ getEnvironmentNode(scene: Scene): ShaderNodeObject<Node> | null;
148
+ /**
149
+ * Returns a background node for the current configured
150
+ * scene background.
151
+ *
152
+ * @param {Scene} scene - The scene.
153
+ * @return {Node} A node representing the current scene background.
154
+ */
155
+ getBackgroundNode(scene: Scene): ShaderNodeObject<Node> | null;
156
+ /**
157
+ * Returns a fog node for the current configured scene fog.
158
+ *
159
+ * @param {Scene} scene - The scene.
160
+ * @return {Node} A node representing the current scene fog.
161
+ */
162
+ getFogNode(scene: Scene): ShaderNodeObject<Node> | null;
163
+ /**
164
+ * Returns a cache key for the given scene and lights node.
165
+ * This key is used by `RenderObject` as a part of the dynamic
166
+ * cache key (a key that must be checked every time the render
167
+ * objects is drawn).
168
+ *
169
+ * @param {Scene} scene - The scene.
170
+ * @param {LightsNode} lightsNode - The lights node.
171
+ * @return {Number} The cache key.
172
+ */
90
173
  getCacheKey(scene: Scene, lightsNode: LightsNode): string;
91
- updateScene(scene: Scene): void;
174
+ /**
175
+ * A boolean that indicates whether tone mapping should be enabled
176
+ * or not.
177
+ *
178
+ * @type {Boolean}
179
+ */
92
180
  get isToneMappingState(): boolean;
181
+ /**
182
+ * If a scene background is configured, this method makes sure to
183
+ * represent the background with a corresponding node-based implementation.
184
+ *
185
+ * @param {Scene} scene - The scene.
186
+ */
93
187
  updateBackground(scene: Scene): void;
188
+ /**
189
+ * This method is part of the caching of nodes which are used to represents the
190
+ * scene's background, fog or environment.
191
+ *
192
+ * @param {String} type - The type of object to cache.
193
+ * @param {Object} object - The object.
194
+ * @param {Function} callback - A callback that produces a node representation for the given object.
195
+ * @param {Boolean} [forceUpdate=false] - Whether an update should be enforced or not.
196
+ * @return {Node} The node representation.
197
+ */
198
+ getCacheNode(
199
+ type: string,
200
+ object: object,
201
+ callback: () => ShaderNodeObject<Node> | undefined,
202
+ forceUpdate?: boolean,
203
+ ): ShaderNodeObject<Node> | undefined;
204
+ /**
205
+ * If a scene fog is configured, this method makes sure to
206
+ * represent the fog with a corresponding node-based implementation.
207
+ *
208
+ * @param {Scene} scene - The scene.
209
+ */
94
210
  updateFog(scene: Scene): void;
211
+ /**
212
+ * If a scene environment is configured, this method makes sure to
213
+ * represent the environment with a corresponding node-based implementation.
214
+ *
215
+ * @param {Scene} scene - The scene.
216
+ */
95
217
  updateEnvironment(scene: Scene): void;
96
218
  getNodeFrame(
97
219
  renderer?: Renderer,
@@ -101,14 +223,66 @@ declare class Nodes extends DataMap<{
101
223
  material?: Material | null,
102
224
  ): NodeFrame;
103
225
  getNodeFrameForRender(renderObject: RenderObject): NodeFrame;
226
+ /**
227
+ * Returns the current output cache key.
228
+ *
229
+ * @return {String} The output cache key.
230
+ */
104
231
  getOutputCacheKey(): string;
232
+ /**
233
+ * Checks if the output configuration (tone mapping and color space) for
234
+ * the given target has changed.
235
+ *
236
+ * @param {Texture} outputTarget - The output target.
237
+ * @return {Boolean} Whether the output configuration has changed or not.
238
+ */
105
239
  hasOutputChange(outputTarget: Texture): boolean;
106
- getOutputNode(outputTexture: Texture): ShaderNodeObject<Node>;
240
+ /**
241
+ * Returns a node that represents the output configuration (tone mapping and
242
+ * color space) for the current target.
243
+ *
244
+ * @param {Texture} outputTarget - The output target.
245
+ * @return {Node} The output node.
246
+ */
247
+ getOutputNode(outputTarget: Texture): ShaderNodeObject<Node>;
248
+ /**
249
+ * Triggers the call of `updateBefore()` methods
250
+ * for all nodes of the given render object.
251
+ *
252
+ * @param {RenderObject} renderObject - The render object.
253
+ */
107
254
  updateBefore(renderObject: RenderObject): void;
255
+ /**
256
+ * Triggers the call of `updateAfter()` methods
257
+ * for all nodes of the given render object.
258
+ *
259
+ * @param {RenderObject} renderObject - The render object.
260
+ */
108
261
  updateAfter(renderObject: RenderObject): void;
262
+ /**
263
+ * Triggers the call of `update()` methods
264
+ * for all nodes of the given compute node.
265
+ *
266
+ * @param {Node} computeNode - The compute node.
267
+ */
109
268
  updateForCompute(computeNode: ComputeNode): void;
269
+ /**
270
+ * Triggers the call of `update()` methods
271
+ * for all nodes of the given compute node.
272
+ *
273
+ * @param {RenderObject} renderObject - The render object.
274
+ */
110
275
  updateForRender(renderObject: RenderObject): void;
276
+ /**
277
+ * Returns `true` if the given render object requires a refresh.
278
+ *
279
+ * @param {RenderObject} renderObject - The render object.
280
+ * @return {Boolean} Whether the given render object requires a refresh or not.
281
+ */
111
282
  needsRefresh(renderObject: RenderObject): boolean;
283
+ /**
284
+ * Frees the intenral resources.
285
+ */
112
286
  dispose(): void;
113
287
  }
114
288
  export default Nodes;
@@ -67,7 +67,7 @@ declare class WebGLState {
67
67
  blendDstAlpha?: BlendingDstFactor,
68
68
  premultiplyAlpha?: boolean,
69
69
  ): void;
70
- setMaterial(material: Material, frontFaceCW: boolean): void;
70
+ setMaterial(material: Material, frontFaceCW: boolean, hardwareClippingPlanes: number): void;
71
71
  setFlipSided(flipSided: boolean): void;
72
72
  setCullFace(cullFace: CullFace): void;
73
73
  setLineWidth(width: number): void;
@@ -1,5 +1,15 @@
1
1
  import NodeLibrary from "../../common/nodes/NodeLibrary.js";
2
+ /**
3
+ * This version of a node library represents a basic version
4
+ * just focusing on lights and tone mapping techniques.
5
+ *
6
+ * @private
7
+ * @augments NodeLibrary
8
+ */
2
9
  declare class BasicNodeLibrary extends NodeLibrary {
10
+ /**
11
+ * Constructs a new basic node library.
12
+ */
3
13
  constructor();
4
14
  }
5
15
  export default BasicNodeLibrary;
@@ -1,5 +1,16 @@
1
1
  import NodeLibrary from "../../common/nodes/NodeLibrary.js";
2
+ /**
3
+ * This version of a node library represents the standard version
4
+ * used in {@link WebGPURenderer}. It maps lights, tone mapping
5
+ * techniques and materials to node-based implementations.
6
+ *
7
+ * @private
8
+ * @augments NodeLibrary
9
+ */
2
10
  declare class StandardNodeLibrary extends NodeLibrary {
11
+ /**
12
+ * Constructs a new standard node library.
13
+ */
3
14
  constructor();
4
15
  }
5
16
  export default StandardNodeLibrary;
@@ -1,6 +1,6 @@
1
1
  import { MagnificationTextureFilter, MinificationTextureFilter, Wrapping } from "../constants.js";
2
+ import { TextureImageData } from "./DataTexture.js";
2
3
  import { Texture } from "./Texture.js";
3
- import { Texture3DImageData } from "./types.js";
4
4
 
5
5
  /**
6
6
  * Creates a three-dimensional texture from raw data, with parameters to divide it into width, height, and depth
@@ -93,4 +93,6 @@ export class Data3DTexture extends Texture {
93
93
  unpackAlignment: number;
94
94
  }
95
95
 
96
- export {};
96
+ export interface Texture3DImageData extends TextureImageData {
97
+ depth: number;
98
+ }
@@ -1,6 +1,6 @@
1
1
  import { MagnificationTextureFilter, MinificationTextureFilter } from "../constants.js";
2
+ import { Texture3DImageData } from "./Data3DTexture.js";
2
3
  import { Texture } from "./Texture.js";
3
- import { Texture3DImageData } from "./types.js";
4
4
 
5
5
  /**
6
6
  * Creates an array of textures directly from raw data, width and height and depth
@@ -7,7 +7,6 @@ import {
7
7
  Wrapping,
8
8
  } from "../constants.js";
9
9
  import { Texture } from "./Texture.js";
10
- import { TextureImageData } from "./types.js";
11
10
 
12
11
  /**
13
12
  * Creates a texture directly from raw data, width and height.
@@ -52,7 +51,7 @@ export class DataTexture extends Texture {
52
51
  * @param colorSpace See {@link Texture.colorSpace | .colorSpace}. Default {@link NoColorSpace}
53
52
  */
54
53
  constructor(
55
- data?: BufferSource | null,
54
+ data?: ArrayBufferView | null,
56
55
  width?: number,
57
56
  height?: number,
58
57
  format?: PixelFormat,
@@ -110,3 +109,9 @@ export class DataTexture extends Texture {
110
109
  */
111
110
  unpackAlignment: number;
112
111
  }
112
+
113
+ export interface TextureImageData {
114
+ data: ArrayBufferView;
115
+ height: number;
116
+ width: number;
117
+ }
@@ -10,6 +10,7 @@ import {
10
10
  Wrapping,
11
11
  } from "../constants.js";
12
12
  import { EventDispatcher } from "../core/EventDispatcher.js";
13
+ import { RenderTarget } from "../core/RenderTarget.js";
13
14
  import { Matrix3 } from "../math/Matrix3.js";
14
15
  import { Vector2 } from "../math/Vector2.js";
15
16
  import { CompressedTextureMipmap } from "./CompressedTexture.js";
@@ -426,6 +427,8 @@ export class Texture extends EventDispatcher<{ dispose: {} }> {
426
427
  */
427
428
  static DEFAULT_MAPPING: Mapping;
428
429
 
430
+ renderTarget: RenderTarget | null;
431
+
429
432
  /**
430
433
  * A callback function, called when the texture is updated _(e.g., when needsUpdate has been set to true and then the texture is used)_.
431
434
  */
@@ -1,99 +0,0 @@
1
- import { AnimationClip, AnimationMixer, Audio, Bone, Camera, Mesh, Object3D, Quaternion, SkinnedMesh } from "three";
2
-
3
- import { CCDIKSolver } from "./CCDIKSolver.js";
4
- import { MMDPhysics } from "./MMDPhysics.js";
5
-
6
- export interface MMDAnimationHelperParameter {
7
- sync?: boolean | undefined;
8
- afterglow?: number | undefined;
9
- resetPhysicsOnLoop?: boolean | undefined;
10
- pmxAnimation?: boolean | undefined;
11
- }
12
-
13
- export interface MMDAnimationHelperAddParameter {
14
- animation?: AnimationClip | AnimationClip[] | undefined;
15
- physics?: boolean | undefined;
16
- warmup?: number | undefined;
17
- unitStep?: number | undefined;
18
- maxStepNum?: number | undefined;
19
- gravity?: number | undefined;
20
- delayTime?: number | undefined;
21
- }
22
-
23
- export interface MMDAnimationHelperPoseParameter {
24
- resetPose?: boolean | undefined;
25
- ik?: boolean | undefined;
26
- grant?: boolean | undefined;
27
- }
28
-
29
- export interface MMDAnimationHelperMixer {
30
- looped: boolean;
31
- mixer?: AnimationMixer | undefined;
32
- ikSolver: CCDIKSolver;
33
- grantSolver: GrantSolver;
34
- physics?: MMDPhysics | undefined;
35
- duration?: number | undefined;
36
- }
37
-
38
- /**
39
- * @deprecated The module has been deprecated and will be removed with r172. Please migrate to
40
- * https://github.com/takahirox/three-mmd-loader instead.
41
- */
42
- export class MMDAnimationHelper {
43
- constructor(params?: MMDAnimationHelperParameter);
44
- meshes: SkinnedMesh[];
45
- camera: Camera | null;
46
- cameraTarget: Object3D;
47
- audio: Audio;
48
- audioManager: AudioManager;
49
- configuration: {
50
- sync: boolean;
51
- afterglow: number;
52
- resetPhysicsOnLoop: boolean;
53
- pmxAnimation: boolean;
54
- };
55
- enabled: {
56
- animation: boolean;
57
- ik: boolean;
58
- grant: boolean;
59
- physics: boolean;
60
- cameraAnimation: boolean;
61
- };
62
- objects: WeakMap<SkinnedMesh | Camera | AudioManager, MMDAnimationHelperMixer>;
63
- onBeforePhysics: (mesh: SkinnedMesh) => void;
64
- sharedPhysics: boolean;
65
- masterPhysics: null;
66
-
67
- add(object: SkinnedMesh | Camera | Audio, params?: MMDAnimationHelperAddParameter): this;
68
- remove(object: SkinnedMesh | Camera | Audio): this;
69
- update(delta: number): this;
70
- pose(mesh: SkinnedMesh, vpd: object, params?: MMDAnimationHelperPoseParameter): this;
71
- enable(key: string, enabled: boolean): this;
72
- createGrantSolver(mesh: SkinnedMesh): GrantSolver;
73
- }
74
-
75
- export interface AudioManagerParameter {
76
- delayTime?: number | undefined;
77
- }
78
-
79
- export class AudioManager {
80
- constructor(audio: Audio, params?: AudioManagerParameter);
81
- audio: Audio;
82
- elapsedTime: number;
83
- currentTime: number;
84
- delayTime: number;
85
- audioDuration: number;
86
- duration: number;
87
-
88
- control(delta: number): this;
89
- }
90
-
91
- export class GrantSolver {
92
- constructor(mesh: SkinnedMesh, grants: object[]);
93
- mesh: SkinnedMesh;
94
- grants: object[];
95
-
96
- update(): this;
97
- updateOne(gran: object[]): this;
98
- addGrantRotation(bone: Bone, q: Quaternion, ratio: number): this;
99
- }