@types/three 0.181.0 → 0.183.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 (351) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/Addons.d.ts +0 -3
  3. three/examples/jsm/controls/ArcballControls.d.ts +1 -1
  4. three/examples/jsm/controls/DragControls.d.ts +1 -1
  5. three/examples/jsm/controls/FirstPersonControls.d.ts +1 -1
  6. three/examples/jsm/controls/FlyControls.d.ts +1 -1
  7. three/examples/jsm/controls/OrbitControls.d.ts +40 -1
  8. three/examples/jsm/controls/PointerLockControls.d.ts +1 -1
  9. three/examples/jsm/controls/TrackballControls.d.ts +1 -1
  10. three/examples/jsm/controls/TransformControls.d.ts +1 -1
  11. three/examples/jsm/effects/AnaglyphEffect.d.ts +4 -0
  12. three/examples/jsm/environments/ColorEnvironment.d.ts +9 -0
  13. three/examples/jsm/gpgpu/BitonicSort.d.ts +5 -5
  14. three/examples/jsm/helpers/AnimationPathHelper.d.ts +38 -0
  15. three/examples/jsm/helpers/ViewHelper.d.ts +4 -1
  16. three/examples/jsm/inspector/tabs/Parameters.d.ts +3 -0
  17. three/examples/jsm/inspector/ui/Item.d.ts +5 -0
  18. three/examples/jsm/libs/meshopt_decoder.module.d.ts +1 -1
  19. three/examples/jsm/lights/LightProbeGenerator.d.ts +11 -5
  20. three/examples/jsm/loaders/ColladaLoader.d.ts +27 -4
  21. three/examples/jsm/loaders/UltraHDRLoader.d.ts +7 -0
  22. three/examples/jsm/loaders/VOXLoader.d.ts +22 -5
  23. three/examples/jsm/math/Octree.d.ts +36 -14
  24. three/examples/jsm/objects/SkyMesh.d.ts +16 -6
  25. three/examples/jsm/objects/Water2Mesh.d.ts +7 -7
  26. three/examples/jsm/objects/WaterMesh.d.ts +6 -6
  27. three/examples/jsm/physics/AmmoPhysics.d.ts +1 -1
  28. three/examples/jsm/postprocessing/EffectComposer.d.ts +9 -10
  29. three/examples/jsm/postprocessing/OutputPass.d.ts +10 -6
  30. three/examples/jsm/postprocessing/RenderPass.d.ts +15 -10
  31. three/examples/jsm/postprocessing/UnrealBloomPass.d.ts +4 -9
  32. three/examples/jsm/transpiler/AST.d.ts +17 -0
  33. three/examples/jsm/transpiler/TSLEncoder.d.ts +2 -0
  34. three/examples/jsm/tsl/display/AnaglyphPassNode.d.ts +30 -0
  35. three/examples/jsm/tsl/display/AnamorphicNode.d.ts +1 -1
  36. three/examples/jsm/tsl/display/BilateralBlurNode.d.ts +27 -0
  37. three/examples/jsm/tsl/display/BleachBypass.d.ts +1 -1
  38. three/examples/jsm/tsl/display/BloomNode.d.ts +5 -5
  39. three/examples/jsm/tsl/display/CRT.d.ts +22 -0
  40. three/examples/jsm/tsl/display/DenoiseNode.d.ts +5 -5
  41. three/examples/jsm/tsl/display/DotScreenNode.d.ts +4 -6
  42. three/examples/jsm/tsl/display/GTAONode.d.ts +8 -8
  43. three/examples/jsm/tsl/display/GaussianBlurNode.d.ts +4 -2
  44. three/examples/jsm/tsl/display/GodraysNode.d.ts +20 -0
  45. three/examples/jsm/tsl/display/LensflareNode.d.ts +6 -6
  46. three/examples/jsm/tsl/display/Lut3DNode.d.ts +5 -5
  47. three/examples/jsm/tsl/display/MotionBlur.d.ts +1 -1
  48. three/examples/jsm/tsl/display/OutlineNode.d.ts +6 -6
  49. three/examples/jsm/tsl/display/PixelationPassNode.d.ts +10 -10
  50. three/examples/jsm/tsl/display/RGBShiftNode.d.ts +2 -2
  51. three/examples/jsm/tsl/display/RetroPassNode.d.ts +17 -0
  52. three/examples/jsm/tsl/display/SSAAPassNode.d.ts +1 -1
  53. three/examples/jsm/tsl/display/SSGINode.d.ts +11 -11
  54. three/examples/jsm/tsl/display/SSRNode.d.ts +6 -6
  55. three/examples/jsm/tsl/display/SSSNode.d.ts +7 -5
  56. three/examples/jsm/tsl/display/Shape.d.ts +3 -0
  57. three/examples/jsm/tsl/display/TRAANode.d.ts +5 -0
  58. three/examples/jsm/tsl/display/TransitionNode.d.ts +3 -3
  59. three/examples/jsm/tsl/display/boxBlur.d.ts +1 -1
  60. three/examples/jsm/tsl/display/depthAwareBlend.d.ts +15 -0
  61. three/examples/jsm/tsl/display/hashBlur.d.ts +1 -1
  62. three/examples/jsm/tsl/display/radialBlur.d.ts +12 -0
  63. three/examples/jsm/tsl/math/Bayer.d.ts +2 -0
  64. three/examples/jsm/tsl/utils/Raymarching.d.ts +2 -2
  65. three/package.json +4 -4
  66. three/src/Three.Core.d.ts +1 -1
  67. three/src/Three.TSL.d.ts +20 -13
  68. three/src/Three.WebGPU.Nodes.d.ts +2 -0
  69. three/src/Three.WebGPU.d.ts +3 -0
  70. three/src/Three.d.ts +2 -2
  71. three/src/animation/AnimationClip.d.ts +1 -1
  72. three/src/animation/AnimationMixer.d.ts +42 -0
  73. three/src/animation/AnimationUtils.d.ts +3 -8
  74. three/src/animation/KeyframeTrack.d.ts +19 -5
  75. three/src/animation/PropertyMixer.d.ts +5 -4
  76. three/src/audio/Audio.d.ts +224 -157
  77. three/src/audio/AudioAnalyser.d.ts +32 -27
  78. three/src/audio/AudioContext.d.ts +12 -12
  79. three/src/audio/AudioListener.d.ts +44 -65
  80. three/src/audio/PositionalAudio.d.ts +69 -62
  81. three/src/cameras/ArrayCamera.d.ts +21 -24
  82. three/src/cameras/Camera.d.ts +14 -53
  83. three/src/cameras/CubeCamera.d.ts +32 -28
  84. three/src/cameras/OrthographicCamera.d.ts +70 -100
  85. three/src/cameras/PerspectiveCamera.d.ts +133 -146
  86. three/src/cameras/StereoCamera.d.ts +24 -30
  87. three/src/constants.d.ts +28 -2
  88. three/src/core/BufferGeometry.d.ts +3 -1
  89. three/src/core/Clock.d.ts +3 -0
  90. three/src/core/Object3D.d.ts +31 -7
  91. three/src/extras/Controls.d.ts +3 -3
  92. three/src/geometries/TorusGeometry.d.ts +22 -3
  93. three/src/helpers/ArrowHelper.d.ts +34 -50
  94. three/src/helpers/AxesHelper.d.ts +22 -36
  95. three/src/helpers/Box3Helper.d.ts +14 -25
  96. three/src/helpers/BoxHelper.d.ts +28 -39
  97. three/src/helpers/CameraHelper.d.ts +31 -52
  98. three/src/helpers/DirectionalLightHelper.d.ts +32 -53
  99. three/src/helpers/GridHelper.d.ts +15 -29
  100. three/src/helpers/HemisphereLightHelper.d.ts +26 -49
  101. three/src/helpers/PlaneHelper.d.ts +21 -33
  102. three/src/helpers/PointLightHelper.d.ts +25 -50
  103. three/src/helpers/PolarGridHelper.d.ts +19 -32
  104. three/src/helpers/SkeletonHelper.d.ts +26 -50
  105. three/src/helpers/SpotLightHelper.d.ts +28 -55
  106. three/src/lights/AmbientLight.d.ts +15 -23
  107. three/src/lights/DirectionalLight.d.ts +49 -83
  108. three/src/lights/DirectionalLightShadow.d.ts +6 -61
  109. three/src/lights/HemisphereLight.d.ts +27 -47
  110. three/src/lights/Light.d.ts +22 -56
  111. three/src/lights/LightProbe.d.ts +31 -32
  112. three/src/lights/LightShadow.d.ts +107 -91
  113. three/src/lights/PointLight.d.ts +47 -77
  114. three/src/lights/PointLightShadow.d.ts +7 -11
  115. three/src/lights/RectAreaLight.d.ts +39 -59
  116. three/src/lights/SpotLight.d.ts +78 -117
  117. three/src/lights/SpotLightShadow.d.ts +17 -59
  118. three/src/lights/webgpu/IESSpotLight.d.ts +13 -1
  119. three/src/lights/webgpu/ProjectorLight.d.ts +9 -10
  120. three/src/materials/Material.d.ts +1 -0
  121. three/src/materials/MeshLambertMaterial.d.ts +6 -0
  122. three/src/materials/MeshPhongMaterial.d.ts +6 -0
  123. three/src/materials/ShaderMaterial.d.ts +18 -3
  124. three/src/materials/nodes/Line2NodeMaterial.d.ts +0 -6
  125. three/src/materials/nodes/LineBasicNodeMaterial.d.ts +0 -4
  126. three/src/materials/nodes/MeshBasicNodeMaterial.d.ts +1 -2
  127. three/src/materials/nodes/MeshLambertNodeMaterial.d.ts +0 -2
  128. three/src/materials/nodes/MeshNormalNodeMaterial.d.ts +0 -2
  129. three/src/materials/nodes/MeshSSSNodeMaterial.d.ts +5 -8
  130. three/src/materials/nodes/MeshToonNodeMaterial.d.ts +0 -4
  131. three/src/materials/nodes/NodeMaterial.d.ts +15 -2
  132. three/src/materials/nodes/SpriteNodeMaterial.d.ts +0 -3
  133. three/src/materials/nodes/VolumeNodeMaterial.d.ts +0 -2
  134. three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +39 -93
  135. three/src/math/Color.d.ts +1 -0
  136. three/src/math/Vector3.d.ts +2 -2
  137. three/src/math/interpolants/BezierInterpolant.d.ts +7 -0
  138. three/src/nodes/Nodes.d.ts +55 -35
  139. three/src/nodes/TSL.d.ts +6 -6
  140. three/src/nodes/accessors/Arrays.d.ts +19 -10
  141. three/src/nodes/accessors/BufferAttributeNode.d.ts +108 -41
  142. three/src/nodes/accessors/BufferNode.d.ts +21 -7
  143. three/src/nodes/accessors/Camera.d.ts +10 -10
  144. three/src/nodes/accessors/CubeTextureNode.d.ts +1 -1
  145. three/src/nodes/accessors/InstanceNode.d.ts +13 -6
  146. three/src/nodes/accessors/Lights.d.ts +9 -6
  147. three/src/nodes/accessors/MaterialNode.d.ts +1 -3
  148. three/src/nodes/accessors/MaterialProperties.d.ts +4 -4
  149. three/src/nodes/accessors/MaterialReferenceNode.d.ts +1 -1
  150. three/src/nodes/accessors/ModelNode.d.ts +34 -17
  151. three/src/nodes/accessors/MorphNode.d.ts +1 -1
  152. three/src/nodes/accessors/Normal.d.ts +13 -15
  153. three/src/nodes/accessors/Object3DNode.d.ts +35 -16
  154. three/src/nodes/accessors/Position.d.ts +9 -7
  155. three/src/nodes/accessors/ReferenceNode.d.ts +16 -7
  156. three/src/nodes/accessors/ReflectVector.d.ts +4 -5
  157. three/src/nodes/accessors/RendererReferenceNode.d.ts +1 -1
  158. three/src/nodes/accessors/SceneProperties.d.ts +5 -0
  159. three/src/nodes/accessors/SkinningNode.d.ts +5 -3
  160. three/src/nodes/accessors/StorageBufferNode.d.ts +49 -22
  161. three/src/nodes/accessors/StorageTextureNode.d.ts +1 -1
  162. three/src/nodes/accessors/Tangent.d.ts +5 -7
  163. three/src/nodes/accessors/Texture3DNode.d.ts +13 -1
  164. three/src/nodes/accessors/TextureBicubic.d.ts +3 -2
  165. three/src/nodes/accessors/TextureNode.d.ts +19 -18
  166. three/src/nodes/accessors/UV.d.ts +1 -1
  167. three/src/nodes/accessors/UniformArrayNode.d.ts +10 -8
  168. three/src/nodes/accessors/UserDataNode.d.ts +1 -1
  169. three/src/nodes/accessors/VelocityNode.d.ts +3 -3
  170. three/src/nodes/accessors/VertexColorNode.d.ts +1 -1
  171. three/src/nodes/code/FunctionCallNode.d.ts +0 -1
  172. three/src/nodes/code/FunctionNode.d.ts +7 -3
  173. three/src/nodes/core/ArrayNode.d.ts +2 -3
  174. three/src/nodes/core/AttributeNode.d.ts +12 -6
  175. three/src/nodes/core/BypassNode.d.ts +2 -3
  176. three/src/nodes/core/ConstNode.d.ts +10 -3
  177. three/src/nodes/core/ContextNode.d.ts +32 -21
  178. three/src/nodes/core/IndexNode.d.ts +1 -1
  179. three/src/nodes/core/InputNode.d.ts +12 -4
  180. three/src/nodes/core/InspectorNode.d.ts +2 -3
  181. three/src/nodes/core/IsolateNode.d.ts +2 -7
  182. three/src/nodes/core/MRTNode.d.ts +7 -0
  183. three/src/nodes/core/Node.d.ts +258 -39
  184. three/src/nodes/core/NodeAttribute.d.ts +30 -5
  185. three/src/nodes/core/NodeBuilder.d.ts +5 -3
  186. three/src/nodes/core/NodeCache.d.ts +24 -48
  187. three/src/nodes/core/NodeError.d.ts +9 -0
  188. three/src/nodes/core/NodeParser.d.ts +2 -0
  189. three/src/nodes/core/NodeUniform.d.ts +33 -9
  190. three/src/nodes/core/NodeUtils.d.ts +1 -1
  191. three/src/nodes/core/NodeVar.d.ts +33 -5
  192. three/src/nodes/core/NodeVarying.d.ts +32 -4
  193. three/src/nodes/core/ParameterNode.d.ts +11 -4
  194. three/src/nodes/core/PropertyNode.d.ts +45 -33
  195. three/src/nodes/core/StackTrace.d.ts +9 -0
  196. three/src/nodes/core/StructType.d.ts +3 -1
  197. three/src/nodes/core/StructTypeNode.d.ts +19 -5
  198. three/src/nodes/core/TempNode.d.ts +9 -3
  199. three/src/nodes/core/UniformNode.d.ts +53 -15
  200. three/src/nodes/core/VarNode.d.ts +15 -14
  201. three/src/nodes/core/VaryingNode.d.ts +14 -19
  202. three/src/nodes/core/constants.d.ts +9 -4
  203. three/src/nodes/display/BlendModes.d.ts +7 -27
  204. three/src/nodes/display/ColorAdjustment.d.ts +8 -9
  205. three/src/nodes/display/ColorSpaceNode.d.ts +2 -8
  206. three/src/nodes/display/FrontFacingNode.d.ts +1 -1
  207. three/src/nodes/display/NormalMapNode.d.ts +3 -1
  208. three/src/nodes/display/PassNode.d.ts +16 -4
  209. three/src/nodes/display/RenderOutputNode.d.ts +3 -7
  210. three/src/nodes/display/ScreenNode.d.ts +25 -17
  211. three/src/nodes/display/ToneMappingNode.d.ts +3 -7
  212. three/src/nodes/display/ViewportDepthNode.d.ts +11 -7
  213. three/src/nodes/display/ViewportTextureNode.d.ts +2 -0
  214. three/src/nodes/fog/Fog.d.ts +5 -3
  215. three/src/nodes/functions/BSDF/DFGLUT.d.ts +12 -0
  216. three/src/nodes/functions/PhysicalLightingModel.d.ts +8 -1
  217. three/src/nodes/geometry/RangeNode.d.ts +51 -9
  218. three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +2 -0
  219. three/src/nodes/gpgpu/BarrierNode.d.ts +2 -0
  220. three/src/nodes/gpgpu/ComputeNode.d.ts +2 -7
  221. three/src/nodes/lighting/AnalyticLightNode.d.ts +3 -1
  222. three/src/nodes/lighting/HemisphereLightNode.d.ts +3 -2
  223. three/src/nodes/lighting/LightProbeNode.d.ts +1 -1
  224. three/src/nodes/lighting/LightUtils.d.ts +1 -1
  225. three/src/nodes/lighting/LightingContextNode.d.ts +1 -1
  226. three/src/nodes/lighting/PointShadowNode.d.ts +11 -15
  227. three/src/nodes/lighting/ShadowFilterNode.d.ts +2 -0
  228. three/src/nodes/lighting/SpotLightNode.d.ts +0 -6
  229. three/src/nodes/materialx/MaterialXNodes.d.ts +11 -11
  230. three/src/nodes/math/BitcountNode.d.ts +23 -0
  231. three/src/nodes/math/ConditionalNode.d.ts +43 -22
  232. three/src/nodes/math/Hash.d.ts +1 -1
  233. three/src/nodes/math/MathNode.d.ts +603 -267
  234. three/src/nodes/math/MathUtils.d.ts +9 -5
  235. three/src/nodes/math/OperatorNode.d.ts +490 -227
  236. three/src/nodes/math/PackFloatNode.d.ts +19 -0
  237. three/src/nodes/math/TriNoise3D.d.ts +3 -3
  238. three/src/nodes/math/UnpackFloatNode.d.ts +18 -0
  239. three/src/nodes/pmrem/PMREMNode.d.ts +1 -1
  240. three/src/nodes/procedural/Checker.d.ts +1 -1
  241. three/src/nodes/tsl/TSLCore.d.ts +1683 -224
  242. three/src/nodes/utils/ArrayElementNode.d.ts +9 -4
  243. three/src/nodes/utils/DebugNode.d.ts +2 -5
  244. three/src/nodes/utils/Discard.d.ts +2 -3
  245. three/src/nodes/utils/FlipNode.d.ts +11 -0
  246. three/src/nodes/utils/LoopNode.d.ts +17 -13
  247. three/src/nodes/utils/MaxMipLevelNode.d.ts +1 -1
  248. three/src/nodes/utils/Oscillators.d.ts +4 -4
  249. three/src/nodes/utils/Packing.d.ts +3 -2
  250. three/src/nodes/utils/PostProcessingUtils.d.ts +6 -4
  251. three/src/nodes/utils/RemapNode.d.ts +33 -39
  252. three/src/nodes/utils/RotateNode.d.ts +17 -8
  253. three/src/nodes/utils/SplitNode.d.ts +1 -2
  254. three/src/nodes/utils/SpriteSheetUV.d.ts +7 -0
  255. three/src/nodes/utils/StorageArrayElementNode.d.ts +18 -9
  256. three/src/nodes/utils/Timer.d.ts +4 -4
  257. three/src/nodes/utils/TriplanarTextures.d.ts +2 -2
  258. three/src/nodes/utils/UVUtils.d.ts +8 -3
  259. three/src/objects/BatchedMesh.d.ts +6 -4
  260. three/src/objects/InstancedMesh.d.ts +32 -24
  261. three/src/objects/LOD.d.ts +1 -1
  262. three/src/objects/Skeleton.d.ts +4 -2
  263. three/src/renderers/WebGLRenderer.d.ts +25 -96
  264. three/src/renderers/common/Animation.d.ts +46 -9
  265. three/src/renderers/common/Attributes.d.ts +11 -13
  266. three/src/renderers/common/Backend.d.ts +0 -2
  267. three/src/renderers/common/Background.d.ts +17 -15
  268. three/src/renderers/common/BindGroup.d.ts +27 -13
  269. three/src/renderers/common/Binding.d.ts +21 -3
  270. three/src/renderers/common/Bindings.d.ts +41 -17
  271. three/src/renderers/common/BlendMode.d.ts +22 -0
  272. three/src/renderers/common/Buffer.d.ts +53 -5
  273. three/src/renderers/common/BufferUtils.d.ts +3 -4
  274. three/src/renderers/common/BundleGroup.d.ts +16 -6
  275. three/src/renderers/common/CanvasTarget.d.ts +76 -13
  276. three/src/renderers/common/ChainMap.d.ts +18 -8
  277. three/src/renderers/common/ClippingContext.d.ts +61 -10
  278. three/src/renderers/common/Color4.d.ts +10 -5
  279. three/src/renderers/common/ComputePipeline.d.ts +16 -2
  280. three/src/renderers/common/Constants.d.ts +5 -3
  281. three/src/renderers/common/CubeRenderTarget.d.ts +24 -7
  282. three/src/renderers/common/DataMap.d.ts +10 -18
  283. three/src/renderers/common/Geometries.d.ts +45 -19
  284. three/src/renderers/common/Info.d.ts +62 -9
  285. three/src/renderers/common/InspectorBase.d.ts +19 -7
  286. three/src/renderers/common/Lighting.d.ts +2 -6
  287. three/src/renderers/common/Pipeline.d.ts +14 -2
  288. three/src/renderers/common/Pipelines.d.ts +58 -60
  289. three/src/renderers/common/PostProcessing.d.ts +14 -17
  290. three/src/renderers/common/ProgrammableStage.d.ts +48 -8
  291. three/src/renderers/common/RenderBundle.d.ts +4 -2
  292. three/src/renderers/common/RenderBundles.d.ts +6 -3
  293. three/src/renderers/common/RenderContext.d.ts +175 -7
  294. three/src/renderers/common/RenderContexts.d.ts +21 -24
  295. three/src/renderers/common/RenderList.d.ts +77 -11
  296. three/src/renderers/common/RenderLists.d.ts +16 -4
  297. three/src/renderers/common/RenderObject.d.ts +229 -47
  298. three/src/renderers/common/{RenderPipeline.d.ts → RenderObjectPipeline.d.ts} +17 -5
  299. three/src/renderers/common/RenderObjects.d.ts +55 -22
  300. three/src/renderers/common/Renderer.d.ts +645 -216
  301. three/src/renderers/common/Textures.d.ts +24 -46
  302. three/src/renderers/common/TimestampQueryPool.d.ts +62 -8
  303. three/src/renderers/common/Uniform.d.ts +143 -58
  304. three/src/renderers/common/UniformBuffer.d.ts +7 -5
  305. three/src/renderers/common/UniformsGroup.d.ts +51 -35
  306. three/src/renderers/common/XRManager.d.ts +321 -83
  307. three/src/renderers/common/XRRenderTarget.d.ts +49 -6
  308. three/src/renderers/common/nodes/NodeBuilderState.d.ts +75 -15
  309. three/src/renderers/common/nodes/NodeLibrary.d.ts +25 -5
  310. three/src/renderers/common/nodes/{Nodes.d.ts → NodeManager.d.ts} +54 -73
  311. three/src/renderers/common/nodes/NodeUniform.d.ts +60 -70
  312. three/src/renderers/common/nodes/NodeUniformsGroup.d.ts +23 -4
  313. three/src/renderers/shaders/ShaderLib.d.ts +1 -1
  314. three/src/renderers/shaders/UniformsLib.d.ts +0 -3
  315. three/src/renderers/webgl/WebGLAttributes.d.ts +9 -7
  316. three/src/renderers/webgl/WebGLCapabilities.d.ts +2 -2
  317. three/src/renderers/webgl/WebGLEnvironments.d.ts +8 -0
  318. three/src/renderers/webgl/WebGLExtensions.d.ts +1 -1
  319. three/src/renderers/webgl/WebGLIndexedBufferRenderer.d.ts +9 -5
  320. three/src/renderers/webgl/WebGLLights.d.ts +19 -18
  321. three/src/renderers/webgl/WebGLObjects.d.ts +15 -2
  322. three/src/renderers/webgl/WebGLProgram.d.ts +2 -10
  323. three/src/renderers/webgl/WebGLPrograms.d.ts +2 -3
  324. three/src/renderers/webgl/WebGLRenderLists.d.ts +1 -3
  325. three/src/renderers/webgl/WebGLShadowMap.d.ts +0 -5
  326. three/src/renderers/webgl/WebGLState.d.ts +305 -28
  327. three/src/renderers/webgl/WebGLTextures.d.ts +10 -9
  328. three/src/renderers/webgl/WebGLUniforms.d.ts +0 -7
  329. three/src/renderers/webgpu/WebGPUBackend.d.ts +0 -1
  330. three/src/renderers/webgpu/nodes/BasicNodeLibrary.d.ts +2 -4
  331. three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +15 -4
  332. three/src/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts +1 -1
  333. three/src/scenes/Fog.d.ts +31 -37
  334. three/src/scenes/FogExp2.d.ts +26 -31
  335. three/src/scenes/Scene.d.ts +51 -65
  336. three/src/textures/CompressedArrayTexture.d.ts +1 -1
  337. three/src/textures/CubeDepthTexture.d.ts +41 -0
  338. three/src/textures/CubeTexture.d.ts +4 -4
  339. three/src/textures/DataArrayTexture.d.ts +1 -1
  340. three/src/utils.d.ts +18 -1
  341. three/examples/jsm/materials/MeshGouraudMaterial.d.ts +0 -18
  342. three/examples/jsm/materials/MeshPostProcessingMaterial.d.ts +0 -13
  343. three/examples/jsm/shaders/GodRaysShader.d.ts +0 -44
  344. three/src/nodes/accessors/SceneNode.d.ts +0 -21
  345. three/src/nodes/code/ScriptableNode.d.ts +0 -21
  346. three/src/nodes/code/ScriptableValueNode.d.ts +0 -9
  347. three/src/nodes/display/PosterizeNode.d.ts +0 -13
  348. three/src/nodes/functions/BSDF/DFGApprox.d.ts +0 -10
  349. three/src/nodes/utils/SpriteSheetUVNode.d.ts +0 -15
  350. three/src/renderers/webgl/WebGLCubeMaps.d.ts +0 -8
  351. three/src/renderers/webgl/WebGLCubeUVMaps.d.ts +0 -9
