@types/three 0.182.0 → 0.183.1

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 (313) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/Addons.d.ts +0 -3
  3. three/examples/jsm/controls/OrbitControls.d.ts +39 -0
  4. three/examples/jsm/effects/AnaglyphEffect.d.ts +4 -0
  5. three/examples/jsm/environments/ColorEnvironment.d.ts +9 -0
  6. three/examples/jsm/gpgpu/BitonicSort.d.ts +5 -5
  7. three/examples/jsm/helpers/AnimationPathHelper.d.ts +38 -0
  8. three/examples/jsm/helpers/ViewHelper.d.ts +4 -1
  9. three/examples/jsm/inspector/tabs/Parameters.d.ts +3 -0
  10. three/examples/jsm/inspector/ui/Item.d.ts +5 -0
  11. three/examples/jsm/libs/meshopt_decoder.module.d.ts +1 -1
  12. three/examples/jsm/lights/LightProbeGenerator.d.ts +11 -5
  13. three/examples/jsm/loaders/ColladaLoader.d.ts +27 -4
  14. three/examples/jsm/objects/SkyMesh.d.ts +11 -6
  15. three/examples/jsm/objects/Water2Mesh.d.ts +7 -7
  16. three/examples/jsm/objects/WaterMesh.d.ts +6 -6
  17. three/examples/jsm/postprocessing/EffectComposer.d.ts +9 -10
  18. three/examples/jsm/postprocessing/UnrealBloomPass.d.ts +4 -9
  19. three/examples/jsm/tsl/display/AnaglyphPassNode.d.ts +30 -0
  20. three/examples/jsm/tsl/display/AnamorphicNode.d.ts +1 -1
  21. three/examples/jsm/tsl/display/BilateralBlurNode.d.ts +27 -0
  22. three/examples/jsm/tsl/display/BloomNode.d.ts +5 -5
  23. three/examples/jsm/tsl/display/CRT.d.ts +22 -0
  24. three/examples/jsm/tsl/display/DenoiseNode.d.ts +5 -5
  25. three/examples/jsm/tsl/display/DotScreenNode.d.ts +4 -6
  26. three/examples/jsm/tsl/display/GTAONode.d.ts +8 -8
  27. three/examples/jsm/tsl/display/GaussianBlurNode.d.ts +4 -2
  28. three/examples/jsm/tsl/display/GodraysNode.d.ts +20 -0
  29. three/examples/jsm/tsl/display/LensflareNode.d.ts +6 -6
  30. three/examples/jsm/tsl/display/Lut3DNode.d.ts +5 -5
  31. three/examples/jsm/tsl/display/MotionBlur.d.ts +1 -1
  32. three/examples/jsm/tsl/display/OutlineNode.d.ts +6 -6
  33. three/examples/jsm/tsl/display/PixelationPassNode.d.ts +10 -10
  34. three/examples/jsm/tsl/display/RGBShiftNode.d.ts +2 -2
  35. three/examples/jsm/tsl/display/RetroPassNode.d.ts +17 -0
  36. three/examples/jsm/tsl/display/SSAAPassNode.d.ts +1 -1
  37. three/examples/jsm/tsl/display/SSGINode.d.ts +11 -11
  38. three/examples/jsm/tsl/display/SSRNode.d.ts +6 -6
  39. three/examples/jsm/tsl/display/SSSNode.d.ts +5 -5
  40. three/examples/jsm/tsl/display/Shape.d.ts +3 -0
  41. three/examples/jsm/tsl/display/TransitionNode.d.ts +3 -3
  42. three/examples/jsm/tsl/display/boxBlur.d.ts +1 -1
  43. three/examples/jsm/tsl/display/depthAwareBlend.d.ts +15 -0
  44. three/examples/jsm/tsl/display/hashBlur.d.ts +1 -1
  45. three/examples/jsm/tsl/math/Bayer.d.ts +2 -0
  46. three/examples/jsm/tsl/utils/Raymarching.d.ts +2 -2
  47. three/package.json +3 -3
  48. three/src/Three.Core.d.ts +1 -1
  49. three/src/Three.TSL.d.ts +6 -11
  50. three/src/Three.WebGPU.Nodes.d.ts +2 -0
  51. three/src/Three.WebGPU.d.ts +3 -0
  52. three/src/Three.d.ts +2 -2
  53. three/src/animation/AnimationClip.d.ts +1 -1
  54. three/src/animation/KeyframeTrack.d.ts +19 -5
  55. three/src/animation/PropertyMixer.d.ts +5 -4
  56. three/src/audio/Audio.d.ts +224 -157
  57. three/src/audio/AudioAnalyser.d.ts +32 -27
  58. three/src/audio/AudioContext.d.ts +12 -12
  59. three/src/audio/AudioListener.d.ts +44 -65
  60. three/src/audio/PositionalAudio.d.ts +69 -62
  61. three/src/cameras/ArrayCamera.d.ts +21 -24
  62. three/src/cameras/Camera.d.ts +14 -53
  63. three/src/cameras/CubeCamera.d.ts +32 -28
  64. three/src/cameras/OrthographicCamera.d.ts +70 -100
  65. three/src/cameras/PerspectiveCamera.d.ts +133 -146
  66. three/src/cameras/StereoCamera.d.ts +24 -30
  67. three/src/constants.d.ts +14 -2
  68. three/src/core/Clock.d.ts +3 -0
  69. three/src/core/Object3D.d.ts +31 -7
  70. three/src/geometries/TorusGeometry.d.ts +22 -3
  71. three/src/helpers/ArrowHelper.d.ts +34 -50
  72. three/src/helpers/AxesHelper.d.ts +22 -36
  73. three/src/helpers/Box3Helper.d.ts +14 -25
  74. three/src/helpers/BoxHelper.d.ts +28 -39
  75. three/src/helpers/CameraHelper.d.ts +31 -52
  76. three/src/helpers/DirectionalLightHelper.d.ts +32 -53
  77. three/src/helpers/GridHelper.d.ts +15 -29
  78. three/src/helpers/HemisphereLightHelper.d.ts +26 -49
  79. three/src/helpers/PlaneHelper.d.ts +21 -33
  80. three/src/helpers/PointLightHelper.d.ts +25 -50
  81. three/src/helpers/PolarGridHelper.d.ts +19 -32
  82. three/src/helpers/SkeletonHelper.d.ts +26 -50
  83. three/src/helpers/SpotLightHelper.d.ts +28 -55
  84. three/src/lights/AmbientLight.d.ts +15 -23
  85. three/src/lights/DirectionalLight.d.ts +40 -82
  86. three/src/lights/DirectionalLightShadow.d.ts +6 -61
  87. three/src/lights/HemisphereLight.d.ts +20 -47
  88. three/src/lights/Light.d.ts +18 -48
  89. three/src/lights/LightProbe.d.ts +24 -29
  90. three/src/lights/LightShadow.d.ts +107 -91
  91. three/src/lights/PointLight.d.ts +36 -77
  92. three/src/lights/PointLightShadow.d.ts +9 -6
  93. three/src/lights/RectAreaLight.d.ts +39 -59
  94. three/src/lights/SpotLight.d.ts +62 -116
  95. three/src/lights/SpotLightShadow.d.ts +17 -59
  96. three/src/lights/webgpu/IESSpotLight.d.ts +13 -1
  97. three/src/lights/webgpu/ProjectorLight.d.ts +9 -10
  98. three/src/materials/MeshLambertMaterial.d.ts +6 -0
  99. three/src/materials/MeshPhongMaterial.d.ts +6 -0
  100. three/src/materials/nodes/Line2NodeMaterial.d.ts +0 -6
  101. three/src/materials/nodes/LineBasicNodeMaterial.d.ts +0 -4
  102. three/src/materials/nodes/MeshBasicNodeMaterial.d.ts +1 -2
  103. three/src/materials/nodes/MeshLambertNodeMaterial.d.ts +0 -2
  104. three/src/materials/nodes/MeshNormalNodeMaterial.d.ts +0 -2
  105. three/src/materials/nodes/MeshSSSNodeMaterial.d.ts +5 -8
  106. three/src/materials/nodes/MeshToonNodeMaterial.d.ts +0 -4
  107. three/src/materials/nodes/NodeMaterial.d.ts +9 -3
  108. three/src/materials/nodes/SpriteNodeMaterial.d.ts +0 -3
  109. three/src/materials/nodes/VolumeNodeMaterial.d.ts +0 -2
  110. three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +39 -93
  111. three/src/math/Color.d.ts +1 -0
  112. three/src/math/Vector3.d.ts +2 -2
  113. three/src/math/interpolants/BezierInterpolant.d.ts +7 -0
  114. three/src/nodes/Nodes.d.ts +55 -35
  115. three/src/nodes/TSL.d.ts +2 -5
  116. three/src/nodes/accessors/Arrays.d.ts +19 -10
  117. three/src/nodes/accessors/BufferAttributeNode.d.ts +99 -33
  118. three/src/nodes/accessors/BufferNode.d.ts +21 -7
  119. three/src/nodes/accessors/Camera.d.ts +10 -10
  120. three/src/nodes/accessors/CubeTextureNode.d.ts +1 -1
  121. three/src/nodes/accessors/InstanceNode.d.ts +6 -0
  122. three/src/nodes/accessors/Lights.d.ts +9 -6
  123. three/src/nodes/accessors/MaterialNode.d.ts +1 -3
  124. three/src/nodes/accessors/MaterialProperties.d.ts +4 -4
  125. three/src/nodes/accessors/MaterialReferenceNode.d.ts +1 -1
  126. three/src/nodes/accessors/ModelNode.d.ts +34 -17
  127. three/src/nodes/accessors/MorphNode.d.ts +1 -1
  128. three/src/nodes/accessors/Normal.d.ts +13 -15
  129. three/src/nodes/accessors/Object3DNode.d.ts +35 -16
  130. three/src/nodes/accessors/Position.d.ts +9 -7
  131. three/src/nodes/accessors/ReferenceNode.d.ts +16 -7
  132. three/src/nodes/accessors/ReflectVector.d.ts +4 -5
  133. three/src/nodes/accessors/RendererReferenceNode.d.ts +1 -1
  134. three/src/nodes/accessors/SceneProperties.d.ts +5 -0
  135. three/src/nodes/accessors/SkinningNode.d.ts +5 -3
  136. three/src/nodes/accessors/StorageBufferNode.d.ts +49 -22
  137. three/src/nodes/accessors/StorageTextureNode.d.ts +1 -1
  138. three/src/nodes/accessors/Tangent.d.ts +5 -7
  139. three/src/nodes/accessors/Texture3DNode.d.ts +1 -1
  140. three/src/nodes/accessors/TextureBicubic.d.ts +3 -2
  141. three/src/nodes/accessors/TextureNode.d.ts +19 -18
  142. three/src/nodes/accessors/UV.d.ts +1 -1
  143. three/src/nodes/accessors/UniformArrayNode.d.ts +10 -8
  144. three/src/nodes/accessors/UserDataNode.d.ts +1 -1
  145. three/src/nodes/accessors/VelocityNode.d.ts +3 -3
  146. three/src/nodes/accessors/VertexColorNode.d.ts +1 -1
  147. three/src/nodes/code/FunctionCallNode.d.ts +0 -1
  148. three/src/nodes/code/FunctionNode.d.ts +7 -3
  149. three/src/nodes/core/ArrayNode.d.ts +2 -3
  150. three/src/nodes/core/AttributeNode.d.ts +12 -6
  151. three/src/nodes/core/BypassNode.d.ts +2 -3
  152. three/src/nodes/core/ConstNode.d.ts +10 -3
  153. three/src/nodes/core/ContextNode.d.ts +23 -28
  154. three/src/nodes/core/IndexNode.d.ts +1 -1
  155. three/src/nodes/core/InputNode.d.ts +12 -4
  156. three/src/nodes/core/InspectorNode.d.ts +2 -3
  157. three/src/nodes/core/IsolateNode.d.ts +2 -7
  158. three/src/nodes/core/MRTNode.d.ts +7 -0
  159. three/src/nodes/core/Node.d.ts +258 -39
  160. three/src/nodes/core/NodeAttribute.d.ts +30 -5
  161. three/src/nodes/core/NodeBuilder.d.ts +5 -3
  162. three/src/nodes/core/NodeCache.d.ts +24 -48
  163. three/src/nodes/core/NodeError.d.ts +9 -0
  164. three/src/nodes/core/NodeParser.d.ts +2 -0
  165. three/src/nodes/core/NodeUniform.d.ts +33 -9
  166. three/src/nodes/core/NodeVar.d.ts +33 -5
  167. three/src/nodes/core/NodeVarying.d.ts +32 -4
  168. three/src/nodes/core/ParameterNode.d.ts +11 -4
  169. three/src/nodes/core/PropertyNode.d.ts +45 -35
  170. three/src/nodes/core/StackTrace.d.ts +9 -0
  171. three/src/nodes/core/StructType.d.ts +3 -1
  172. three/src/nodes/core/StructTypeNode.d.ts +19 -5
  173. three/src/nodes/core/TempNode.d.ts +9 -3
  174. three/src/nodes/core/UniformNode.d.ts +53 -15
  175. three/src/nodes/core/VarNode.d.ts +15 -14
  176. three/src/nodes/core/VaryingNode.d.ts +14 -19
  177. three/src/nodes/core/constants.d.ts +9 -4
  178. three/src/nodes/display/BlendModes.d.ts +7 -27
  179. three/src/nodes/display/ColorAdjustment.d.ts +8 -9
  180. three/src/nodes/display/ColorSpaceNode.d.ts +2 -8
  181. three/src/nodes/display/FrontFacingNode.d.ts +1 -1
  182. three/src/nodes/display/PassNode.d.ts +9 -5
  183. three/src/nodes/display/RenderOutputNode.d.ts +3 -7
  184. three/src/nodes/display/ScreenNode.d.ts +25 -17
  185. three/src/nodes/display/ToneMappingNode.d.ts +3 -7
  186. three/src/nodes/display/ViewportDepthNode.d.ts +11 -7
  187. three/src/nodes/display/ViewportTextureNode.d.ts +2 -0
  188. three/src/nodes/fog/Fog.d.ts +5 -3
  189. three/src/nodes/geometry/RangeNode.d.ts +51 -9
  190. three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +2 -0
  191. three/src/nodes/gpgpu/BarrierNode.d.ts +2 -0
  192. three/src/nodes/gpgpu/ComputeNode.d.ts +2 -7
  193. three/src/nodes/lighting/AnalyticLightNode.d.ts +1 -1
  194. three/src/nodes/lighting/HemisphereLightNode.d.ts +3 -2
  195. three/src/nodes/lighting/LightProbeNode.d.ts +1 -1
  196. three/src/nodes/lighting/LightUtils.d.ts +1 -1
  197. three/src/nodes/lighting/LightingContextNode.d.ts +1 -1
  198. three/src/nodes/lighting/SpotLightNode.d.ts +0 -6
  199. three/src/nodes/materialx/MaterialXNodes.d.ts +11 -11
  200. three/src/nodes/math/BitcountNode.d.ts +2 -0
  201. three/src/nodes/math/ConditionalNode.d.ts +43 -22
  202. three/src/nodes/math/Hash.d.ts +1 -1
  203. three/src/nodes/math/MathNode.d.ts +603 -267
  204. three/src/nodes/math/MathUtils.d.ts +9 -5
  205. three/src/nodes/math/OperatorNode.d.ts +490 -227
  206. three/src/nodes/math/TriNoise3D.d.ts +3 -3
  207. three/src/nodes/pmrem/PMREMNode.d.ts +1 -1
  208. three/src/nodes/procedural/Checker.d.ts +1 -1
  209. three/src/nodes/tsl/TSLCore.d.ts +1683 -224
  210. three/src/nodes/utils/ArrayElementNode.d.ts +9 -4
  211. three/src/nodes/utils/DebugNode.d.ts +2 -5
  212. three/src/nodes/utils/Discard.d.ts +2 -3
  213. three/src/nodes/utils/FlipNode.d.ts +11 -0
  214. three/src/nodes/utils/LoopNode.d.ts +17 -13
  215. three/src/nodes/utils/MaxMipLevelNode.d.ts +1 -1
  216. three/src/nodes/utils/Oscillators.d.ts +4 -4
  217. three/src/nodes/utils/Packing.d.ts +3 -3
  218. three/src/nodes/utils/PostProcessingUtils.d.ts +5 -5
  219. three/src/nodes/utils/RemapNode.d.ts +33 -39
  220. three/src/nodes/utils/RotateNode.d.ts +17 -8
  221. three/src/nodes/utils/SplitNode.d.ts +1 -2
  222. three/src/nodes/utils/SpriteSheetUV.d.ts +7 -0
  223. three/src/nodes/utils/StorageArrayElementNode.d.ts +18 -9
  224. three/src/nodes/utils/Timer.d.ts +4 -4
  225. three/src/nodes/utils/TriplanarTextures.d.ts +2 -2
  226. three/src/nodes/utils/UVUtils.d.ts +6 -4
  227. three/src/objects/BatchedMesh.d.ts +6 -4
  228. three/src/objects/InstancedMesh.d.ts +32 -24
  229. three/src/renderers/WebGLRenderer.d.ts +4 -93
  230. three/src/renderers/common/Animation.d.ts +46 -9
  231. three/src/renderers/common/Attributes.d.ts +11 -13
  232. three/src/renderers/common/Backend.d.ts +0 -2
  233. three/src/renderers/common/Background.d.ts +17 -15
  234. three/src/renderers/common/BindGroup.d.ts +27 -13
  235. three/src/renderers/common/Binding.d.ts +15 -3
  236. three/src/renderers/common/Bindings.d.ts +41 -17
  237. three/src/renderers/common/BlendMode.d.ts +22 -0
  238. three/src/renderers/common/Buffer.d.ts +35 -11
  239. three/src/renderers/common/BufferUtils.d.ts +3 -4
  240. three/src/renderers/common/BundleGroup.d.ts +16 -6
  241. three/src/renderers/common/CanvasTarget.d.ts +76 -13
  242. three/src/renderers/common/ChainMap.d.ts +12 -9
  243. three/src/renderers/common/ClippingContext.d.ts +61 -10
  244. three/src/renderers/common/Color4.d.ts +10 -5
  245. three/src/renderers/common/ComputePipeline.d.ts +16 -2
  246. three/src/renderers/common/Constants.d.ts +5 -3
  247. three/src/renderers/common/CubeRenderTarget.d.ts +24 -7
  248. three/src/renderers/common/DataMap.d.ts +10 -18
  249. three/src/renderers/common/Geometries.d.ts +39 -20
  250. three/src/renderers/common/Info.d.ts +62 -9
  251. three/src/renderers/common/InspectorBase.d.ts +19 -7
  252. three/src/renderers/common/Lighting.d.ts +2 -6
  253. three/src/renderers/common/Pipeline.d.ts +14 -2
  254. three/src/renderers/common/Pipelines.d.ts +58 -60
  255. three/src/renderers/common/PostProcessing.d.ts +14 -17
  256. three/src/renderers/common/ProgrammableStage.d.ts +48 -8
  257. three/src/renderers/common/RenderBundle.d.ts +4 -2
  258. three/src/renderers/common/RenderBundles.d.ts +6 -3
  259. three/src/renderers/common/RenderContext.d.ts +175 -7
  260. three/src/renderers/common/RenderContexts.d.ts +20 -25
  261. three/src/renderers/common/RenderList.d.ts +77 -11
  262. three/src/renderers/common/RenderLists.d.ts +16 -4
  263. three/src/renderers/common/RenderObject.d.ts +223 -47
  264. three/src/renderers/common/RenderObjectPipeline.d.ts +33 -0
  265. three/src/renderers/common/RenderObjects.d.ts +55 -22
  266. three/src/renderers/common/RenderPipeline.d.ts +20 -17
  267. three/src/renderers/common/Renderer.d.ts +625 -207
  268. three/src/renderers/common/Textures.d.ts +24 -46
  269. three/src/renderers/common/TimestampQueryPool.d.ts +62 -8
  270. three/src/renderers/common/Uniform.d.ts +143 -58
  271. three/src/renderers/common/UniformBuffer.d.ts +7 -5
  272. three/src/renderers/common/UniformsGroup.d.ts +50 -35
  273. three/src/renderers/common/XRManager.d.ts +321 -83
  274. three/src/renderers/common/XRRenderTarget.d.ts +49 -6
  275. three/src/renderers/common/nodes/NodeBuilderState.d.ts +75 -15
  276. three/src/renderers/common/nodes/NodeLibrary.d.ts +25 -5
  277. three/src/renderers/common/nodes/{Nodes.d.ts → NodeManager.d.ts} +54 -73
  278. three/src/renderers/common/nodes/NodeUniform.d.ts +60 -70
  279. three/src/renderers/common/nodes/NodeUniformsGroup.d.ts +23 -4
  280. three/src/renderers/shaders/UniformsLib.d.ts +0 -3
  281. three/src/renderers/webgl/WebGLAttributes.d.ts +9 -7
  282. three/src/renderers/webgl/WebGLEnvironments.d.ts +8 -0
  283. three/src/renderers/webgl/WebGLExtensions.d.ts +1 -1
  284. three/src/renderers/webgl/WebGLIndexedBufferRenderer.d.ts +9 -5
  285. three/src/renderers/webgl/WebGLLights.d.ts +19 -18
  286. three/src/renderers/webgl/WebGLObjects.d.ts +15 -2
  287. three/src/renderers/webgl/WebGLProgram.d.ts +2 -10
  288. three/src/renderers/webgl/WebGLPrograms.d.ts +2 -2
  289. three/src/renderers/webgl/WebGLRenderLists.d.ts +1 -3
  290. three/src/renderers/webgl/WebGLShadowMap.d.ts +0 -5
  291. three/src/renderers/webgl/WebGLState.d.ts +305 -28
  292. three/src/renderers/webgl/WebGLTextures.d.ts +10 -9
  293. three/src/renderers/webgl/WebGLUniforms.d.ts +0 -7
  294. three/src/renderers/webgpu/WebGPUBackend.d.ts +0 -1
  295. three/src/renderers/webgpu/nodes/BasicNodeLibrary.d.ts +2 -4
  296. three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +15 -4
  297. three/src/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts +1 -1
  298. three/src/scenes/Fog.d.ts +31 -37
  299. three/src/scenes/FogExp2.d.ts +26 -31
  300. three/src/scenes/Scene.d.ts +51 -65
  301. three/src/textures/CompressedArrayTexture.d.ts +1 -1
  302. three/src/textures/DataArrayTexture.d.ts +1 -1
  303. three/src/utils.d.ts +5 -0
  304. three/examples/jsm/materials/MeshGouraudMaterial.d.ts +0 -18
  305. three/examples/jsm/materials/MeshPostProcessingMaterial.d.ts +0 -13
  306. three/examples/jsm/shaders/GodRaysShader.d.ts +0 -44
  307. three/src/nodes/accessors/SceneNode.d.ts +0 -21
  308. three/src/nodes/code/ScriptableNode.d.ts +0 -21
  309. three/src/nodes/code/ScriptableValueNode.d.ts +0 -9
  310. three/src/nodes/display/PosterizeNode.d.ts +0 -13
  311. three/src/nodes/utils/SpriteSheetUVNode.d.ts +0 -15
  312. three/src/renderers/webgl/WebGLCubeMaps.d.ts +0 -8
  313. three/src/renderers/webgl/WebGLCubeUVMaps.d.ts +0 -9
