@types/three 0.165.0 → 0.167.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 (330) hide show
  1. three/README.md +1 -1
  2. three/build/three.webgpu.d.ts +1 -0
  3. three/build/three.webgpu.min.d.ts +1 -0
  4. three/examples/jsm/Addons.d.ts +1 -1
  5. three/examples/jsm/animation/MMDPhysics.d.ts +4 -4
  6. three/examples/jsm/csm/CSM.d.ts +3 -4
  7. three/examples/jsm/csm/CSMFrustum.d.ts +1 -1
  8. three/examples/jsm/exporters/GLTFExporter.d.ts +6 -0
  9. three/examples/jsm/geometries/TeapotGeometry.d.ts +24 -0
  10. three/examples/jsm/helpers/ViewHelper.d.ts +8 -6
  11. three/examples/jsm/lights/RectAreaLightTexturesLib.d.ts +7 -0
  12. three/examples/jsm/lights/RectAreaLightUniformsLib.d.ts +4 -2
  13. three/examples/jsm/lines/LineMaterial.d.ts +2 -4
  14. three/examples/jsm/lines/webgpu/Line2.d.ts +14 -0
  15. three/examples/jsm/lines/webgpu/LineSegments2.d.ts +15 -0
  16. three/examples/jsm/loaders/DDSLoader.d.ts +8 -2
  17. three/examples/jsm/loaders/GLTFLoader.d.ts +3 -1
  18. three/examples/jsm/loaders/KTX2Loader.d.ts +1 -2
  19. three/examples/jsm/loaders/KTXLoader.d.ts +8 -2
  20. three/examples/jsm/loaders/LUTImageLoader.d.ts +18 -0
  21. three/examples/jsm/loaders/MaterialXLoader.d.ts +1 -2
  22. three/examples/jsm/loaders/PVRLoader.d.ts +2 -2
  23. three/examples/jsm/loaders/UltraHDRLoader.d.ts +21 -0
  24. three/package.json +6 -5
  25. three/src/Three.WebGPU.d.ts +184 -0
  26. three/src/Three.d.ts +26 -91
  27. three/src/animation/AnimationClip.d.ts +12 -4
  28. three/src/animation/AnimationUtils.d.ts +32 -7
  29. three/src/animation/KeyframeTrack.d.ts +9 -1
  30. three/src/animation/PropertyBinding.d.ts +12 -12
  31. three/src/cameras/OrthographicCamera.d.ts +27 -0
  32. three/src/cameras/PerspectiveCamera.d.ts +31 -0
  33. three/src/constants.d.ts +13 -1
  34. three/src/core/BufferAttribute.d.ts +11 -6
  35. three/src/core/BufferGeometry.d.ts +26 -3
  36. three/src/core/InterleavedBufferAttribute.d.ts +3 -3
  37. three/src/core/Object3D.d.ts +51 -6
  38. three/src/extras/DataUtils.d.ts +9 -2
  39. three/src/extras/ImageUtils.d.ts +6 -7
  40. three/src/extras/ShapeUtils.d.ts +5 -8
  41. three/src/extras/TextureUtils.d.ts +42 -0
  42. three/src/extras/core/Curve.d.ts +8 -2
  43. three/src/extras/core/CurvePath.d.ts +9 -1
  44. three/src/extras/core/Path.d.ts +9 -2
  45. three/src/extras/core/Shape.d.ts +9 -1
  46. three/src/lights/Light.d.ts +19 -2
  47. three/src/lights/LightShadow.d.ts +18 -2
  48. three/src/lights/webgpu/IESSpotLight.d.ts +6 -0
  49. three/src/loaders/Cache.d.ts +13 -8
  50. three/src/materials/Material.d.ts +185 -14
  51. three/src/materials/ShaderMaterial.d.ts +49 -2
  52. three/src/math/ColorManagement.d.ts +3 -0
  53. three/src/math/Euler.d.ts +4 -2
  54. three/src/math/Matrix2.d.ts +53 -0
  55. three/src/math/Matrix3.d.ts +67 -115
  56. three/src/math/Matrix4.d.ts +48 -100
  57. three/src/math/Quaternion.d.ts +5 -3
  58. three/src/math/Vector2.d.ts +1 -1
  59. three/src/math/Vector4.d.ts +6 -0
  60. three/{examples/jsm → src}/nodes/Nodes.d.ts +37 -7
  61. three/{examples/jsm → src}/nodes/accessors/BatchNode.d.ts +1 -1
  62. three/{examples/jsm → src}/nodes/accessors/BufferAttributeNode.d.ts +5 -1
  63. three/{examples/jsm → src}/nodes/accessors/CameraNode.d.ts +3 -1
  64. three/{examples/jsm → src}/nodes/accessors/CubeTextureNode.d.ts +11 -3
  65. three/{examples/jsm → src}/nodes/accessors/InstanceNode.d.ts +1 -1
  66. three/{examples/jsm → src}/nodes/accessors/MaterialNode.d.ts +11 -2
  67. three/{examples/jsm → src}/nodes/accessors/MaterialReferenceNode.d.ts +1 -1
  68. three/{examples/jsm → src}/nodes/accessors/ModelNode.d.ts +1 -1
  69. three/{examples/jsm → src}/nodes/accessors/NormalNode.d.ts +3 -3
  70. three/{examples/jsm → src}/nodes/accessors/Object3DNode.d.ts +1 -1
  71. three/{examples/jsm → src}/nodes/accessors/ReflectVectorNode.d.ts +3 -0
  72. three/{examples/jsm → src}/nodes/accessors/SkinningNode.d.ts +1 -1
  73. three/{examples/jsm → src}/nodes/accessors/StorageBufferNode.d.ts +7 -0
  74. three/src/nodes/accessors/StorageTextureNode.d.ts +40 -0
  75. three/{examples/jsm → src}/nodes/accessors/Texture3DNode.d.ts +3 -2
  76. three/{examples/jsm → src}/nodes/accessors/TextureNode.d.ts +9 -2
  77. three/{examples/jsm → src}/nodes/core/CacheNode.d.ts +4 -5
  78. three/{examples/jsm → src}/nodes/core/IndexNode.d.ts +3 -1
  79. three/{examples/jsm → src}/nodes/core/LightingModel.d.ts +12 -3
  80. three/src/nodes/core/MRTNode.d.ts +19 -0
  81. three/{examples/jsm → src}/nodes/core/Node.d.ts +6 -10
  82. three/{examples/jsm → src}/nodes/core/NodeBuilder.d.ts +13 -3
  83. three/{examples/jsm → src}/nodes/core/NodeCache.d.ts +13 -4
  84. three/{examples/jsm → src}/nodes/core/NodeFrame.d.ts +5 -2
  85. three/{examples/jsm → src}/nodes/core/NodeFunction.d.ts +2 -2
  86. three/{examples/jsm → src}/nodes/core/NodeUniform.d.ts +1 -1
  87. three/{examples/jsm → src}/nodes/core/NodeUtils.d.ts +6 -1
  88. three/{examples/jsm → src}/nodes/core/PropertyNode.d.ts +1 -0
  89. three/{examples/jsm → src}/nodes/core/UniformNode.d.ts +2 -0
  90. three/{examples/jsm → src}/nodes/core/VarNode.d.ts +2 -0
  91. three/{examples/jsm → src}/nodes/display/AnamorphicNode.d.ts +1 -1
  92. three/src/nodes/display/BloomNode.d.ts +35 -0
  93. three/{examples/jsm → src}/nodes/display/ColorAdjustmentNode.d.ts +0 -1
  94. three/{examples/jsm → src}/nodes/display/ColorSpaceNode.d.ts +1 -1
  95. three/src/nodes/display/DenoiseNode.d.ts +38 -0
  96. three/src/nodes/display/DepthOfFieldNode.d.ts +30 -0
  97. three/src/nodes/display/DotScreenNode.d.ts +27 -0
  98. three/src/nodes/display/FXAANode.d.ts +19 -0
  99. three/src/nodes/display/FilmNode.d.ts +25 -0
  100. three/src/nodes/display/GTAONode.d.ts +46 -0
  101. three/{examples/jsm → src}/nodes/display/GaussianBlurNode.d.ts +8 -5
  102. three/src/nodes/display/Lut3DNode.d.ts +30 -0
  103. three/{examples/jsm → src}/nodes/display/NormalMapNode.d.ts +1 -2
  104. three/src/nodes/display/PassNode.d.ts +62 -0
  105. three/src/nodes/display/PixelationPassNode.d.ts +67 -0
  106. three/src/nodes/display/RGBShiftNode.d.ts +24 -0
  107. three/src/nodes/display/RenderOutputNode.d.ts +28 -0
  108. three/src/nodes/display/SobelOperatorNode.d.ts +17 -0
  109. three/{examples/jsm → src}/nodes/display/ToneMappingNode.d.ts +1 -1
  110. three/src/nodes/display/TransitionNode.d.ts +41 -0
  111. three/{examples/jsm → src}/nodes/display/ViewportDepthNode.d.ts +4 -6
  112. three/{examples/jsm → src}/nodes/display/ViewportTextureNode.d.ts +1 -1
  113. three/src/nodes/functions/BSDF/LTC.d.ts +9 -0
  114. three/{examples/jsm → src}/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.d.ts +1 -1
  115. three/src/nodes/functions/BasicLightingModel.d.ts +7 -0
  116. three/src/nodes/functions/PhongLightingModel.d.ts +7 -0
  117. three/{examples/jsm → src}/nodes/geometry/RangeNode.d.ts +4 -1
  118. three/{examples/jsm → src}/nodes/lighting/AnalyticLightNode.d.ts +1 -1
  119. three/src/nodes/lighting/BasicEnvironmentNode.d.ts +10 -0
  120. three/src/nodes/lighting/BasicLightMapNode.d.ts +8 -0
  121. three/{examples/jsm → src}/nodes/lighting/HemisphereLightNode.d.ts +1 -1
  122. three/{examples/jsm → src}/nodes/lighting/LightingNode.d.ts +2 -0
  123. three/{examples/jsm → src}/nodes/lighting/LightsNode.d.ts +1 -1
  124. three/{examples/jsm → src}/nodes/lighting/PointLightNode.d.ts +1 -1
  125. three/src/nodes/lighting/RectAreaLightNode.d.ts +21 -0
  126. three/{examples/jsm → src}/nodes/lighting/SpotLightNode.d.ts +1 -1
  127. three/{examples/jsm → src}/nodes/loaders/NodeLoader.d.ts +3 -1
  128. three/{examples/jsm → src}/nodes/loaders/NodeMaterialLoader.d.ts +1 -1
  129. three/{examples/jsm → src}/nodes/loaders/NodeObjectLoader.d.ts +3 -1
  130. three/src/nodes/materials/Line2NodeMaterial.d.ts +53 -0
  131. three/{examples/jsm → src}/nodes/materials/LineBasicNodeMaterial.d.ts +3 -1
  132. three/{examples/jsm → src}/nodes/materials/Materials.d.ts +2 -1
  133. three/{examples/jsm → src}/nodes/materials/MeshBasicNodeMaterial.d.ts +5 -1
  134. three/{examples/jsm → src}/nodes/materials/MeshMatcapNodeMaterial.d.ts +5 -1
  135. three/{examples/jsm → src}/nodes/materials/MeshNormalNodeMaterial.d.ts +4 -1
  136. three/{examples/jsm → src}/nodes/materials/MeshPhongNodeMaterial.d.ts +8 -4
  137. three/{examples/jsm → src}/nodes/materials/MeshPhysicalNodeMaterial.d.ts +21 -20
  138. three/src/nodes/materials/MeshSSSNodeMaterial.d.ts +16 -0
  139. three/{examples/jsm → src}/nodes/materials/MeshStandardNodeMaterial.d.ts +9 -5
  140. three/{examples/jsm → src}/nodes/materials/MeshToonNodeMaterial.d.ts +5 -1
  141. three/{examples/jsm → src}/nodes/materials/NodeMaterial.d.ts +54 -49
  142. three/{examples/jsm → src}/nodes/materials/PointsNodeMaterial.d.ts +3 -1
  143. three/{examples/jsm → src}/nodes/materials/ShadowNodeMaterial.d.ts +2 -1
  144. three/{examples/jsm → src}/nodes/materials/SpriteNodeMaterial.d.ts +5 -4
  145. three/{examples/jsm → src}/nodes/materialx/lib/mx_hsv.d.ts +1 -0
  146. three/src/nodes/materialx/lib/mx_noise.d.ts +359 -0
  147. three/{examples/jsm → src}/nodes/math/MathNode.d.ts +9 -1
  148. three/{examples/jsm → src}/nodes/pmrem/PMREMNode.d.ts +1 -1
  149. three/{examples/jsm → src}/nodes/utils/DiscardNode.d.ts +1 -0
  150. three/{examples/jsm → src}/nodes/utils/MaxMipLevelNode.d.ts +3 -3
  151. three/src/nodes/utils/PackingNode.d.ts +24 -0
  152. three/src/nodes/utils/RTTNode.d.ts +45 -0
  153. three/{examples/jsm → src}/nodes/utils/ReflectorNode.d.ts +3 -1
  154. three/src/objects/BatchedMesh.d.ts +58 -54
  155. three/src/objects/InstancedMesh.d.ts +15 -2
  156. three/src/objects/LOD.d.ts +17 -1
  157. three/src/objects/Mesh.d.ts +11 -1
  158. three/src/objects/Points.d.ts +0 -3
  159. three/src/objects/Skeleton.d.ts +10 -3
  160. three/src/objects/SkinnedMesh.d.ts +15 -3
  161. three/{examples/jsm → src}/renderers/common/Animation.d.ts +0 -1
  162. three/{examples/jsm → src}/renderers/common/Attributes.d.ts +4 -2
  163. three/{examples/jsm → src}/renderers/common/Backend.d.ts +1 -1
  164. three/{examples/jsm → src}/renderers/common/Background.d.ts +2 -1
  165. three/src/renderers/common/BindGroup.d.ts +9 -0
  166. three/{examples/jsm → src}/renderers/common/Bindings.d.ts +11 -14
  167. three/{examples/jsm → src}/renderers/common/ClippingContext.d.ts +6 -1
  168. three/{examples/jsm → src}/renderers/common/Color4.d.ts +1 -1
  169. three/{examples/jsm → src}/renderers/common/CubeRenderTarget.d.ts +4 -1
  170. three/{examples/jsm → src}/renderers/common/Geometries.d.ts +6 -3
  171. three/{examples/jsm → src}/renderers/common/Info.d.ts +7 -2
  172. three/{examples/jsm → src}/renderers/common/PostProcessing.d.ts +9 -1
  173. three/{examples/jsm/objects → src/renderers/common}/QuadMesh.d.ts +4 -2
  174. three/{examples/jsm → src}/renderers/common/RenderBundle.d.ts +2 -1
  175. three/{examples/jsm → src}/renderers/common/RenderBundles.d.ts +2 -1
  176. three/{examples/jsm → src}/renderers/common/RenderContext.d.ts +4 -1
  177. three/{examples/jsm → src}/renderers/common/RenderContexts.d.ts +3 -1
  178. three/{examples/jsm → src}/renderers/common/RenderList.d.ts +5 -1
  179. three/{examples/jsm → src}/renderers/common/RenderLists.d.ts +2 -1
  180. three/{examples/jsm → src}/renderers/common/RenderObject.d.ts +19 -16
  181. three/{examples/jsm → src}/renderers/common/RenderObjects.d.ts +5 -2
  182. three/{examples/jsm → src}/renderers/common/Renderer.d.ts +41 -29
  183. three/src/renderers/common/SampledTexture.d.ts +27 -0
  184. three/src/renderers/common/Sampler.d.ts +11 -0
  185. three/{examples/jsm → src}/renderers/common/StorageBufferAttribute.d.ts +1 -1
  186. three/{examples/jsm → src}/renderers/common/StorageInstancedBufferAttribute.d.ts +2 -1
  187. three/{examples/jsm → src}/renderers/common/StorageTexture.d.ts +1 -1
  188. three/{examples/jsm → src}/renderers/common/Textures.d.ts +4 -1
  189. three/{examples/jsm → src}/renderers/common/Uniform.d.ts +9 -4
  190. three/{examples/jsm → src}/renderers/common/UniformsGroup.d.ts +4 -2
  191. three/{examples/jsm → src}/renderers/common/extras/PMREMGenerator.d.ts +2 -1
  192. three/{examples/jsm → src}/renderers/common/nodes/NodeBuilderState.d.ts +8 -4
  193. three/src/renderers/common/nodes/NodeSampledTexture.d.ts +29 -0
  194. three/src/renderers/common/nodes/NodeSampler.d.ts +12 -0
  195. three/{examples/jsm → src}/renderers/common/nodes/NodeUniform.d.ts +10 -5
  196. three/{examples/jsm → src}/renderers/common/nodes/NodeUniformsGroup.d.ts +1 -3
  197. three/{examples/jsm → src}/renderers/common/nodes/Nodes.d.ts +22 -8
  198. three/src/renderers/shaders/ShaderLib.d.ts +3 -1
  199. three/src/renderers/shaders/UniformsLib.d.ts +3 -0
  200. three/src/renderers/shaders/UniformsUtils.d.ts +6 -3
  201. three/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/WebGLBackend.d.ts +1 -1
  202. three/{examples/jsm → src}/renderers/webgpu/WebGPUBackend.d.ts +1 -1
  203. three/src/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts +125 -0
  204. three/src/renderers/webgpu/nodes/WGSLNodeFunction.d.ts +6 -0
  205. three/src/renderers/webgpu/nodes/WGSLNodeParser.d.ts +6 -0
  206. three/src/renderers/webgpu/utils/WebGPUConstants.d.ts +328 -0
  207. three/src/renderers/webxr/WebXRDepthSensing.d.ts +2 -0
  208. three/src/renderers/webxr/WebXRManager.d.ts +33 -23
  209. three/src/scenes/Fog.d.ts +7 -24
  210. three/src/scenes/FogExp2.d.ts +9 -3
  211. three/src/scenes/Scene.d.ts +21 -5
  212. three/src/textures/CompressedArrayTexture.d.ts +4 -4
  213. three/src/textures/CompressedTexture.d.ts +16 -8
  214. three/src/textures/Source.d.ts +15 -1
  215. three/src/textures/Texture.d.ts +40 -2
  216. three/examples/jsm/deprecated/Geometry.d.ts +0 -341
  217. three/examples/jsm/lights/IESSpotLight.d.ts +0 -5
  218. three/examples/jsm/nodes/display/PassNode.d.ts +0 -46
  219. three/examples/jsm/nodes/functions/PhongLightingModel.d.ts +0 -7
  220. three/examples/jsm/nodes/materials/MeshSSSNodeMaterial.d.ts +0 -17
  221. three/examples/jsm/nodes/materialx/lib/mx_noise.d.ts +0 -129
  222. three/examples/jsm/renderers/webgl/nodes/SlotNode.d.ts +0 -17
  223. three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +0 -37
  224. three/examples/jsm/renderers/webgl/nodes/WebGLNodes.d.ts +0 -3
  225. /three/{examples/jsm → src}/nodes/accessors/AccessorsUtils.d.ts +0 -0
  226. /three/{examples/jsm → src}/nodes/accessors/BitangentNode.d.ts +0 -0
  227. /three/{examples/jsm → src}/nodes/accessors/BufferNode.d.ts +0 -0
  228. /three/{examples/jsm → src}/nodes/accessors/ClippingNode.d.ts +0 -0
  229. /three/{examples/jsm → src}/nodes/accessors/ModelViewProjectionNode.d.ts +0 -0
  230. /three/{examples/jsm → src}/nodes/accessors/PointUVNode.d.ts +0 -0
  231. /three/{examples/jsm → src}/nodes/accessors/PositionNode.d.ts +0 -0
  232. /three/{examples/jsm → src}/nodes/accessors/ReferenceNode.d.ts +0 -0
  233. /three/{examples/jsm → src}/nodes/accessors/RendererReferenceNode.d.ts +0 -0
  234. /three/{examples/jsm → src}/nodes/accessors/TangentNode.d.ts +0 -0
  235. /three/{examples/jsm → src}/nodes/accessors/TextureBicubicNode.d.ts +0 -0
  236. /three/{examples/jsm → src}/nodes/accessors/UVNode.d.ts +0 -0
  237. /three/{examples/jsm → src}/nodes/accessors/UniformsNode.d.ts +0 -0
  238. /three/{examples/jsm → src}/nodes/accessors/UserDataNode.d.ts +0 -0
  239. /three/{examples/jsm → src}/nodes/accessors/VertexColorNode.d.ts +0 -0
  240. /three/{examples/jsm → src}/nodes/code/CodeNode.d.ts +0 -0
  241. /three/{examples/jsm → src}/nodes/code/ExpressionNode.d.ts +0 -0
  242. /three/{examples/jsm → src}/nodes/code/FunctionCallNode.d.ts +0 -0
  243. /three/{examples/jsm → src}/nodes/code/FunctionNode.d.ts +0 -0
  244. /three/{examples/jsm → src}/nodes/core/AssignNode.d.ts +0 -0
  245. /three/{examples/jsm → src}/nodes/core/AttributeNode.d.ts +0 -0
  246. /three/{examples/jsm → src}/nodes/core/BypassNode.d.ts +0 -0
  247. /three/{examples/jsm → src}/nodes/core/ConstNode.d.ts +0 -0
  248. /three/{examples/jsm → src}/nodes/core/ContextNode.d.ts +0 -0
  249. /three/{examples/jsm → src}/nodes/core/InputNode.d.ts +0 -0
  250. /three/{examples/jsm → src}/nodes/core/NodeAttribute.d.ts +0 -0
  251. /three/{examples/jsm → src}/nodes/core/NodeCode.d.ts +0 -0
  252. /three/{examples/jsm → src}/nodes/core/NodeFunctionInput.d.ts +0 -0
  253. /three/{examples/jsm → src}/nodes/core/NodeKeywords.d.ts +0 -0
  254. /three/{examples/jsm → src}/nodes/core/NodeParser.d.ts +0 -0
  255. /three/{examples/jsm → src}/nodes/core/NodeVar.d.ts +0 -0
  256. /three/{examples/jsm → src}/nodes/core/NodeVarying.d.ts +0 -0
  257. /three/{examples/jsm → src}/nodes/core/OutputStructNode.d.ts +0 -0
  258. /three/{examples/jsm → src}/nodes/core/StackNode.d.ts +0 -0
  259. /three/{examples/jsm → src}/nodes/core/StructTypeNode.d.ts +0 -0
  260. /three/{examples/jsm → src}/nodes/core/TempNode.d.ts +0 -0
  261. /three/{examples/jsm → src}/nodes/core/UniformGroup.d.ts +0 -0
  262. /three/{examples/jsm → src}/nodes/core/UniformGroupNode.d.ts +0 -0
  263. /three/{examples/jsm → src}/nodes/core/VaryingNode.d.ts +0 -0
  264. /three/{examples/jsm → src}/nodes/core/constants.d.ts +0 -0
  265. /three/{examples/jsm → src}/nodes/display/AfterImageNode.d.ts +0 -0
  266. /three/{examples/jsm → src}/nodes/display/BlendModeNode.d.ts +0 -0
  267. /three/{examples/jsm → src}/nodes/display/FrontFacingNode.d.ts +0 -0
  268. /three/{examples/jsm → src}/nodes/display/PosterizeNode.d.ts +0 -0
  269. /three/{examples/jsm → src}/nodes/display/ViewportDepthTextureNode.d.ts +0 -0
  270. /three/{examples/jsm → src}/nodes/display/ViewportNode.d.ts +0 -0
  271. /three/{examples/jsm → src}/nodes/display/ViewportSharedTextureNode.d.ts +0 -0
  272. /three/{examples/jsm → src}/nodes/fog/FogExp2Node.d.ts +0 -0
  273. /three/{examples/jsm → src}/nodes/fog/FogNode.d.ts +0 -0
  274. /three/{examples/jsm → src}/nodes/fog/FogRangeNode.d.ts +0 -0
  275. /three/{examples/jsm → src}/nodes/functions/BSDF/BRDF_GGX.d.ts +0 -0
  276. /three/{examples/jsm → src}/nodes/functions/BSDF/BRDF_Lambert.d.ts +0 -0
  277. /three/{examples/jsm → src}/nodes/functions/BSDF/BRDF_Sheen.d.ts +0 -0
  278. /three/{examples/jsm → src}/nodes/functions/BSDF/DFGApprox.d.ts +0 -0
  279. /three/{examples/jsm → src}/nodes/functions/BSDF/D_GGX.d.ts +0 -0
  280. /three/{examples/jsm → src}/nodes/functions/BSDF/D_GGX_Anisotropic.d.ts +0 -0
  281. /three/{examples/jsm → src}/nodes/functions/BSDF/F_Schlick.d.ts +0 -0
  282. /three/{examples/jsm → src}/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts +0 -0
  283. /three/{examples/jsm → src}/nodes/functions/PhysicalLightingModel.d.ts +0 -0
  284. /three/{examples/jsm → src}/nodes/functions/ShadowMaskModel.d.ts +0 -0
  285. /three/{examples/jsm → src}/nodes/functions/ToonLightingModel.d.ts +0 -0
  286. /three/{examples/jsm → src}/nodes/functions/material/getGeometryRoughness.d.ts +0 -0
  287. /three/{examples/jsm → src}/nodes/functions/material/getRoughness.d.ts +0 -0
  288. /three/{examples/jsm → src}/nodes/gpgpu/ComputeNode.d.ts +0 -0
  289. /three/{examples/jsm → src}/nodes/lighting/AONode.d.ts +0 -0
  290. /three/{examples/jsm → src}/nodes/lighting/EnvironmentNode.d.ts +0 -0
  291. /three/{examples/jsm → src}/nodes/lighting/IrradianceNode.d.ts +0 -0
  292. /three/{examples/jsm → src}/nodes/lighting/LightUtils.d.ts +0 -0
  293. /three/{examples/jsm → src}/nodes/lighting/LightingContextNode.d.ts +0 -0
  294. /three/{examples/jsm → src}/nodes/materials/VolumeNodeMaterial.d.ts +0 -0
  295. /three/{examples/jsm → src}/nodes/materialx/MaterialXNodes.d.ts +0 -0
  296. /three/{examples/jsm → src}/nodes/materialx/lib/mx_transform_color.d.ts +0 -0
  297. /three/{examples/jsm → src}/nodes/math/CondNode.d.ts +0 -0
  298. /three/{examples/jsm → src}/nodes/math/HashNode.d.ts +0 -0
  299. /three/{examples/jsm → src}/nodes/math/MathUtils.d.ts +0 -0
  300. /three/{examples/jsm → src}/nodes/math/OperatorNode.d.ts +0 -0
  301. /three/{examples/jsm → src}/nodes/math/TriNoise3D.d.ts +0 -0
  302. /three/{examples/jsm → src}/nodes/procedural/CheckerNode.d.ts +0 -0
  303. /three/{examples/jsm → src}/nodes/shadernode/ShaderNode.d.ts +0 -0
  304. /three/{examples/jsm → src}/nodes/utils/ArrayElementNode.d.ts +0 -0
  305. /three/{examples/jsm → src}/nodes/utils/ConvertNode.d.ts +0 -0
  306. /three/{examples/jsm → src}/nodes/utils/EquirectUVNode.d.ts +0 -0
  307. /three/{examples/jsm → src}/nodes/utils/JoinNode.d.ts +0 -0
  308. /three/{examples/jsm → src}/nodes/utils/MatcapUVNode.d.ts +0 -0
  309. /three/{examples/jsm → src}/nodes/utils/OscNode.d.ts +0 -0
  310. /three/{examples/jsm → src}/nodes/utils/RemapNode.d.ts +0 -0
  311. /three/{examples/jsm → src}/nodes/utils/RotateNode.d.ts +0 -0
  312. /three/{examples/jsm → src}/nodes/utils/RotateUVNode.d.ts +0 -0
  313. /three/{examples/jsm → src}/nodes/utils/SplitNode.d.ts +0 -0
  314. /three/{examples/jsm → src}/nodes/utils/SpriteSheetUVNode.d.ts +0 -0
  315. /three/{examples/jsm → src}/nodes/utils/StoargeArrayElementNode.d.ts +0 -0
  316. /three/{examples/jsm → src}/nodes/utils/TimerNode.d.ts +0 -0
  317. /three/{examples/jsm → src}/nodes/utils/TriplanarTexturesNode.d.ts +0 -0
  318. /three/{examples/jsm → src}/renderers/common/Binding.d.ts +0 -0
  319. /three/{examples/jsm → src}/renderers/common/Buffer.d.ts +0 -0
  320. /three/{examples/jsm → src}/renderers/common/BufferUtils.d.ts +0 -0
  321. /three/{examples/jsm → src}/renderers/common/ChainMap.d.ts +0 -0
  322. /three/{examples/jsm → src}/renderers/common/ComputePipeline.d.ts +0 -0
  323. /three/{examples/jsm → src}/renderers/common/Constants.d.ts +0 -0
  324. /three/{examples/jsm → src}/renderers/common/DataMap.d.ts +0 -0
  325. /three/{examples/jsm → src}/renderers/common/Pipeline.d.ts +0 -0
  326. /three/{examples/jsm → src}/renderers/common/Pipelines.d.ts +0 -0
  327. /three/{examples/jsm → src}/renderers/common/ProgrammableStage.d.ts +0 -0
  328. /three/{examples/jsm → src}/renderers/common/RenderPipeline.d.ts +0 -0
  329. /three/{examples/jsm → src}/renderers/common/UniformBuffer.d.ts +0 -0
  330. /three/{examples/jsm → src}/renderers/webgpu/WebGPURenderer.d.ts +0 -0