@@ -1,6 +1,6 @@
1
1
  import { Camera } from "../../cameras/Camera.js";
2
- import { ShadowMapType, TextureDataType, TimestampQuery, ToneMapping } from "../../constants.js";
3
- import { BufferAttribute } from "../../core/BufferAttribute.js";
2
+ import { CoordinateSystem, ShadowMapType, TextureDataType, TimestampQuery, ToneMapping } from "../../constants.js";
3
+ import { BufferAttribute, TypedArray } from "../../core/BufferAttribute.js";
4
4
  import { BufferGeometry, GeometryGroup } from "../../core/BufferGeometry.js";
5
5
  import { Object3D } from "../../core/Object3D.js";
6
6
  import { RenderTarget } from "../../core/RenderTarget.js";
@@ -11,164 +11,630 @@ import { ColorRepresentation } from "../../math/Color.js";
11
11
  import { Vector2 } from "../../math/Vector2.js";
12
12
  import { Vector3 } from "../../math/Vector3.js";
13
13
  import { Vector4 } from "../../math/Vector4.js";
14
+ import ContextNode from "../../nodes/core/ContextNode.js";
14
15
  import MRTNode from "../../nodes/core/MRTNode.js";
15
16
  import ComputeNode from "../../nodes/gpgpu/ComputeNode.js";