@@ -1,4 +1,5 @@
1
1
  import { RenderTarget, RenderTargetOptions } from "../../core/RenderTarget.js";
2
+
2
3
  /**
3
4
  * A special type of render target that is used when rendering
4
5
  * with the WebXR Device API.
@@ -6,11 +7,7 @@ import { RenderTarget, RenderTargetOptions } from "../../core/RenderTarget.js";
6
7
  * @private
7
8
  * @augments RenderTarget
8
9
  */
9
- declare class XRRenderTarget extends RenderTarget {
10
- readonly isXRRenderTarget: true;
11
- _hasExternalTextures: boolean;
12
- _autoAllocateDepthBuffer: boolean;
13
- _isOpaqueFramebuffer: boolean;
10
+ export class XRRenderTarget extends RenderTarget {
14
11
  /**
15
12
  * Constructs a new XR render target.
16
13
  *
@@ -19,6 +16,52 @@ declare class XRRenderTarget extends RenderTarget {
19
16
  * @param {Object} [options={}] - The configuration options.
20
17
  */
21
18
  constructor(width?: number, height?: number, options?: RenderTargetOptions);
19
+ /**
20
+ * This flag can be used for type testing.
21
+ *
22
+ * @type {boolean}
23
+ * @readonly
24
+ * @default true
25
+ */
26
+ readonly isXRRenderTarget: boolean;
27
+ /**
28
+ * Whether the attachments of the render target
29
+ * are defined by external textures. This flag is
30
+ * set to `true` when using the WebXR Layers API.
31
+ *
32
+ * @private
33
+ * @type {boolean}
34
+ * @default false
35
+ */
36
+ private _hasExternalTextures;
37
+ /**
38
+ * Whether a depth buffer should automatically be allocated
39
+ * for this XR render target or not.
40
+ *
41
+ * Allocating a depth buffer is the default behavior of XR render
42
+ * targets. However, when using the WebXR Layers API, this flag
43
+ * must be set to `false` when the `ignoreDepthValues` property of
44
+ * the projection layers evaluates to `false`.
45
+ *
46
+ * Reference: {@link https://www.w3.org/TR/webxrlayers-1/#dom-xrprojectionlayer-ignoredepthvalues}.
47
+ *
48
+ * @private
49
+ * @type {boolean}
50
+ * @default true
51
+ */
52
+ private _autoAllocateDepthBuffer;
53
+ /**
54
+ * Whether this render target is associated with a XRWebGLLayer.
55
+ *
56
+ * A XRWebGLLayer points to an opaque framebuffer. Basically,
57
+ * this means that you don't have access to its bound color,
58
+ * stencil and depth buffers. We need to handle this framebuffer
59
+ * differently since its textures are always bound.
60
+ *
61
+ * @private
62
+ * @type {boolean}
63
+ * @default false
64
+ */
65
+ private _isOpaqueFramebuffer;
22
66
  copy(source: XRRenderTarget): this;
23
67
  }
24
- export { XRRenderTarget };
@@ -2,6 +2,7 @@ import NodeMaterialObserver from "../../../materials/nodes/manager/NodeMaterialO
2
2
  import Node from "../../../nodes/core/Node.js";
3
3
  import NodeAttribute from "../../../nodes/core/NodeAttribute.js";
4
4
  import BindGroup from "../BindGroup.js";
5
+
5
6
  /**
6
7
  * This module represents the state of a node builder after it was
7
8
  * used to build the nodes for a render object. The state holds the
@@ -12,17 +13,6 @@ import BindGroup from "../BindGroup.js";
12
13
  * @private
13
14
  */
14
15
  declare class NodeBuilderState {
15
- vertexShader: string | null;
16
- fragmentShader: string | null;
17
- computeShader: string | null;
18
- transforms: never[];
19
- nodeAttributes: NodeAttribute[];
20
- bindings: BindGroup[];
21
- updateNodes: Node[];
22
- updateBeforeNodes: Node[];
23
- updateAfterNodes: Node[];
24
- observer: NodeMaterialObserver;
25
- usedTimes: number;
26
16
  /**
27
17
  * Constructs a new node builder state.
28
18
  *
@@ -38,17 +28,86 @@ declare class NodeBuilderState {
38
28
  * @param {Array<Object>} transforms - An array with transform attribute objects. Only relevant when using compute shaders with WebGL 2.
39
29
  */
40
30
  constructor(
41
- vertexShader: string | null,
42
- fragmentShader: string | null,
43
- computeShader: string | null,
31
+ vertexShader: string,
32
+ fragmentShader: string,
33
+ computeShader: string,
44
34
  nodeAttributes: NodeAttribute[],
45
35
  bindings: BindGroup[],
46
36
  updateNodes: Node[],
47
37
  updateBeforeNodes: Node[],
48
38
  updateAfterNodes: Node[],
49
39
  observer: NodeMaterialObserver,
50
- transforms?: never[],
40
+ transforms?: unknown[],
51
41
  );
42
+ /**
43
+ * The native vertex shader code.
44
+ *
45
+ * @type {string}
46
+ */
47
+ vertexShader: string;
48
+ /**
49
+ * The native fragment shader code.
50
+ *
51
+ * @type {string}
52
+ */
53
+ fragmentShader: string;
54
+ /**
55
+ * The native compute shader code.
56
+ *
57
+ * @type {string}
58
+ */
59
+ computeShader: string;
60
+ /**
61
+ * An array with transform attribute objects.
62
+ * Only relevant when using compute shaders with WebGL 2.
63
+ *
64
+ * @type {Array<Object>}
65
+ */
66
+ transforms: unknown[];
67
+ /**
68
+ * An array of node attributes representing
69
+ * the attributes of the shaders.
70
+ *
71
+ * @type {Array<NodeAttribute>}
72
+ */
73
+ nodeAttributes: NodeAttribute[];
74
+ /**
75
+ * An array of bind groups representing the uniform or storage
76
+ * buffers, texture or samplers of the shader.
77
+ *
78
+ * @type {Array<BindGroup>}
79
+ */
80
+ bindings: BindGroup[];
81
+ /**
82
+ * An array of nodes that implement their `update()` method.
83
+ *
84
+ * @type {Array<Node>}
85
+ */
86
+ updateNodes: Node[];
87
+ /**
88
+ * An array of nodes that implement their `updateBefore()` method.
89
+ *
90
+ * @type {Array<Node>}
91
+ */
92
+ updateBeforeNodes: Node[];
93
+ /**
94
+ * An array of nodes that implement their `updateAfter()` method.
95
+ *
96
+ * @type {Array<Node>}
97
+ */
98
+ updateAfterNodes: Node[];
99
+ /**
100
+ * A node material observer.
101
+ *
102
+ * @type {NodeMaterialObserver}
103
+ */
104
+ observer: NodeMaterialObserver;
105
+ /**
106
+ * How often this state is used by render objects.
107
+ *
108
+ * @type {number}
109
+ */
110
+ usedTimes: number;
52
111
  /**
53
112
  * This method is used to create a array of bind groups based
54
113
  * on the existing bind groups of this state. Shared groups are
@@ -58,4 +117,5 @@ declare class NodeBuilderState {
58
117
  */
59
118
  createBindings(): BindGroup[];
60
119
  }
120
+
61
121
  export default NodeBuilderState;
@@ -4,6 +4,7 @@ import { Material } from "../../../materials/Material.js";
4
4
  import NodeMaterial from "../../../materials/nodes/NodeMaterial.js";
5
5
  import Node from "../../../nodes/core/Node.js";
6
6
  import AnalyticLightNode from "../../../nodes/lighting/AnalyticLightNode.js";
7
+
7
8
  /**
8
9
  * The purpose of a node library is to assign node implementations
9
10
  * to existing library features. In `WebGPURenderer` lights, materials
@@ -13,19 +14,31 @@ import AnalyticLightNode from "../../../nodes/lighting/AnalyticLightNode.js";
13
14
  * @private
14
15
  */
15
16
  declare class NodeLibrary {
17
+ /**
18
+ * A weak map that maps lights to light nodes.
19
+ *
20
+ * @type {WeakMap<Light.constructor,AnalyticLightNode.constructor>}
21
+ */
16
22
  lightNodes: WeakMap<{
17
23
  new(): Light;
18
24
  }, {
19
25
  new(light: Light): AnalyticLightNode<Light>;
20
26
  }>;
27
+ /**
28
+ * A map that maps materials to node materials.
29
+ *
30
+ * @type {Map<string,NodeMaterial.constructor>}
31
+ */
21
32
  materialNodes: Map<string, {
22
33
  new(): NodeMaterial;
23
34
  }>;
24
- toneMappingNodes: Map<ToneMapping, (color: Node, exposure: Node) => Node>;
25
35
  /**
26
- * Constructs a new node library.
36
+ * A map that maps tone mapping techniques (constants)
37
+ * to tone mapping node functions.
38
+ *
39
+ * @type {Map<number,Function>}
27
40
  */
28
- constructor();
41
+ toneMappingNodes: Map<ToneMapping, (color: Node, exposure: Node) => Node>;
29
42
  /**
30
43
  * Returns a matching node material instance for the given material object.
31
44
  *
@@ -36,7 +49,7 @@ declare class NodeLibrary {
36
49
  * @param {Material} material - A material.
37
50
  * @return {NodeMaterial} The corresponding node material.
38
51
  */
39
- fromMaterial(material: Material): Material | NodeMaterial | null;
52
+ fromMaterial(material: Material): NodeMaterial;
40
53
  /**
41
54
  * Adds a tone mapping node function for a tone mapping technique (constant).
42
55
  *
@@ -73,7 +86,13 @@ declare class NodeLibrary {
73
86
  * @param {Light.constructor} light - The light class definition.
74
87
  * @return {?AnalyticLightNode.constructor} The light node class definition. Returns `null` if no light node is found.
75
88
  */
76
- getLightNodeClass(light: Light): (new(light: Light) => AnalyticLightNode<Light>) | null;
89
+ getLightNodeClass(light: {
90
+ new(): Light;
91
+ }):
92
+ | ({
93
+ new(light: Light): AnalyticLightNode<Light>;
94
+ })
95
+ | null;
77
96
  /**
78
97
  * Adds a light node class definition for a given light class definition.
79
98
  *
@@ -106,4 +125,5 @@ declare class NodeLibrary {
106
125
  library: WeakMap<TBaseClass, TNodeClass>,
107
126
  ): void;
108
127
  }
128
+
109
129
  export default NodeLibrary;
@@ -1,17 +1,11 @@
1
1
  import { Camera } from "../../../cameras/Camera.js";
2
2
  import { Object3D } from "../../../core/Object3D.js";
3
3
  import { Material } from "../../../materials/Material.js";
4
- import { Color } from "../../../math/Color.js";
5
4
  import Node from "../../../nodes/core/Node.js";
6
- import NodeBuilder from "../../../nodes/core/NodeBuilder.js";
7
- import UniformGroupNode from "../../../nodes/core/UniformGroupNode.js";
5
+ import NodeFrame from "../../../nodes/core/NodeFrame.js";
8
6
  import ComputeNode from "../../../nodes/gpgpu/ComputeNode.js";
9
7
  import LightsNode from "../../../nodes/lighting/LightsNode.js";
10
- import { NodeFrame } from "../../../nodes/Nodes.js";
11
- import { Fog } from "../../../scenes/Fog.js";
12
- import { FogExp2 } from "../../../scenes/FogExp2.js";
13
8
  import { Scene } from "../../../scenes/Scene.js";
14
- import { CubeTexture } from "../../../textures/CubeTexture.js";
15
9
  import { Texture } from "../../../textures/Texture.js";
16
10
  import Backend from "../Backend.js";
17
11
  import ChainMap from "../ChainMap.js";
@@ -20,35 +14,15 @@ import Renderer from "../Renderer.js";
20
14
  import RenderObject from "../RenderObject.js";
21
15
  import NodeBuilderState from "./NodeBuilderState.js";
22
16
  import NodeUniformsGroup from "./NodeUniformsGroup.js";
23
- interface NodeUniformsGroupData {
24
- renderId?: number | undefined;
25
- frameId?: number | undefined;
26
- }
27
- interface RenderObjectData {
28
- nodeBuilderState?: NodeBuilderState | undefined;
29
- }
30
- interface ComputeNodeData {
31
- nodeBuilderState?: NodeBuilderState | undefined;
32
- }
33
- interface SceneData {
34
- background?: Color | Texture | CubeTexture | undefined;
35
- backgroundNode?: Node | undefined;
36
- fog?: Fog | FogExp2 | undefined;
37
- fogNode?: Node | undefined;
38
- environment?: Texture | undefined;
39
- environmentNode?: Node | undefined;
40
- }
41
- interface CacheKeyData {
42
- callId: number;
43
- cacheKey: number;
44
- }
17
+
45
18
  declare module "../../../scenes/Scene.js" {
46
19
  interface Scene {
47
- environmentNode?: Node | null | undefined;
20
+ environmentNode?: Node<"vec3"> | null | undefined;
48
21
  backgroundNode?: Node | null | undefined;
49
22
  fogNode?: Node | null | undefined;
50
23
  }
51
24
  }
25
+
52
26
  /**
53
27
  * This renderer module manages node-related objects and is the
54
28
  * primary interface between the renderer and the node system.
@@ -56,42 +30,59 @@ declare module "../../../scenes/Scene.js" {
56
30
  * @private
57
31
  * @augments DataMap
58
32
  */
59
- declare class Nodes extends DataMap<{
33
+ declare class NodeManager extends DataMap {
60
34
  /**
61
35
  * Constructs a new nodes management component.
62
36
  *
63
37
  * @param {Renderer} renderer - The renderer.
64
38
  * @param {Backend} backend - The renderer's backend.
65
39
  */
66
- nodeUniformsGroup: {
67
- key: NodeUniformsGroup;
68
- value: NodeUniformsGroupData;
69
- };
70
- renderObject: {
71
- key: RenderObject;
72
- value: RenderObjectData;
73
- };
74
- computeNode: {
75
- key: ComputeNode;
76
- value: ComputeNodeData;
77
- };
78
- scene: {
79
- key: Scene;
80
- value: SceneData;
81
- };
82
- }> {
40
+ constructor(renderer: Renderer, backend: Backend);
41
+ /**
42
+ * The renderer.
43
+ *
44
+ * @type {Renderer}
45
+ */
83
46
  renderer: Renderer;
47
+ /**
48
+ * The renderer's backend.
49
+ *
50
+ * @type {Backend}
51
+ */
84
52
  backend: Backend;
53
+ /**
54
+ * The node frame.
55
+ *
56
+ * @type {Renderer}
57
+ */
85
58
  nodeFrame: NodeFrame;
86
- nodeBuilderCache: Map<string, NodeBuilderState>;
87
- callHashCache: ChainMap<readonly [Scene, LightsNode], CacheKeyData>;
88
- groupsData: ChainMap<readonly [UniformGroupNode, NodeUniformsGroup], {
89
- version?: number;
90
- }>;
59
+ /**
60
+ * A cache for managing node builder states.
61
+ *
62
+ * @type {Map<number,NodeBuilderState>}
63
+ */
64
+ nodeBuilderCache: Map<number, NodeBuilderState>;
65
+ /**
66
+ * A cache for managing data cache key data.
67
+ *
68
+ * @type {ChainMap}
69
+ */
70
+ callHashCache: ChainMap;
71
+ /**
72
+ * A cache for managing node uniforms group data.
73
+ *
74
+ * @type {ChainMap}
75
+ */
76
+ groupsData: ChainMap;
77
+ /**
78
+ * A cache for managing node objects of
79
+ * scene properties like fog or environments.
80
+ *
81
+ * @type {Object<string,WeakMap>}
82
+ */
91
83
  cacheLib: {
92
- [type: string]: WeakMap<object, Node | undefined>;
84
+ [x: string]: WeakMap<object, Node | undefined>;
93
85
  };
94
- constructor(renderer: Renderer, backend: Backend);
95
86
  /**
96
87
  * Returns `true` if the given node uniforms group must be updated or not.
97
88
  *
@@ -119,9 +110,7 @@ declare class Nodes extends DataMap<{
119
110
  * @param {any} object - The object to delete.
120
111
  * @return {?Object} The deleted dictionary.
121
112
  */
122
- delete(
123
- object: NodeUniformsGroup | RenderObject | ComputeNode | Scene,
124
- ): RenderObjectData | NodeUniformsGroupData | ComputeNodeData | SceneData;
113
+ delete(object: unknown): unknown | null;
125
114
  /**
126
115
  * Returns a node builder state for the given compute node.
127
116
  *
@@ -136,7 +125,7 @@ declare class Nodes extends DataMap<{
136
125
  * @param {NodeBuilder} nodeBuilder - The node builder.
137
126
  * @return {NodeBuilderState} The node builder state.
138
127
  */
139
- _createNodeBuilderState(nodeBuilder: NodeBuilder): NodeBuilderState;
128
+ private _createNodeBuilderState;
140
129
  /**
141
130
  * Returns an environment node for the current configured
142
131
  * scene environment.
@@ -144,7 +133,7 @@ declare class Nodes extends DataMap<{
144
133
  * @param {Scene} scene - The scene.
145
134
  * @return {Node} A node representing the current scene environment.
146
135
  */
147
- getEnvironmentNode(scene: Scene): Node | null;
136
+ getEnvironmentNode(scene: Scene): Node;
148
137
  /**
149
138
  * Returns a background node for the current configured
150
139
  * scene background.
@@ -152,14 +141,14 @@ declare class Nodes extends DataMap<{
152
141
  * @param {Scene} scene - The scene.
153
142
  * @return {Node} A node representing the current scene background.
154
143
  */
155
- getBackgroundNode(scene: Scene): Node | null;
144
+ getBackgroundNode(scene: Scene): Node;
156
145
  /**
157
146
  * Returns a fog node for the current configured scene fog.
158
147
  *
159
148
  * @param {Scene} scene - The scene.
160
149
  * @return {Node} A node representing the current scene fog.
161
150
  */
162
- getFogNode(scene: Scene): Node | null;
151
+ getFogNode(scene: Scene): Node;
163
152
  /**
164
153
  * Returns a cache key for the given scene and lights node.
165
154
  * This key is used by `RenderObject` as a part of the dynamic
@@ -195,12 +184,7 @@ declare class Nodes extends DataMap<{
195
184
  * @param {boolean} [forceUpdate=false] - Whether an update should be enforced or not.
196
185
  * @return {Node} The node representation.
197
186
  */
198
- getCacheNode(
199
- type: string,
200
- object: object,
201
- callback: () => Node | undefined,
202
- forceUpdate?: boolean,
203
- ): Node | undefined;
187
+ getCacheNode(type: string, object: object, callback: () => Node | undefined, forceUpdate?: boolean): Node;
204
188
  /**
205
189
  * If a scene fog is configured, this method makes sure to
206
190
  * represent the fog with a corresponding node-based implementation.
@@ -280,9 +264,6 @@ declare class Nodes extends DataMap<{
280
264
  * @return {boolean} Whether the given render object requires a refresh or not.
281
265
  */
282
266
  needsRefresh(renderObject: RenderObject): boolean;
283
- /**
284
- * Frees the internal resources.
285
- */
286
- dispose(): void;
287
267
  }
288
- export default Nodes;
268
+
269
+ export default NodeManager;