@@ -0,0 +1,125 @@
1
+ import CodeNode from "../../../nodes/code/CodeNode.js";
2
+ import { NodeShaderStage } from "../../../nodes/core/constants.js";
3
+ import NodeBuilder from "../../../nodes/core/NodeBuilder.js";
4
+ import NodeUniform from "../../../nodes/core/NodeUniform.js";
5
+ import NodeVar from "../../../nodes/core/NodeVar.js";
6
+ import StructTypeNode from "../../../nodes/core/StructTypeNode.js";
7
+ import { ShaderNode } from "../../../nodes/shadernode/ShaderNode.js";
8
+ import { Texture } from "../../../textures/Texture.js";
9
+ import NodeUniformsGroup from "../../common/nodes/NodeUniformsGroup.js";
10
+
11
+ type BuiltinStage = NodeShaderStage | "attribute" | "output";
12
+ interface BuiltinType {
13
+ name: string;
14
+ property: string;
15
+ type: string;
16
+ }
17
+
18
+ export default class WGSLNodeBuilder extends NodeBuilder {
19
+ builtins: { [key in BuiltinStage]: Map<string, BuiltinType> };
20
+ uniformGroups: { [key in NodeShaderStage]: NodeUniformsGroup };
21
+
22
+ needsColorSpaceToLinear(texture: Texture): boolean;
23
+ _generateTextureSample(
24
+ texture: Texture,
25
+ textureProperty: string,
26
+ uvSnippet: string,
27
+ depthSnippet: string | null,
28
+ shaderStage: NodeShaderStage,
29
+ ): string;
30
+ _generateVideoSample(textureProperty: string, uvSnippet: string, shaderStage: NodeShaderStage): string;
31
+ _generateTextureSampleLevel(
32
+ texture: Texture,
33
+ textureProperty: string,
34
+ uvSnippet: string,
35
+ levelSnippet: string,
36
+ depthSnippet: string | null,
37
+ shaderStage: NodeShaderStage,
38
+ ): string;
39
+ generateTextureLod(texture: Texture, textureProperty: string, uvSnippet: string, levelSnippet: string): string;
40
+ generateTextureLoad(
41
+ texture: Texture,
42
+ textureProperty: string,
43
+ uvIndexSnippet: string,
44
+ depthSnippet: string | null,
45
+ shaderStage: NodeShaderStage,
46
+ ): string;
47
+ generateTextureStore(
48
+ texture: Texture,
49
+ textureProperty: string,
50
+ uvIndexSnippet: string,
51
+ valueSnippet: string,
52
+ ): string;
53
+ isUnfilterable(texture: Texture): boolean;
54
+ generateTexture(
55
+ texture: Texture,
56
+ textureProperty: string,
57
+ uvSnippet: string,
58
+ depthSnippet: string | null,
59
+ shaderStage: NodeShaderStage,
60
+ ): string;
61
+ generateTextureGrad(
62
+ texture: Texture,
63
+ textureProperty: string,
64
+ uvSnippet: string,
65
+ gradSnippet: string[],
66
+ depthSnippet: string | null,
67
+ shaderStage: NodeShaderStage,
68
+ ): string;
69
+ generateTextureCompare(
70
+ texture: Texture,
71
+ textureProperty: string,
72
+ uvSnippet: string,
73
+ compareSnippet: String,
74
+ shaderStage: NodeShaderStage,
75
+ ): string;
76
+ generateTextureLevel(
77
+ texture: Texture,
78
+ textureProperty: string,
79
+ uvSnippet: string,
80
+ levelSnippet: string,
81
+ depthSnippet: string | null,
82
+ shaderStage: NodeShaderStage,
83
+ ): string;
84
+
85
+ getPropertyName<TValue>(node: NodeVar | NodeUniform<TValue>, shaderStage: NodeShaderStage): string;
86
+
87
+ getOutputStructName(): string;
88
+
89
+ _getUniformGroupCount(shaderStage: NodeShaderStage): number;
90
+
91
+ getFunctionOperator(op: string): string | null;
92
+ // getStorageAccess(node: StorageTextureNode | StorageBufferNode): string;
93
+
94
+ getBuiltin(name: string, property: string, type: string, shaderStage: BuiltinStage): string;
95
+ getVertexIndex(): string;
96
+ getInstanceIndex(): string;
97
+ getDrawIndex(): null;
98
+
99
+ buildFunctionCode(shaderNode: ShaderNode): string;
100
+
101
+ getFragDepth(): string;
102
+ getFragCoord(): string;
103
+ getFrontFacing(): string;
104
+
105
+ getBuiltins(shaderStage: BuiltinStage): string;
106
+ getAttributes(shaderStage: NodeShaderStage): string;
107
+
108
+ getStructMembers(struct: StructTypeNode): string;
109
+ getStructs(shaderStage: NodeShaderStage): string;
110
+
111
+ getVar(type: string, name: string): string;
112
+ getVars(shaderStage: NodeShaderStage): string;
113
+ getVaryings(shaderStage: NodeShaderStage): string;
114
+ getUniforms(shaderStage: NodeShaderStage): string;
115
+ buildCode(): void;
116
+ getMethod(method: string, output?: string | null): string;
117
+
118
+ _getWGSLMethod(method: string): CodeNode | string;
119
+ _include(name: string): CodeNode;
120
+ _getWGSLVertexCode(shaderData: { [key: string]: string }): string;
121
+ _getWGSLFragmentCode(shaderData: { [key: string]: string }): string;
122
+ _getWGSLComputeCode(shaderData: { [key: string]: string }, workgroupSize: string): string;
123
+ _getWGSLStruct(name: string, vars: string): string;
124
+ _getWGSLStructBinding(name: string, vars: string, access: string, binding: number, group: number): string;
125
+ }
@@ -0,0 +1,6 @@
1
+ import NodeFunction from "../../../nodes/core/NodeFunction.js";
2
+
3
+ export default class WGSLNodeFunction extends NodeFunction {
4
+ constructor(source: string);
5
+ getCode(name?: string): string;
6
+ }
@@ -0,0 +1,6 @@
1
+ import NodeParser from "../../../nodes/core/NodeParser.js";
2
+ import WGSLNodeFunction from "./WGSLNodeFunction.js";
3
+
4
+ export default class WGSLNodeParser extends NodeParser {
5
+ parseFunction(source: string): WGSLNodeFunction;
6
+ }
@@ -0,0 +1,328 @@
1
+ export enum GPUPrimitiveTopology {
2
+ PointList = "point-list",
3
+ LineList = "line-list",
4
+ LineStrip = "line-strip",
5
+ TriangleList = "triangle-list",
6
+ TriangleStrip = "triangle-strip",
7
+ }
8
+
9
+ export enum GPUCompareFunction {
10
+ Never = "never",
11
+ Less = "less",
12
+ Equal = "equal",
13
+ LessEqual = "less-equal",
14
+ Greater = "greater",
15
+ NotEqual = "not-equal",
16
+ GreaterEqual = "greater-equal",
17
+ Always = "always",
18
+ }
19
+
20
+ export enum GPUStoreOp {
21
+ Store = "store",
22
+ Discard = "discard",
23
+ }
24
+
25
+ export enum GPULoadOp {
26
+ Load = "load",
27
+ Clear = "clear",
28
+ }
29
+
30
+ export enum GPUFrontFace {
31
+ CCW = "ccw",
32
+ CW = "cw",
33
+ }
34
+
35
+ export enum GPUCullMode {
36
+ None = "none",
37
+ Front = "front",
38
+ Back = "back",
39
+ }
40
+
41
+ export enum GPUIndexFormat {
42
+ Uint16 = "uint16",
43
+ Uint32 = "uint32",
44
+ }
45
+
46
+ export enum GPUVertexFormat {
47
+ Uint8x2 = "uint8x2",
48
+ Uint8x4 = "uint8x4",
49
+ Sint8x2 = "sint8x2",
50
+ Sint8x4 = "sint8x4",
51
+ Unorm8x2 = "unorm8x2",
52
+ Unorm8x4 = "unorm8x4",
53
+ Snorm8x2 = "snorm8x2",
54
+ Snorm8x4 = "snorm8x4",
55
+ Uint16x2 = "uint16x2",
56
+ Uint16x4 = "uint16x4",
57
+ Sint16x2 = "sint16x2",
58
+ Sint16x4 = "sint16x4",
59
+ Unorm16x2 = "unorm16x2",
60
+ Unorm16x4 = "unorm16x4",
61
+ Snorm16x2 = "snorm16x2",
62
+ Snorm16x4 = "snorm16x4",
63
+ Float16x2 = "float16x2",
64
+ Float16x4 = "float16x4",
65
+ Float32 = "float32",
66
+ Float32x2 = "float32x2",
67
+ Float32x3 = "float32x3",
68
+ Float32x4 = "float32x4",
69
+ Uint32 = "uint32",
70
+ Uint32x2 = "uint32x2",
71
+ Uint32x3 = "uint32x3",
72
+ Uint32x4 = "uint32x4",
73
+ Sint32 = "sint32",
74
+ Sint32x2 = "sint32x2",
75
+ Sint32x3 = "sint32x3",
76
+ Sint32x4 = "sint32x4",
77
+ }
78
+
79
+ export enum GPUTextureFormat {
80
+ // 8-bit formats
81
+
82
+ R8Unorm = "r8unorm",
83
+ R8Snorm = "r8snorm",
84
+ R8Uint = "r8uint",
85
+ R8Sint = "r8sint",
86
+
87
+ // 16-bit formats
88
+
89
+ R16Uint = "r16uint",
90
+ R16Sint = "r16sint",
91
+ R16Float = "r16float",
92
+ RG8Unorm = "rg8unorm",
93
+ RG8Snorm = "rg8snorm",
94
+ RG8Uint = "rg8uint",
95
+ RG8Sint = "rg8sint",
96
+
97
+ // 32-bit formats
98
+
99
+ R32Uint = "r32uint",
100
+ R32Sint = "r32sint",
101
+ R32Float = "r32float",
102
+ RG16Uint = "rg16uint",
103
+ RG16Sint = "rg16sint",
104
+ RG16Float = "rg16float",
105
+ RGBA8Unorm = "rgba8unorm",
106
+ RGBA8UnormSRGB = "rgba8unorm-srgb",
107
+ RGBA8Snorm = "rgba8snorm",
108
+ RGBA8Uint = "rgba8uint",
109
+ RGBA8Sint = "rgba8sint",
110
+ BGRA8Unorm = "bgra8unorm",
111
+ BGRA8UnormSRGB = "bgra8unorm-srgb",
112
+ // Packed 32-bit formats
113
+ RGB9E5UFloat = "rgb9e5ufloat",
114
+ RGB10A2Unorm = "rgb10a2unorm",
115
+ RG11B10uFloat = "rgb10a2unorm",
116
+
117
+ // 64-bit formats
118
+
119
+ RG32Uint = "rg32uint",
120
+ RG32Sint = "rg32sint",
121
+ RG32Float = "rg32float",
122
+ RGBA16Uint = "rgba16uint",
123
+ RGBA16Sint = "rgba16sint",
124
+ RGBA16Float = "rgba16float",
125
+
126
+ // 128-bit formats
127
+
128
+ RGBA32Uint = "rgba32uint",
129
+ RGBA32Sint = "rgba32sint",
130
+ RGBA32Float = "rgba32float",
131
+
132
+ // Depth and stencil formats
133
+
134
+ Stencil8 = "stencil8",
135
+ Depth16Unorm = "depth16unorm",
136
+ Depth24Plus = "depth24plus",
137
+ Depth24PlusStencil8 = "depth24plus-stencil8",
138
+ Depth32Float = "depth32float",
139
+
140
+ // 'depth32float-stencil8' extension
141
+
142
+ Depth32FloatStencil8 = "depth32float-stencil8",
143
+
144
+ // BC compressed formats usable if 'texture-compression-bc' is both
145
+ // supported by the device/user agent and enabled in requestDevice.
146
+
147
+ BC1RGBAUnorm = "bc1-rgba-unorm",
148
+ BC1RGBAUnormSRGB = "bc1-rgba-unorm-srgb",
149
+ BC2RGBAUnorm = "bc2-rgba-unorm",
150
+ BC2RGBAUnormSRGB = "bc2-rgba-unorm-srgb",
151
+ BC3RGBAUnorm = "bc3-rgba-unorm",
152
+ BC3RGBAUnormSRGB = "bc3-rgba-unorm-srgb",
153
+ BC4RUnorm = "bc4-r-unorm",
154
+ BC4RSnorm = "bc4-r-snorm",
155
+ BC5RGUnorm = "bc5-rg-unorm",
156
+ BC5RGSnorm = "bc5-rg-snorm",
157
+ BC6HRGBUFloat = "bc6h-rgb-ufloat",
158
+ BC6HRGBFloat = "bc6h-rgb-float",
159
+ BC7RGBAUnorm = "bc7-rgba-unorm",
160
+ BC7RGBAUnormSRGB = "bc7-rgba-srgb",
161
+
162
+ // ETC2 compressed formats usable if 'texture-compression-etc2' is both
163
+ // supported by the device/user agent and enabled in requestDevice.
164
+
165
+ ETC2RGB8Unorm = "etc2-rgb8unorm",
166
+ ETC2RGB8UnormSRGB = "etc2-rgb8unorm-srgb",
167
+ ETC2RGB8A1Unorm = "etc2-rgb8a1unorm",
168
+ ETC2RGB8A1UnormSRGB = "etc2-rgb8a1unorm-srgb",
169
+ ETC2RGBA8Unorm = "etc2-rgba8unorm",
170
+ ETC2RGBA8UnormSRGB = "etc2-rgba8unorm-srgb",
171
+ EACR11Unorm = "eac-r11unorm",
172
+ EACR11Snorm = "eac-r11snorm",
173
+ EACRG11Unorm = "eac-rg11unorm",
174
+ EACRG11Snorm = "eac-rg11snorm",
175
+
176
+ // ASTC compressed formats usable if 'texture-compression-astc' is both
177
+ // supported by the device/user agent and enabled in requestDevice.
178
+
179
+ ASTC4x4Unorm = "astc-4x4-unorm",
180
+ ASTC4x4UnormSRGB = "astc-4x4-unorm-srgb",
181
+ ASTC5x4Unorm = "astc-5x4-unorm",
182
+ ASTC5x4UnormSRGB = "astc-5x4-unorm-srgb",
183
+ ASTC5x5Unorm = "astc-5x5-unorm",
184
+ ASTC5x5UnormSRGB = "astc-5x5-unorm-srgb",
185
+ ASTC6x5Unorm = "astc-6x5-unorm",
186
+ ASTC6x5UnormSRGB = "astc-6x5-unorm-srgb",
187
+ ASTC6x6Unorm = "astc-6x6-unorm",
188
+ ASTC6x6UnormSRGB = "astc-6x6-unorm-srgb",
189
+ ASTC8x5Unorm = "astc-8x5-unorm",
190
+ ASTC8x5UnormSRGB = "astc-8x5-unorm-srgb",
191
+ ASTC8x6Unorm = "astc-8x6-unorm",
192
+ ASTC8x6UnormSRGB = "astc-8x6-unorm-srgb",
193
+ ASTC8x8Unorm = "astc-8x8-unorm",
194
+ ASTC8x8UnormSRGB = "astc-8x8-unorm-srgb",
195
+ ASTC10x5Unorm = "astc-10x5-unorm",
196
+ ASTC10x5UnormSRGB = "astc-10x5-unorm-srgb",
197
+ ASTC10x6Unorm = "astc-10x6-unorm",
198
+ ASTC10x6UnormSRGB = "astc-10x6-unorm-srgb",
199
+ ASTC10x8Unorm = "astc-10x8-unorm",
200
+ ASTC10x8UnormSRGB = "astc-10x8-unorm-srgb",
201
+ ASTC10x10Unorm = "astc-10x10-unorm",
202
+ ASTC10x10UnormSRGB = "astc-10x10-unorm-srgb",
203
+ ASTC12x10Unorm = "astc-12x10-unorm",
204
+ ASTC12x10UnormSRGB = "astc-12x10-unorm-srgb",
205
+ ASTC12x12Unorm = "astc-12x12-unorm",
206
+ ASTC12x12UnormSRGB = "astc-12x12-unorm-srgb",
207
+ }
208
+
209
+ export enum GPUAddressMode {
210
+ ClampToEdge = "clamp-to-edge",
211
+ Repeat = "repeat",
212
+ MirrorRepeat = "mirror-repeat",
213
+ }
214
+
215
+ export enum GPUFilterMode {
216
+ Linear = "linear",
217
+ Nearest = "nearest",
218
+ }
219
+
220
+ export enum GPUBlendFactor {
221
+ Zero = "zero",
222
+ One = "one",
223
+ Src = "src",
224
+ OneMinusSrc = "one-minus-src",
225
+ SrcAlpha = "src-alpha",
226
+ OneMinusSrcAlpha = "one-minus-src-alpha",
227
+ Dst = "dst",
228
+ OneMinusDstColor = "one-minus-dst",
229
+ DstAlpha = "dst-alpha",
230
+ OneMinusDstAlpha = "one-minus-dst-alpha",
231
+ SrcAlphaSaturated = "src-alpha-saturated",
232
+ Constant = "constant",
233
+ OneMinusConstant = "one-minus-constant",
234
+ }
235
+
236
+ export enum GPUBlendOperation {
237
+ Add = "add",
238
+ Subtract = "subtract",
239
+ ReverseSubtract = "reverse-subtract",
240
+ Min = "min",
241
+ Max = "max",
242
+ }
243
+
244
+ export enum GPUColorWriteFlags {
245
+ None = 0,
246
+ Red = 0x1,
247
+ Green = 0x2,
248
+ Blue = 0x4,
249
+ Alpha = 0x8,
250
+ All = 0xF,
251
+ }
252
+
253
+ export enum GPUStencilOperation {
254
+ Keep = "keep",
255
+ Zero = "zero",
256
+ Replace = "replace",
257
+ Invert = "invert",
258
+ IncrementClamp = "increment-clamp",
259
+ DecrementClamp = "decrement-clamp",
260
+ IncrementWrap = "increment-wrap",
261
+ DecrementWrap = "decrement-wrap",
262
+ }
263
+
264
+ export enum GPUBufferBindingType {
265
+ Uniform = "uniform",
266
+ Storage = "storage",
267
+ ReadOnlyStorage = "read-only-storage",
268
+ }
269
+
270
+ export enum GPUStorageTextureAccess {
271
+ WriteOnly = "write-only",
272
+ ReadOnly = "read-only",
273
+ ReadWrite = "read-write",
274
+ }
275
+
276
+ export enum GPUSamplerBindingType {
277
+ Filtering = "filtering",
278
+ NonFiltering = "non-filtering",
279
+ Comparison = "comparison",
280
+ }
281
+
282
+ export enum GPUTextureSampleType {
283
+ Float = "float",
284
+ UnfilterableFloat = "unfilterable-float",
285
+ Depth = "depth",
286
+ SInt = "sint",
287
+ UInt = "uint",
288
+ }
289
+
290
+ export enum GPUTextureDimension {
291
+ OneD = "1d",
292
+ TwoD = "2d",
293
+ ThreeD = "3d",
294
+ }
295
+
296
+ export enum GPUTextureViewDimension {
297
+ OneD = "1d",
298
+ TwoD = "2d",
299
+ TwoDArray = "2d-array",
300
+ Cube = "cube",
301
+ CubeArray = "cube-array",
302
+ ThreeD = "3d",
303
+ }
304
+
305
+ export enum GPUTextureAspect {
306
+ All = "all",
307
+ StencilOnly = "stencil-only",
308
+ DepthOnly = "depth-only",
309
+ }
310
+
311
+ export enum GPUInputStepMode {
312
+ Vertex = "vertex",
313
+ Instance = "instance",
314
+ }
315
+
316
+ export enum GPUFeatureName {
317
+ DepthClipControl = "depth-clip-control",
318
+ Depth32FloatStencil8 = "depth32float-stencil8",
319
+ TextureCompressionBC = "texture-compression-bc",
320
+ TextureCompressionETC2 = "texture-compression-etc2",
321
+ TextureCompressionASTC = "texture-compression-astc",
322
+ TimestampQuery = "timestamp-query",
323
+ IndirectFirstInstance = "indirect-first-instance",
324
+ ShaderF16 = "shader-f16",
325
+ RG11B10UFloat = "rg11b10ufloat-renderable",
326
+ BGRA8UNormStorage = "bgra8unorm-storage",
327
+ Float32Filterable = "float32-filterable",
328
+ }
@@ -24,4 +24,6 @@ export class WebXRDepthSensing {
24
24
  getMesh(cameraXR: WebXRArrayCamera): Mesh | null;
25
25
 
26
26
  reset(): void;
27
+
28
+ getDepthTexture(): Texture | null;
27
29
  }