16
17
  import LightsNode from "../../nodes/lighting/LightsNode.js";
17
- import { Group } from "../../objects/Group.js";
18
18
  import { Scene } from "../../scenes/Scene.js";
19
19
  import { FramebufferTexture } from "../../textures/FramebufferTexture.js";
20
20
  import { Texture } from "../../textures/Texture.js";
21
- import Animation from "./Animation.js";
22
- import Attributes from "./Attributes.js";
23
21
  import Backend from "./Backend.js";
24
- import Background from "./Background.js";
25
- import Bindings from "./Bindings.js";
26
22
  import CanvasTarget from "./CanvasTarget.js";
27
23
  import ClippingContext from "./ClippingContext.js";
28
24
  import Color4 from "./Color4.js";
29
- import Geometries from "./Geometries.js";
30
25
  import IndirectStorageBufferAttribute from "./IndirectStorageBufferAttribute.js";
31
26
  import Info from "./Info.js";
32
27
  import InspectorBase from "./InspectorBase.js";
33
28
  import Lighting from "./Lighting.js";
34
29
  import NodeLibrary from "./nodes/NodeLibrary.js";
35
- import Nodes from "./nodes/Nodes.js";
36
- import Pipelines from "./Pipelines.js";
37
- import QuadMesh from "./QuadMesh.js";
38
- import RenderBundle from "./RenderBundle.js";
39
- import RenderBundles from "./RenderBundles.js";
40
- import RenderContext from "./RenderContext.js";
41
- import RenderContexts from "./RenderContexts.js";
42
- import RenderList, { Bundle, RenderItem } from "./RenderList.js";
43
- import RenderLists from "./RenderLists.js";
44
- import RenderObjects from "./RenderObjects.js";
45
- import Textures from "./Textures.js";
30
+ import { RenderItem } from "./RenderList.js";
31
+ import StorageBufferAttribute from "./StorageBufferAttribute.js";
46
32
  import XRManager from "./XRManager.js";