@@ -6,6 +6,8 @@ import { ArrayCamera } from "../../cameras/ArrayCamera.js";
6
6
  import { PerspectiveCamera } from "../../cameras/PerspectiveCamera.js";
7
7
  import { EventDispatcher } from "../../core/EventDispatcher.js";
8
8
  import { Vector4 } from "../../math/Vector4.js";
9
+ import { Mesh } from "../../objects/Mesh.js";
10
+ import { Texture } from "../../textures/Texture.js";
9
11
  import { WebGLRenderer } from "../WebGLRenderer.js";
10
12
  import { XRGripSpace, XRHandSpace, XRTargetRaySpace } from "./WebXRController.js";
11
13
 
@@ -22,7 +24,10 @@ export interface WebXRManagerEventMap {
22
24
  }
23
25
 
24
26
  export class WebXRManager extends EventDispatcher<WebXRManagerEventMap> {
25
- constructor(renderer: WebGLRenderer, gl: WebGLRenderingContext);
27
+ /**
28
+ * @default true
29
+ */
30
+ cameraAutoUpdate: boolean;
26
31
 
27
32
  /**
28
33
  * @default false
@@ -34,44 +39,49 @@ export class WebXRManager extends EventDispatcher<WebXRManagerEventMap> {
34
39
  */
35
40
  isPresenting: boolean;
36
41
 
37
- /**
38
- * @default true
39
- */
40
- cameraAutoUpdate: boolean;
42
+ constructor(renderer: WebGLRenderer, gl: WebGLRenderingContext);
43
+
44
+ getController: (index: number) => XRTargetRaySpace;
45
+
46
+ getControllerGrip: (index: number) => XRGripSpace;
47
+
48
+ getHand: (index: number) => XRHandSpace;
49
+
50
+ setFramebufferScaleFactor: (value: number) => void;
41
51
 
42
- getController(index: number): XRTargetRaySpace;
52
+ setReferenceSpaceType: (value: XRReferenceSpaceType) => void;
43
53
 
44
- getControllerGrip(index: number): XRGripSpace;
54
+ getReferenceSpace: () => XRReferenceSpace | null;
45
55
 
46
- getHand(index: number): XRHandSpace;
56
+ setReferenceSpace: (value: XRReferenceSpace) => void;
47
57
 
48
- setFramebufferScaleFactor(value: number): void;
58
+ getBaseLayer: () => XRWebGLLayer | XRProjectionLayer;
49
59
 
50
- setReferenceSpaceType(value: XRReferenceSpaceType): void;
60
+ getBinding: () => XRWebGLBinding;
51
61
 
52
- getReferenceSpace(): XRReferenceSpace | null;
62
+ getFrame: () => XRFrame;
53
63
 
54
- setReferenceSpace(value: XRReferenceSpace): void;
64
+ getSession: () => XRSession | null;
55
65
 
56
- getBaseLayer(): XRWebGLLayer | XRProjectionLayer;
66
+ setSession: (value: XRSession | null) => Promise<void>;
57
67
 
58
- getBinding(): XRWebGLBinding;
68
+ getEnvironmentBlendMode: () => XREnvironmentBlendMode | undefined;
59
69
 
60
- getFrame(): XRFrame;
70
+ getDepthTexture: () => Texture | null;
61
71
 
62
- getSession(): XRSession | null;
72
+ updateCamera: (camera: PerspectiveCamera) => void;
63
73
 
64
- setSession(value: XRSession | null): Promise<void>;
74
+ getCamera: () => WebXRArrayCamera;
65
75
 
66
- getCamera(): WebXRArrayCamera;
76
+ getFoveation: () => number | undefined;
67
77
 
68
- updateCamera(camera: PerspectiveCamera): void;
78
+ setFoveation: (value: number) => void;
69
79
 
70
- setAnimationLoop(callback: XRFrameRequestCallback | null): void;
80
+ hasDepthSensing: () => boolean;
71
81
 
72
- getFoveation(): number | undefined;
82
+ getDepthSensingMesh: () => Mesh | null;
73
83
 
74
- setFoveation(value: number): void;
84
+ setAnimationLoop: (callback: XRFrameRequestCallback | null) => void;
75
85
 
76
- dispose(): void;
86
+ dispose: () => void;
77
87
  }
three/src/scenes/Fog.d.ts CHANGED
@@ -1,28 +1,11 @@
1
1
  import { Color, ColorRepresentation } from "../math/Color.js";
2
2
 
3
- export interface FogBase {
4
- /**
5
- * Optional name of the `Fog` object
6
- * @remarks _(doesn't need to be unique)_.
7
- * @defaultValue `""`
8
- */
3
+ export interface FogJSON {
4
+ type: string;
9
5
  name: string;
10
-
11
- /**
12
- * Fog color.
13
- * @remarks If set to black, far away objects will be rendered black.
14
- */
15
- color: Color;
16
-
17
- /**
18
- * Returns a new Fog instance with the same parameters as this one.
19
- */
20
- clone(): FogBase;
21
-
22
- /**
23
- * Return Fog data in JSON format.
24
- */
25
- toJSON(): any;
6
+ color: number;
7
+ near: number;
8
+ far: number;
26
9
  }
27
10
 
28
11
  /**
@@ -35,7 +18,7 @@ export interface FogBase {
35
18
  * @see {@link https://threejs.org/docs/index.html#api/en/scenes/Fog | Official Documentation}
36
19
  * @see {@link https://github.com/mrdoob/three.js/blob/master/src/scenes/Fog.js | Source}
37
20
  */
38
- export class Fog implements FogBase {
21
+ export class Fog {
39
22
  /**
40
23
  * The color parameter is passed to the {@link THREE.Color | Color} constructor to set the color property
41
24
  * @remarks
@@ -90,5 +73,5 @@ export class Fog implements FogBase {
90
73
  /**
91
74
  * Return {@link Fog} data in JSON format.
92
75
  */
93
- toJSON(): any;
76
+ toJSON(): FogJSON;
94
77
  }
@@ -1,5 +1,11 @@
1
1
  import { Color, ColorRepresentation } from "../math/Color.js";
2
- import { FogBase } from "./Fog.js";
2
+
3
+ export interface FogExp2JSON {
4
+ type: string;
5
+ name: string;
6
+ color: number;
7
+ density: number;
8
+ }
3
9
 
4
10
  /**
5
11
  * This class contains the parameters that define exponential squared fog, which gives a clear view near the camera and a faster than exponentially densening fog farther from the camera.
@@ -12,7 +18,7 @@ import { FogBase } from "./Fog.js";
12
18
  * @see {@link https://threejs.org/docs/index.html#api/en/scenes/FogExp2 | Official Documentation}
13
19
  * @see {@link https://github.com/mrdoob/three.js/blob/master/src/scenes/FogExp2.js | Source}
14
20
  */
15
- export class FogExp2 implements FogBase {
21
+ export class FogExp2 {
16
22
  /**
17
23
  * The color parameter is passed to the {@link THREE.Color | Color} constructor to set the color property
18
24
  * @remarks Color can be a hexadecimal integer or a CSS-style string.
@@ -56,5 +62,5 @@ export class FogExp2 implements FogBase {
56
62
  /**
57
63
  * Return {@link FogExp2} data in JSON format.
58
64
  */
59
- toJSON(): any;
65
+ toJSON(): FogExp2JSON;
60
66
  }
@@ -1,10 +1,26 @@
1
- import { Object3D } from "../core/Object3D.js";
1
+ import { JSONMeta, Object3D, Object3DJSON, Object3DJSONObject } from "../core/Object3D.js";
2
2
  import { Material } from "../materials/Material.js";
3
3
  import { Color } from "../math/Color.js";
4
- import { Euler } from "../math/Euler.js";
4
+ import { Euler, EulerTuple } from "../math/Euler.js";
5
5
  import { CubeTexture } from "../textures/CubeTexture.js";
6
6
  import { Texture } from "../textures/Texture.js";
7
- import { FogBase } from "./Fog.js";
7
+ import { Fog, FogJSON } from "./Fog.js";
8
+ import { FogExp2, FogExp2JSON } from "./FogExp2.js";
9
+
10
+ export interface SceneJSONObject extends Object3DJSONObject {
11
+ fog?: FogJSON | FogExp2JSON;
12
+
13
+ backgroundBlurriness?: number;
14
+ backgroundIntensity?: number;
15
+ backgroundRotation: EulerTuple;
16
+
17
+ environmentIntensity?: number;
18
+ environmentRotation: EulerTuple;
19
+ }
20
+
21
+ export interface SceneJSON extends Object3DJSON {
22
+ object: SceneJSONObject;
23
+ }
8
24
 
9
25
  /**
10
26
  * Scenes allow you to set up what and where is to be rendered by three.js
@@ -37,7 +53,7 @@ export class Scene extends Object3D {
37
53
  * A {@link Fog | fog} instance defining the type of fog that affects everything rendered in the scene.
38
54
  * @defaultValue `null`
39
55
  */
40
- fog: FogBase | null;
56
+ fog: Fog | FogExp2 | null;
41
57
 
42
58
  /**
43
59
  * Sets the blurriness of the background. Only influences environment maps assigned to {@link THREE.Scene.background | Scene.background}.
@@ -98,5 +114,5 @@ export class Scene extends Object3D {
98
114
  * Convert the {@link Scene} to three.js {@link https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 | JSON Object/Scene format}.
99
115
  * @param meta Object containing metadata such as textures or images for the scene.
100
116
  */
101
- toJSON(meta?: any): any;
117
+ toJSON(meta?: JSONMeta): SceneJSON;
102
118
  }