47
- interface Rectangle {
48
- x: number;
49
- y: number;
50
- z: number;
51
- w: number;
52
- }
33
+
53
34
  interface DeviceLostInfo {
54
35
  api: "WebGL" | "WebGPU";
55
36
  message: string;
56
37
  reason: string | null;
57
38
  originalEvent: unknown;
58
39
  }
40
+
59
41
  export interface RendererParameters {
60
42
  logarithmicDepthBuffer?: boolean | undefined;
43
+ reversedDepthBuffer?: boolean | undefined;
61
44
  alpha?: boolean | undefined;
62
45
  depth?: boolean | undefined;
63
46
  stencil?: boolean | undefined;
64
47
  antialias?: boolean | undefined;
65
48
  samples?: number | undefined;
66
49
  getFallback?: ((error: unknown) => Backend) | null | undefined;
67
- colorBufferType?: TextureDataType | undefined;
50
+ outputBufferType?: TextureDataType | undefined;
68
51
  multiview?: boolean | undefined;
69
52
  }
53
+
70
54
  /**
71
55
  * Base class for renderers.
72
56
  */
73
57
  declare class Renderer {
74
- readonly isRenderer: true;
58
+ /**
59
+ * Renderer options.
60
+ *
61
+ * @typedef {Object} Renderer~Options
62
+ * @property {boolean} [logarithmicDepthBuffer=false] - Whether logarithmic depth buffer is enabled or not.
63
+ * @property {boolean} [reversedDepthBuffer=false] - Whether reversed depth buffer is enabled or not.
64
+ * @property {boolean} [alpha=true] - Whether the default framebuffer (which represents the final contents of the canvas) should be transparent or opaque.
65
+ * @property {boolean} [depth=true] - Whether the default framebuffer should have a depth buffer or not.
66
+ * @property {boolean} [stencil=false] - Whether the default framebuffer should have a stencil buffer or not.
67
+ * @property {boolean} [antialias=false] - Whether MSAA as the default anti-aliasing should be enabled or not.
68
+ * @property {number} [samples=0] - When `antialias` is `true`, `4` samples are used by default. This parameter can set to any other integer value than 0
69
+ * to overwrite the default.
70
+ * @property {?Function} [getFallback=null] - This callback function can be used to provide a fallback backend, if the primary backend can't be targeted.
71
+ * @property {number} [outputBufferType=HalfFloatType] - Defines the type of output buffers. The default `HalfFloatType` is recommend for best
72
+ * quality. To save memory and bandwidth, `UnsignedByteType` might be used. This will reduce rendering quality though.
73
+ * @property {boolean} [multiview=false] - If set to `true`, the renderer will use multiview during WebXR rendering if supported.
74
+ */
75
+ /**
76
+ * Constructs a new renderer.
77
+ *
78
+ * @param {Backend} backend - The backend the renderer is targeting (e.g. WebGPU or WebGL 2).
79
+ * @param {Renderer~Options} [parameters] - The configuration parameter.
80
+ */
81
+ constructor(backend: Backend, parameters?: RendererParameters);
82
+ /**
83
+ * This flag can be used for type testing.
84
+ *
85
+ * @type {boolean}
86
+ * @readonly
87
+ * @default true
88
+ */
89
+ readonly isRenderer: boolean;
90
+ /**
91
+ * A reference to the current backend.
92
+ *
93
+ * @type {Backend}
94
+ */
75
95
  backend: Backend;
96
+ /**
97
+ * Whether the renderer should automatically clear the current rendering target
98
+ * before execute a `render()` call. The target can be the canvas (default framebuffer)
99
+ * or the current bound render target (custom framebuffer).
100
+ *
101
+ * @type {boolean}
102
+ * @default true
103
+ */
76
104
  autoClear: boolean;
105
+ /**
106
+ * When `autoClear` is set to `true`, this property defines whether the renderer
107
+ * should clear the color buffer.
108
+ *
109
+ * @type {boolean}
110
+ * @default true
111
+ */
77
112
  autoClearColor: boolean;
113
+ /**
114
+ * When `autoClear` is set to `true`, this property defines whether the renderer
115
+ * should clear the depth buffer.
116
+ *
117
+ * @type {boolean}
118
+ * @default true
119
+ */
78
120
  autoClearDepth: boolean;
121
+ /**
122
+ * When `autoClear` is set to `true`, this property defines whether the renderer
123
+ * should clear the stencil buffer.
124
+ *
125
+ * @type {boolean}
126
+ * @default true
127
+ */
79
128
  autoClearStencil: boolean;
129
+ /**
130
+ * Whether the default framebuffer should be transparent or opaque.
131
+ *
132
+ * @type {boolean}
133
+ * @default true
134
+ */
80
135
  alpha: boolean;
81
- logarithmicDepthBuffer: boolean;
136
+ /**
137
+ * Whether logarithmic depth buffer is enabled or not.
138
+ *
139
+ * @type {boolean}
140
+ * @default false
141
+ * @readonly
142
+ */
143
+ readonly logarithmicDepthBuffer: boolean;
144
+ /**
145
+ * Whether reversed depth buffer is enabled or not.
146
+ *
147
+ * @type {boolean}
148
+ * @default false
149
+ * @readonly
150
+ */
151
+ readonly reversedDepthBuffer: boolean;
152
+ /**
153
+ * Defines the output color space of the renderer.
154
+ *
155
+ * @type {string}
156
+ * @default SRGBColorSpace
157
+ */
82
158
  outputColorSpace: string;
159
+ /**
160
+ * Defines the tone mapping of the renderer.
161
+ *
162
+ * @type {number}
163
+ * @default NoToneMapping
164
+ */
83
165
  toneMapping: ToneMapping;
166
+ /**
167
+ * Defines the tone mapping exposure.
168
+ *
169
+ * @type {number}
170
+ * @default 1
171
+ */
84
172
  toneMappingExposure: number;
173
+ /**
174
+ * Whether the renderer should sort its render lists or not.
175
+ *
176
+ * Note: Sorting is used to attempt to properly render objects that have some degree of transparency.
177
+ * By definition, sorting objects may not work in all cases. Depending on the needs of application,
178
+ * it may be necessary to turn off sorting and use other methods to deal with transparency rendering
179
+ * e.g. manually determining each object's rendering order.
180
+ *
181
+ * @type {boolean}
182
+ * @default true
183
+ */
85
184
  sortObjects: boolean;
185
+ /**
186
+ * Whether the default framebuffer should have a depth buffer or not.
187
+ *
188
+ * @type {boolean}
189
+ * @default true
190
+ */
86
191
  depth: boolean;
192
+ /**
193
+ * Whether the default framebuffer should have a stencil buffer or not.
194
+ *
195
+ * @type {boolean}
196
+ * @default false
197
+ */
87
198
  stencil: boolean;
199
+ /**
200
+ * Holds a series of statistical information about the GPU memory
201
+ * and the rendering process. Useful for debugging and monitoring.
202
+ *
203
+ * @type {Info}
204
+ */
88
205
  info: Info;
206
+ /**
207
+ * A global context node that stores override nodes for specific transformations or calculations.
208
+ * These nodes can be used to replace default behavior in the rendering pipeline.
209
+ *
210
+ * @type {ContextNode}
211
+ * @property {Object} value - The context value object.
212
+ */
213
+ contextNode: ContextNode<unknown>;
214
+ /**
215
+ * The node library defines how certain library objects like materials, lights
216
+ * or tone mapping functions are mapped to node types. This is required since
217
+ * although instances of classes like `MeshBasicMaterial` or `PointLight` can
218
+ * be part of the scene graph, they are internally represented as nodes for
219
+ * further processing.
220
+ *
221
+ * @type {NodeLibrary}
222
+ */
89
223
  library: NodeLibrary;
224
+ /**
225
+ * A map-like data structure for managing lights.
226
+ *
227
+ * @type {Lighting}
228
+ */
90
229
  lighting: Lighting;
91
- _samples: number;
92
- _canvasTarget: CanvasTarget;
93
- _inspector: InspectorBase;
94
- _getFallback: ((error: unknown) => Backend) | null;
95
- _attributes: Attributes | null;
96
- _geometries: Geometries | null;
97
- _nodes: Nodes | null;
98
- _animation: Animation | null;
99
- _bindings: Bindings | null;
100
- _objects: RenderObjects | null;
101
- _pipelines: Pipelines | null;
102
- _bundles: RenderBundles | null;
103
- _renderLists: RenderLists | null;
104
- _renderContexts: RenderContexts | null;
105
- _textures: Textures | null;
106
- _background: Background | null;
107
- _quad: QuadMesh;
108
- _currentRenderContext: RenderContext | null;
109
- _opaqueSort: ((a: RenderItem, b: RenderItem) => number) | null;
110
- _transparentSort: ((a: RenderItem, b: RenderItem) => number) | null;
111
- _frameBufferTarget: RenderTarget | null;
112
- _clearColor: Color4;
113
- _clearDepth: number;
114
- _clearStencil: number;
115
- _renderTarget: RenderTarget | null;
116
- _activeCubeFace: number;
117
- _activeMipmapLevel: number;
118
- _outputRenderTarget: RenderTarget | null;
119
- _mrt: MRTNode | null;
120
- _renderObjectFunction:
121
- | ((
122
- object: Object3D,
123
- scene: Scene,
124
- camera: Camera,
125
- geometry: BufferGeometry,
126
- material: Material,
127
- group: GeometryGroup,
128
- lightsNode: LightsNode,
129
- clippingContext: ClippingContext | null,
130
- passId: string | null,
131
- ) => void)
132
- | null;
133
- _currentRenderObjectFunction:
134
- | ((
135
- object: Object3D,
136
- scene: Scene,
137
- camera: Camera,
138
- geometry: BufferGeometry,
139
- material: Material,
140
- group: GeometryGroup,
141
- lightsNode: LightsNode,
142
- clippingContext: ClippingContext | null,
143
- passId: string | null,
144
- ) => void)
145
- | null;
146
- _currentRenderBundle: RenderBundle | null;
147
- _handleObjectFunction: (
148
- object: Object3D,
149
- material: Material,
150
- scene: Scene,
151
- camera: Camera,
152
- lightsNode: LightsNode,
153
- group: GeometryGroup,
154
- clippingContext: ClippingContext | null,
155
- passId?: string,
156
- ) => void;
157
- _isDeviceLost: boolean;
230
+ /**
231
+ * The number of MSAA samples.
232
+ *
233
+ * @private
234
+ * @type {number}
235
+ * @default 0
236
+ */
237
+ private _samples;
238
+ /**
239
+ * Callback when the canvas has been resized.
240
+ *
241
+ * @private
242
+ */
243
+ private _onCanvasTargetResize;
244
+ /**
245
+ * The canvas target for rendering.
246
+ *
247
+ * @private
248
+ * @type {CanvasTarget}
249
+ */
250
+ private _canvasTarget;
251
+ /**
252
+ * The inspector provides information about the internal renderer state.
253
+ *
254
+ * @private
255
+ * @type {InspectorBase}
256
+ */
257
+ private _inspector;
258
+ /**
259
+ * This callback function can be used to provide a fallback backend, if the primary backend can't be targeted.
260
+ *
261
+ * @private
262
+ * @type {?Function}
263
+ */
264
+ private _getFallback;
265
+ /**
266
+ * A reference to a renderer module for managing shader attributes.
267
+ *
268
+ * @private
269
+ * @type {?Attributes}
270
+ * @default null
271
+ */
272
+ private _attributes;
273
+ /**
274
+ * A reference to a renderer module for managing geometries.
275
+ *
276
+ * @private
277
+ * @type {?Geometries}
278
+ * @default null
279
+ */
280
+ private _geometries;
281
+ /**
282
+ * A reference to a renderer module for managing node related logic.
283
+ *
284
+ * @private
285
+ * @type {?NodeManager}
286
+ * @default null
287
+ */
288
+ private _nodes;
289
+ /**
290
+ * A reference to a renderer module for managing the internal animation loop.
291
+ *
292
+ * @private
293
+ * @type {?Animation}
294
+ * @default null
295
+ */
296
+ private _animation;
297
+ /**
298
+ * A reference to a renderer module for managing shader program bindings.
299
+ *
300
+ * @private
301
+ * @type {?Bindings}
302
+ * @default null
303
+ */
304
+ private _bindings;
305
+ /**
306
+ * A reference to a renderer module for managing render objects.
307
+ *
308
+ * @private
309
+ * @type {?RenderObjects}
310
+ * @default null
311
+ */
312
+ private _objects;
313
+ /**
314
+ * A reference to a renderer module for managing render and compute pipelines.
315
+ *
316
+ * @private
317
+ * @type {?Pipelines}
318
+ * @default null
319
+ */
320
+ private _pipelines;
321
+ /**
322
+ * A reference to a renderer module for managing render bundles.
323
+ *
324
+ * @private
325
+ * @type {?RenderBundles}
326
+ * @default null
327
+ */
328
+ private _bundles;
329
+ /**
330
+ * A reference to a renderer module for managing render lists.
331
+ *
332
+ * @private
333
+ * @type {?RenderLists}
334
+ * @default null
335
+ */
336
+ private _renderLists;
337
+ /**
338
+ * A reference to a renderer module for managing render contexts.
339
+ *
340
+ * @private
341
+ * @type {?RenderContexts}
342
+ * @default null
343
+ */
344
+ private _renderContexts;
345
+ /**
346
+ * A reference to a renderer module for managing textures.
347
+ *
348
+ * @private
349
+ * @type {?Textures}
350
+ * @default null
351
+ */
352
+ private _textures;
353
+ /**
354
+ * A reference to a renderer module for backgrounds.
355
+ *
356
+ * @private
357
+ * @type {?Background}
358
+ * @default null
359
+ */
360
+ private _background;
361
+ /**
362
+ * This fullscreen quad is used for internal render passes
363
+ * like the tone mapping and color space output pass.
364
+ *
365
+ * @private
366
+ * @type {QuadMesh}
367
+ */
368
+ private _quad;
369
+ /**
370
+ * A reference to the current render context.
371
+ *
372
+ * @private
373
+ * @type {?RenderContext}
374
+ * @default null
375
+ */
376
+ private _currentRenderContext;
377
+ /**
378
+ * A custom sort function for the opaque render list.
379
+ *
380
+ * @private
381
+ * @type {?Function}
382
+ * @default null
383
+ */
384
+ private _opaqueSort;
385
+ /**
386
+ * A custom sort function for the transparent render list.
387
+ *
388
+ * @private
389
+ * @type {?Function}
390
+ * @default null
391
+ */
392
+ private _transparentSort;
393
+ /**
394
+ * The framebuffer target.
395
+ *
396
+ * @private
397
+ * @type {?RenderTarget}
398
+ * @default null
399
+ */
400
+ private _frameBufferTarget;
401
+ /**
402
+ * The clear color value.
403
+ *
404
+ * @private
405
+ * @type {Color4}
406
+ */
407
+ private _clearColor;
408
+ /**
409
+ * The clear depth value.
410
+ *
411
+ * @private
412
+ * @type {number}
413
+ * @default 1
414
+ */
415
+ private _clearDepth;
416
+ /**
417
+ * The clear stencil value.
418
+ *
419
+ * @private
420
+ * @type {number}
421
+ * @default 0
422
+ */
423
+ private _clearStencil;
424
+ /**
425
+ * The current render target.
426
+ *
427
+ * @private
428
+ * @type {?RenderTarget}
429
+ * @default null
430
+ */
431
+ private _renderTarget;
432
+ /**
433
+ * The active cube face.
434
+ *
435
+ * @private
436
+ * @type {number}
437
+ * @default 0
438
+ */
439
+ private _activeCubeFace;
440
+ /**
441
+ * The active mipmap level.
442
+ *
443
+ * @private
444
+ * @type {number}
445
+ * @default 0
446
+ */
447
+ private _activeMipmapLevel;
448
+ /**
449
+ * The current output render target.
450
+ *
451
+ * @private
452
+ * @type {?RenderTarget}
453
+ * @default null
454
+ */
455
+ private _outputRenderTarget;
456
+ /**
457
+ * The MRT setting.
458
+ *
459
+ * @private
460
+ * @type {?MRTNode}
461
+ * @default null
462
+ */
463
+ private _mrt;
464
+ /**
465
+ * This function defines how a render object is going
466
+ * to be rendered.
467
+ *
468
+ * @private
469
+ * @type {?Function}
470
+ * @default null
471
+ */
472
+ private _renderObjectFunction;
473
+ /**
474
+ * Used to keep track of the current render object function.
475
+ *
476
+ * @private
477
+ * @type {?Function}
478
+ * @default null
479
+ */
480
+ private _currentRenderObjectFunction;
481
+ /**
482
+ * Used to keep track of the current render bundle.
483
+ *
484
+ * @private
485
+ * @type {?RenderBundle}
486
+ * @default null
487
+ */
488
+ private _currentRenderBundle;
489
+ /**
490
+ * Next to `_renderObjectFunction()`, this function provides another hook
491
+ * for influencing the render process of a render object. It is meant for internal
492
+ * use and only relevant for `compileAsync()` right now. Instead of using
493
+ * the default logic of `_renderObjectDirect()` which actually draws the render object,
494
+ * a different function might be used which performs no draw but just the node
495
+ * and pipeline updates.
496
+ *
497
+ * @private
498
+ * @type {Function}
499
+ */
500
+ private _handleObjectFunction;
501
+ /**
502
+ * Indicates whether the device has been lost or not. In WebGL terms, the device
503
+ * lost is considered as a context lost. When this is set to `true`, rendering
504
+ * isn't possible anymore.
505
+ *
506
+ * @private
507
+ * @type {boolean}
508
+ * @default false
509
+ */
510
+ private _isDeviceLost;
511
+ /**
512
+ * A callback function that defines what should happen when a device/context lost occurs.
513
+ *
514
+ * @type {Function}
515
+ */
158
516
  onDeviceLost: (info: DeviceLostInfo) => void;
159
- _colorBufferType: TextureDataType;
160
- _initialized: boolean;
161
- _initPromise: Promise<this> | null;
162
- _compilationPromises: Promise<void>[] | null;
517
+ /**
518
+ * Defines the type of output buffers. The default `HalfFloatType` is recommend for
519
+ * best quality. To save memory and bandwidth, `UnsignedByteType` might be used.
520
+ * This will reduce rendering quality though.
521
+ *
522
+ * @private
523
+ * @type {number}
524
+ * @default HalfFloatType
525
+ */
526
+ private _outputBufferType;
527
+ /**
528
+ * A cache for shadow nodes per material
529
+ *
530
+ * @private
531
+ * @type {WeakMap<Material, Object>}
532
+ */
533
+ private _cacheShadowNodes;
534
+ /**
535
+ * Whether the renderer has been initialized or not.
536
+ *
537
+ * @private
538
+ * @type {boolean}
539
+ * @default false
540
+ */
541
+ private _initialized;
542
+ /**
543
+ * The call depth of the renderer. Counts the number of
544
+ * nested render calls.
545
+ *
546
+ * @private
547
+ * @type {number}
548
+ * @default - 1
549
+ */
550
+ private _callDepth;
551
+ /**
552
+ * A reference to the promise which initializes the renderer.
553
+ *
554
+ * @private
555
+ * @type {?Promise<this>}
556
+ * @default null
557
+ */
558
+ private _initPromise;
559
+ /**
560
+ * An array of compilation promises which are used in `compileAsync()`.
561
+ *
562
+ * @private
563
+ * @type {?Array<Promise>}
564
+ * @default null
565
+ */
566
+ private _compilationPromises;
567
+ /**
568
+ * Whether the renderer should render transparent render objects or not.
569
+ *
570
+ * @type {boolean}
571
+ * @default true
572
+ */
163
573
  transparent: boolean;
574
+ /**
575
+ * Whether the renderer should render opaque render objects or not.
576
+ *
577
+ * @type {boolean}
578
+ * @default true
579
+ */
164
580
  opaque: boolean;
581
+ /**
582
+ * Shadow map configuration
583
+ * @typedef {Object} ShadowMapConfig
584
+ * @property {boolean} enabled - Whether to globally enable shadows or not.
585
+ * @property {boolean} transmitted - Whether to enable light transmission through non-opaque materials.
586
+ * @property {number} type - The shadow map type.
587
+ */
588
+ /**
589
+ * The renderer's shadow configuration.
590
+ *
591
+ * @type {ShadowMapConfig}
592
+ */
165
593
  shadowMap: {
594
+ /**
595
+ * - Whether to globally enable shadows or not.
596
+ */
166
597
  enabled: boolean;
167
- type: ShadowMapType | null;
598
+ /**
599
+ * - Whether to enable light transmission through non-opaque materials.
600
+ */
601
+ transmitted: boolean;
602
+ /**
603
+ * - The shadow map type.
604
+ */
605
+ type: ShadowMapType;
168
606
  };
607
+ /**
608
+ * XR configuration.
609
+ * @typedef {Object} XRConfig
610
+ * @property {boolean} enabled - Whether to globally enable XR or not.
611
+ */
612
+ /**
613
+ * The renderer's XR manager.
614
+ *
615
+ * @type {XRManager}
616
+ */
169
617
  xr: XRManager;
618
+ /**
619
+ * Debug configuration.
620
+ * @typedef {Object} DebugConfig
621
+ * @property {boolean} checkShaderErrors - Whether shader errors should be checked or not.
622
+ * @property {?Function} onShaderError - A callback function that is executed when a shader error happens. Only supported with WebGL 2 right now.
623
+ * @property {Function} getShaderAsync - Allows the get the raw shader code for the given scene, camera and 3D object.
624
+ */
625
+ /**
626
+ * The renderer's debug configuration.
627
+ *
628
+ * @type {DebugConfig}
629
+ */
170
630
  debug: {
631
+ /**
632
+ * - Whether shader errors should be checked or not.
633
+ */
171
634
  checkShaderErrors: boolean;
635
+ /**
636
+ * - A callback function that is executed when a shader error happens. Only supported with WebGL 2 right now.
637
+ */
172
638
  onShaderError:
173
639
  | ((
174
640
  gl: WebGL2RenderingContext,
@@ -177,35 +643,14 @@ declare class Renderer {
177
643
  glFragmentShader: WebGLShader,
178
644
  ) => void)
179
645
  | null;
646
+ /**
647
+ * - Allows the get the raw shader code for the given scene, camera and 3D object.
648
+ */
180
649
  getShaderAsync: (scene: Scene, camera: Camera, object: Object3D) => Promise<{
181
650
  fragmentShader: string | null;
182
651
  vertexShader: string | null;
183
652
  }>;
184
653
  };
185
- localClippingEnabled?: boolean | undefined;
186
- /**
187
- * Renderer options.
188
- *
189
- * @typedef {Object} Renderer~Options
190
- * @property {boolean} [logarithmicDepthBuffer=false] - Whether logarithmic depth buffer is enabled or not.
191
- * @property {boolean} [alpha=true] - Whether the default framebuffer (which represents the final contents of the canvas) should be transparent or opaque.
192
- * @property {boolean} [depth=true] - Whether the default framebuffer should have a depth buffer or not.
193
- * @property {boolean} [stencil=false] - Whether the default framebuffer should have a stencil buffer or not.
194
- * @property {boolean} [antialias=false] - Whether MSAA as the default anti-aliasing should be enabled or not.
195
- * @property {number} [samples=0] - When `antialias` is `true`, `4` samples are used by default. This parameter can set to any other integer value than 0
196
- * to overwrite the default.
197
- * @property {?Function} [getFallback=null] - This callback function can be used to provide a fallback backend, if the primary backend can't be targeted.
198
- * @property {number} [colorBufferType=HalfFloatType] - Defines the type of color buffers. The default `HalfFloatType` is recommend for best
199
- * quality. To save memory and bandwidth, `UnsignedByteType` might be used. This will reduce rendering quality though.
200
- * @property {boolean} [multiview=false] - If set to `true`, the renderer will use multiview during WebXR rendering if supported.
201
- */
202
- /**
203
- * Constructs a new renderer.
204
- *
205
- * @param {Backend} backend - The backend the renderer is targeting (e.g. WebGPU or WebGL 2).
206
- * @param {Renderer~Options} [parameters] - The configuration parameter.
207
- */
208
- constructor(backend: Backend, parameters?: RendererParameters);
209
654
  /**
210
655
  * Initializes the renderer so it is ready for usage.
211
656
  *
@@ -229,7 +674,7 @@ declare class Renderer {
229
674
  * @readonly
230
675
  * @type {number}
231
676
  */
232
- get coordinateSystem(): import("../../constants.js").CoordinateSystem;
677
+ get coordinateSystem(): CoordinateSystem;
233
678
  /**
234
679
  * Compiles all materials in the given scene. This can be useful to avoid a
235
680
  * phenomenon which is called "shader compilation stutter", which occurs when
@@ -243,7 +688,7 @@ declare class Renderer {
243
688
  * @param {Object3D} scene - The scene or 3D object to precompile.
244
689
  * @param {Camera} camera - The camera that is used to render the scene.
245
690
  * @param {?Scene} targetScene - If the first argument is a 3D object, this parameter must represent the scene the 3D object is going to be added.
246
- * @return {Promise<Array|undefined>} A Promise that resolves when the compile has been finished.
691
+ * @return {Promise} A Promise that resolves when the compile has been finished.
247
692
  */
248
693
  compileAsync(scene: Object3D, camera: Camera, targetScene?: Scene | null): Promise<void>;
249
694
  /**
@@ -265,12 +710,12 @@ declare class Renderer {
265
710
  * @return {Promise} A Promise that resolves when synchronization has been finished.
266
711
  */
267
712
  waitForGPU(): Promise<void>;
713
+ set inspector(value: InspectorBase);
268
714
  /**
269
- * Sets the inspector instance. The inspector can be any class that extends from `InspectorBase`.
715
+ * The inspector instance. The inspector can be any class that extends from `InspectorBase`.
270
716
  *
271
- * @param {InspectorBase} value - The new inspector.
717
+ * @type {InspectorBase}
272
718
  */
273
- set inspector(value: InspectorBase);
274
719
  get inspector(): InspectorBase;
275
720
  /**
276
721
  * Enables or disables high precision for model-view and normal-view matrices.
@@ -295,17 +740,24 @@ declare class Renderer {
295
740
  * @param {MRTNode} mrt - The MRT node to set.
296
741
  * @return {Renderer} A reference to this renderer.
297
742
  */
298
- setMRT(mrt: MRTNode | null): this;
743
+ setMRT(mrt: MRTNode | null): Renderer;
299
744
  /**
300
745
  * Returns the MRT configuration.
301
746
  *
302
747
  * @return {MRTNode} The MRT configuration.
303
748
  */
304
- getMRT(): MRTNode | null;
749
+ getMRT(): MRTNode;
750
+ /**
751
+ * Returns the output buffer type.
752
+ *
753
+ * @return {number} The output buffer type.
754
+ */
755
+ getOutputBufferType(): TextureDataType;
305
756
  /**
306
- * Returns the color buffer type.
757
+ * Returns the output buffer type.
307
758
  *
308
- * @return {number} The color buffer type.
759
+ * @deprecated since r182. Use `.getOutputBufferType()` instead.
760
+ * @return {number} The output buffer type.
309
761
  */
310
762
  getColorBufferType(): TextureDataType;
311
763
  /**
@@ -314,7 +766,7 @@ declare class Renderer {
314
766
  * @private
315
767
  * @param {Object} info - Information about the context lost.
316
768
  */
317
- _onDeviceLost(info: DeviceLostInfo): void;
769
+ private _onDeviceLost;
318
770
  /**
319
771
  * Renders the given render bundle.
320
772
  *
@@ -323,7 +775,7 @@ declare class Renderer {
323
775
  * @param {Scene} sceneRef - The scene the render bundle belongs to.
324
776
  * @param {LightsNode} lightsNode - The lights node.
325
777
  */
326
- _renderBundle(bundle: Bundle, sceneRef: Scene, lightsNode: LightsNode): void;
778
+ private _renderBundle;
327
779
  /**
328
780
  * Renders the scene or 3D object with the given camera. This method can only be called
329
781
  * if the renderer has been initialized. When using `render()` inside an animation loop,
@@ -355,7 +807,7 @@ declare class Renderer {
355
807
  * @private
356
808
  * @return {?RenderTarget} The render target. The method returns `null` if no output conversion should be applied.
357
809
  */
358
- _getFrameBufferTarget(): RenderTarget<Texture<unknown>> | null;
810
+ private _getFrameBufferTarget;
359
811
  /**
360
812
  * Renders the scene or 3D object with the given camera.
361
813
  *
@@ -365,7 +817,7 @@ declare class Renderer {
365
817
  * @param {boolean} [useFrameBufferTarget=true] - Whether to use a framebuffer target or not.
366
818
  * @return {RenderContext} The current render context.
367
819
  */
368
- _renderScene(scene: Object3D, camera: Camera, useFrameBufferTarget?: boolean): RenderContext | undefined;
820
+ private _renderScene;
369
821
  _setXRLayerSize(width: number, height: number): void;
370
822
  /**
371
823
  * The output pass performs tone mapping and color space conversion.
@@ -373,7 +825,7 @@ declare class Renderer {
373
825
  * @private
374
826
  * @param {RenderTarget} renderTarget - The current render target.
375
827
  */
376
- _renderOutput(renderTarget: RenderTarget): void;
828
+ private _renderOutput;
377
829
  /**
378
830
  * Returns the maximum available anisotropy for texture filtering.
379
831
  *
@@ -422,7 +874,7 @@ declare class Renderer {
422
874
  *
423
875
  * @return {GPUCanvasContext|WebGL2RenderingContext} The rendering context.
424
876
  */
425
- getContext(): void;
877
+ getContext(): unknown;
426
878
  /**
427
879
  * Returns the pixel ratio.
428
880
  *
@@ -492,16 +944,18 @@ declare class Renderer {
492
944
  * @return {Vector4} The scissor rectangle.
493
945
  */
494
946
  getScissor(target: Vector4): Vector4;
947
+ /**
948
+ * Defines the scissor rectangle.
949
+ */
950
+ setScissor(x: Vector4): void;
495
951
  /**
496
952
  * Defines the scissor rectangle.
497
953
  *
498
- * @param {number | Vector4} x - The horizontal coordinate for the lower left corner of the box in logical pixel unit.
499
- * Instead of passing four arguments, the method also works with a single four-dimensional vector.
500
- * @param {number} y - The vertical coordinate for the lower left corner of the box in logical pixel unit.
954
+ * @param {number} x - The horizontal coordinate for the upper left corner of the box in logical pixel unit.
955
+ * @param {number} y - The vertical coordinate for the upper left corner of the box in logical pixel unit.
501
956
  * @param {number} width - The width of the scissor box in logical pixel unit.
502
957
  * @param {number} height - The height of the scissor box in logical pixel unit.
503
958
  */
504
- setScissor(x: Vector4): void;
505
959
  setScissor(x: number, y: number, width: number, height: number): void;
506
960
  /**
507
961
  * Returns the scissor test value.
@@ -522,17 +976,20 @@ declare class Renderer {
522
976
  * @return {Vector4} The viewport definition.
523
977
  */
524
978
  getViewport(target: Vector4): Vector4;
979
+ /**
980
+ * Defines the viewport.
981
+ */
982
+ setViewport(x: Vector4): void;
525
983
  /**
526
984
  * Defines the viewport.
527
985
  *
528
- * @param {number | Vector4} x - The horizontal coordinate for the lower left corner of the viewport origin in logical pixel unit.
529
- * @param {number} y - The vertical coordinate for the lower left corner of the viewport origin in logical pixel unit.
986
+ * @param {number} x - The horizontal coordinate for the upper left corner of the viewport origin in logical pixel unit.
987
+ * @param {number} y - The vertical coordinate for the upper left corner of the viewport origin in logical pixel unit.
530
988
  * @param {number} width - The width of the viewport in logical pixel unit.
531
989
  * @param {number} height - The height of the viewport in logical pixel unit.
532
990
  * @param {number} minDepth - The minimum depth value of the viewport. WebGPU only.
533
991
  * @param {number} maxDepth - The maximum depth value of the viewport. WebGPU only.
534
992
  */
535
- setViewport(x: Vector4): void;
536
993
  setViewport(x: number, y: number, width: number, height: number, minDepth?: number, maxDepth?: number): void;
537
994
  /**
538
995
  * Returns the clear color.
@@ -592,7 +1049,7 @@ declare class Renderer {
592
1049
  * @param {Object3D} object - The 3D object to test.
593
1050
  * @return {boolean} Whether the 3D object is fully occluded or not.
594
1051
  */
595
- isOccluded(object: Object3D): boolean | null;
1052
+ isOccluded(object: Object3D): boolean;
596
1053
  /**
597
1054
  * Performs a manual clear operation. This method ignores `autoClear` properties.
598
1055
  *
@@ -716,7 +1173,7 @@ declare class Renderer {
716
1173
  *
717
1174
  * @param {Object} renderTarget - The render target to set as the output target.
718
1175
  */
719
- setOutputRenderTarget(renderTarget: RenderTarget | null): void;
1176
+ setOutputRenderTarget(renderTarget: RenderTarget): void;
720
1177
  /**
721
1178
  * Returns the current output target.
722
1179
  *
@@ -738,8 +1195,10 @@ declare class Renderer {
738
1195
  getCanvasTarget(): CanvasTarget;
739
1196
  /**
740
1197
  * Resets the renderer to the initial state before WebXR started.
1198
+ *
1199
+ * @private
741
1200
  */
742
- _resetXRState(): void;
1201
+ private _resetXRState;
743
1202
  /**
744
1203
  * Callback for {@link Renderer#setRenderObjectFunction}.
745
1204
  *
@@ -773,8 +1232,10 @@ declare class Renderer {
773
1232
  camera: Camera,
774
1233
  geometry: BufferGeometry,
775
1234
  material: Material,
776
- group: GeometryGroup,
1235
+ group: GeometryGroup | null,
777
1236
  lightsNode: LightsNode,
1237
+ clippingContext: ClippingContext,
1238
+ passId?: string | null | undefined,
778
1239
  ) => void)
779
1240
  | null,
780
1241
  ): void;
@@ -790,10 +1251,10 @@ declare class Renderer {
790
1251
  camera: Camera,
791
1252
  geometry: BufferGeometry,
792
1253
  material: Material,
793
- group: GeometryGroup,
1254
+ group: GeometryGroup | null,
794
1255
  lightsNode: LightsNode,
795
- clippingContext: ClippingContext | null,
796
- passId: string | null,
1256
+ clippingContext: ClippingContext,
1257
+ passId?: string | null | undefined,
797
1258
  ) => void)
798
1259
  | null;
799
1260
  /**
@@ -809,7 +1270,7 @@ declare class Renderer {
809
1270
  */
810
1271
  compute(
811
1272
  computeNodes: ComputeNode | ComputeNode[],
812
- dispatchSize?: number[] | number | IndirectStorageBufferAttribute | null,
1273
+ dispatchSize?: number | number[] | IndirectStorageBufferAttribute,
813
1274
  ): Promise<void> | undefined;
814
1275
  /**
815
1276
  * Execute a single or an array of compute nodes.
@@ -824,7 +1285,7 @@ declare class Renderer {
824
1285
  */
825
1286
  computeAsync(
826
1287
  computeNodes: ComputeNode | ComputeNode[],
827
- dispatchSize?: number[] | number | IndirectStorageBufferAttribute | null,
1288
+ dispatchSize?: number | number[] | IndirectStorageBufferAttribute,
828
1289
  ): Promise<void>;
829
1290
  /**
830
1291
  * Checks if the given feature is supported by the selected backend.
@@ -834,7 +1295,7 @@ declare class Renderer {
834
1295
  * @param {string} name - The feature's name.
835
1296
  * @return {Promise<boolean>} A Promise that resolves with a bool that indicates whether the feature is supported or not.
836
1297
  */
837
- hasFeatureAsync(name: string): Promise<void>;
1298
+ hasFeatureAsync(name: string): Promise<boolean>;
838
1299
  resolveTimestampsAsync(type?: TimestampQuery): Promise<number | undefined>;
839
1300
  /**
840
1301
  * Checks if the given feature is supported by the selected backend. If the
@@ -843,7 +1304,7 @@ declare class Renderer {
843
1304
  * @param {string} name - The feature's name.
844
1305
  * @return {boolean} Whether the feature is supported or not.
845
1306
  */
846
- hasFeature(name: string): void;
1307
+ hasFeature(name: string): boolean;
847
1308
  /**
848
1309
  * Returns `true` when the renderer has been initialized.
849
1310
  *
@@ -869,13 +1330,19 @@ declare class Renderer {
869
1330
  * @param {Texture} texture - The texture.
870
1331
  */
871
1332
  initTexture(texture: Texture): void;
1333
+ /**
1334
+ * Initializes the given render target.
1335
+ *
1336
+ * @param {RenderTarget} renderTarget - The render target to intialize.
1337
+ */
1338
+ initRenderTarget(renderTarget: RenderTarget): void;
872
1339
  /**
873
1340
  * Copies the current bound framebuffer into the given texture.
874
1341
  *
875
1342
  * @param {FramebufferTexture} framebufferTexture - The texture.
876
1343
  * @param {?(Vector2|Vector4)} [rectangle=null] - A two or four dimensional vector that defines the rectangular portion of the framebuffer that should be copied.
877
1344
  */
878
- copyFramebufferToTexture(framebufferTexture: FramebufferTexture, rectangle?: Rectangle | null): void;
1345
+ copyFramebufferToTexture(framebufferTexture: FramebufferTexture, rectangle?: (Vector2 | Vector4) | null): void;
879
1346
  /**
880
1347
  * Copies data of the given source texture into a destination texture.
881
1348
  *
@@ -915,24 +1382,19 @@ declare class Renderer {
915
1382
  height: number,
916
1383
  textureIndex?: number,
917
1384
  faceIndex?: number,
918
- ): Promise<import("../../core/BufferAttribute.js").TypedArray>;
1385
+ ): Promise<TypedArray>;
919
1386
  /**
920
1387
  * Analyzes the given 3D object's hierarchy and builds render lists from the
921
1388
  * processed hierarchy.
922
1389
  *
1390
+ * @private
923
1391
  * @param {Object3D} object - The 3D object to process (usually a scene).
924
1392
  * @param {Camera} camera - The camera the object is rendered with.
925
1393
  * @param {number} groupOrder - The group order is derived from the `renderOrder` of groups and is used to group 3D objects within groups.
926
1394
  * @param {RenderList} renderList - The current render list.
927
1395
  * @param {ClippingContext} clippingContext - The current clipping context.
928
1396
  */
929
- _projectObject(
930
- object: Object3D,
931
- camera: Camera,
932
- groupOrder: number,
933
- renderList: RenderList,
934
- clippingContext: ClippingContext | null,
935
- ): void;
1397
+ private _projectObject;
936
1398
  /**
937
1399
  * Renders the given render bundles.
938
1400
  *
@@ -941,7 +1403,7 @@ declare class Renderer {
941
1403
  * @param {Scene} sceneRef - The scene the render bundles belong to.
942
1404
  * @param {LightsNode} lightsNode - The current lights node.
943
1405
  */
944
- _renderBundles(bundles: Bundle[], sceneRef: Scene, lightsNode: LightsNode): void;
1406
+ private _renderBundles;
945
1407
  /**
946
1408
  * Renders the transparent objects from the given render lists.
947
1409
  *
@@ -952,13 +1414,7 @@ declare class Renderer {
952
1414
  * @param {Scene} scene - The scene the render list belongs to.
953
1415
  * @param {LightsNode} lightsNode - The current lights node.
954
1416
  */
955
- _renderTransparents(
956
- renderList: RenderItem[],
957
- doublePassList: RenderItem[],
958
- camera: Camera,
959
- scene: Scene,
960
- lightsNode: LightsNode,
961
- ): void;
1417
+ private _renderTransparents;
962
1418
  /**
963
1419
  * Renders the objects from the given render list.
964
1420
  *
@@ -969,21 +1425,16 @@ declare class Renderer {
969
1425
  * @param {LightsNode} lightsNode - The current lights node.
970
1426
  * @param {?string} [passId=null] - An optional ID for identifying the pass.
971
1427
  */
972
- _renderObjects(
973
- renderList: RenderItem[],
974
- camera: Camera,
975
- scene: Scene,
976
- lightsNode: LightsNode,
977
- passId?: string | null,
978
- ): void;
1428
+ private _renderObjects;
979
1429
  /**
980
1430
  * Retrieves shadow nodes for the given material. This is used to setup shadow passes.
981
1431
  * The result is cached per material and updated when the material's version changes.
982
1432
  *
1433
+ * @private
983
1434
  * @param {Material} material
984
1435
  * @returns {Object} - The shadow nodes for the material.
985
1436
  */
986
- _getShadowNodes(material: Material): any;
1437
+ private _getShadowNodes;
987
1438
  /**
988
1439
  * This method represents the default render object function that manages the render lifecycle
989
1440
  * of the object.
@@ -1004,11 +1455,19 @@ declare class Renderer {
1004
1455
  camera: Camera,
1005
1456
  geometry: BufferGeometry,
1006
1457
  material: Material,
1007
- group: GeometryGroup,
1458
+ group: GeometryGroup | null,
1008
1459
  lightsNode: LightsNode,
1009
1460
  clippingContext?: ClippingContext | null,
1010
1461
  passId?: string | null,
1011
1462
  ): void;
1463
+ /**
1464
+ * Checks if the given compatibility is supported by the selected backend. If the
1465
+ * renderer has not been initialized, this method always returns `false`.
1466
+ *
1467
+ * @param {string} name - The compatibility's name.
1468
+ * @return {boolean} Whether the compatibility is supported or not.
1469
+ */
1470
+ hasCompatibility(name: string): boolean;
1012
1471
  /**
1013
1472
  * This method represents the default `_handleObjectFunction` implementation which creates
1014
1473
  * a render object from the given data and performs the draw command with the selected backend.
@@ -1023,16 +1482,7 @@ declare class Renderer {
1023
1482
  * @param {ClippingContext} clippingContext - The clipping context.
1024
1483
  * @param {string} [passId] - An optional ID for identifying the pass.
1025
1484
  */
1026
- _renderObjectDirect(
1027
- object: Object3D,
1028
- material: Material,
1029
- scene: Scene,
1030
- camera: Camera,
1031
- lightsNode: LightsNode,
1032
- group: GeometryGroup,
1033
- clippingContext: ClippingContext | null,
1034
- passId?: string,
1035
- ): void;
1485
+ private _renderObjectDirect;
1036
1486
  /**
1037
1487
  * A different implementation for `_handleObjectFunction` which only makes sure the object is ready for rendering.
1038
1488
  * Used in `compileAsync()`.
@@ -1047,22 +1497,7 @@ declare class Renderer {
1047
1497
  * @param {ClippingContext} clippingContext - The clipping context.
1048
1498
  * @param {string} [passId] - An optional ID for identifying the pass.
1049
1499
  */
1050
- _createObjectPipeline(
1051
- object: Object3D,
1052
- material: Material,
1053
- scene: Scene,
1054
- camera: Camera,
1055
- lightsNode: LightsNode,
1056
- group: Group,
1057
- clippingContext: ClippingContext | null,
1058
- passId?: string,
1059
- ): void;
1060
- /**
1061
- * Callback when the canvas has been resized.
1062
- *
1063
- * @private
1064
- */
1065
- _onCanvasTargetResize(): void;
1500
+ private _createObjectPipeline;
1066
1501
  /**
1067
1502
  * Alias for `compileAsync()`.
1068
1503
  *
@@ -1074,11 +1509,5 @@ declare class Renderer {
1074
1509
  */
1075
1510
  get compile(): (scene: Object3D, camera: Camera, targetScene?: Scene | null) => Promise<void>;
1076
1511
  }
1077
- /**
1078
- * Animation loop parameter of `renderer.setAnimationLoop()`.
1079
- *
1080
- * @callback onAnimationCallback
1081
- * @param {DOMHighResTimeStamp} time - A timestamp indicating the end time of the previous frame's rendering.
1082
- * @param {XRFrame} [frame] - A reference to the current XR frame. Only relevant when using XR rendering.
1083
- */
1512
+
1084
1513
  export default Renderer;