@onerjs/core 8.53.4 → 8.53.6

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 (841) hide show
  1. package/Animations/animationGroup.d.ts +0 -1
  2. package/Animations/animationGroup.js +0 -1
  3. package/Animations/animationGroup.js.map +1 -1
  4. package/Animations/animationGroup.pure.js +2 -0
  5. package/Animations/animationGroup.pure.js.map +1 -1
  6. package/Animations/runtimeAnimation.js +11 -0
  7. package/Animations/runtimeAnimation.js.map +1 -1
  8. package/Audio/audioSceneComponent.pure.js +1 -1
  9. package/AudioV2/abstractAudio/abstractSound.d.ts +2 -1
  10. package/AudioV2/abstractAudio/abstractSound.js +7 -2
  11. package/AudioV2/abstractAudio/abstractSound.js.map +1 -1
  12. package/AudioV2/abstractAudio/abstractSoundInstance.d.ts +3 -1
  13. package/AudioV2/abstractAudio/abstractSoundInstance.js.map +1 -1
  14. package/AudioV2/abstractAudio/staticSound.d.ts +6 -0
  15. package/AudioV2/abstractAudio/staticSound.js +17 -1
  16. package/AudioV2/abstractAudio/staticSound.js.map +1 -1
  17. package/AudioV2/abstractAudio/staticSoundInstance.d.ts +4 -2
  18. package/AudioV2/abstractAudio/staticSoundInstance.js.map +1 -1
  19. package/AudioV2/abstractAudio/streamingSound.d.ts +6 -0
  20. package/AudioV2/abstractAudio/streamingSound.js +9 -1
  21. package/AudioV2/abstractAudio/streamingSound.js.map +1 -1
  22. package/AudioV2/webAudio/webAudioStaticSound.d.ts +7 -1
  23. package/AudioV2/webAudio/webAudioStaticSound.js +56 -8
  24. package/AudioV2/webAudio/webAudioStaticSound.js.map +1 -1
  25. package/AudioV2/webAudio/webAudioStreamingSound.d.ts +3 -1
  26. package/AudioV2/webAudio/webAudioStreamingSound.js +16 -4
  27. package/AudioV2/webAudio/webAudioStreamingSound.js.map +1 -1
  28. package/BakedVertexAnimation/bakedVertexAnimationManager.d.ts +2 -2
  29. package/BakedVertexAnimation/bakedVertexAnimationManager.js +151 -121
  30. package/BakedVertexAnimation/bakedVertexAnimationManager.js.map +1 -1
  31. package/Behaviors/Cameras/interpolatingBehavior.d.ts +17 -2
  32. package/Behaviors/Cameras/interpolatingBehavior.js +53 -23
  33. package/Behaviors/Cameras/interpolatingBehavior.js.map +1 -1
  34. package/Bones/bone.pure.js +3 -3
  35. package/Buffers/buffer.pure.js +0 -12
  36. package/Buffers/buffer.pure.js.map +1 -1
  37. package/Cameras/Inputs/BaseCameraMouseWheelInput.js +141 -126
  38. package/Cameras/Inputs/BaseCameraMouseWheelInput.js.map +1 -1
  39. package/Cameras/Inputs/BaseCameraPointersInput.d.ts +2 -1
  40. package/Cameras/Inputs/BaseCameraPointersInput.js +290 -277
  41. package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
  42. package/Cameras/Inputs/arcRotateCameraGamepadInput.js +115 -102
  43. package/Cameras/Inputs/arcRotateCameraGamepadInput.js.map +1 -1
  44. package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.d.ts +3 -0
  45. package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js +334 -273
  46. package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js.map +1 -1
  47. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +273 -258
  48. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
  49. package/Cameras/Inputs/arcRotateCameraPointersInput.js +237 -213
  50. package/Cameras/Inputs/arcRotateCameraPointersInput.js.map +1 -1
  51. package/Cameras/Inputs/flyCameraKeyboardInput.js +199 -168
  52. package/Cameras/Inputs/flyCameraKeyboardInput.js.map +1 -1
  53. package/Cameras/Inputs/flyCameraMouseInput.js +243 -229
  54. package/Cameras/Inputs/flyCameraMouseInput.js.map +1 -1
  55. package/Cameras/Inputs/followCameraKeyboardMoveInput.js +311 -266
  56. package/Cameras/Inputs/followCameraKeyboardMoveInput.js.map +1 -1
  57. package/Cameras/Inputs/followCameraMouseWheelInput.js +139 -119
  58. package/Cameras/Inputs/followCameraMouseWheelInput.js.map +1 -1
  59. package/Cameras/Inputs/followCameraPointersInput.js +239 -203
  60. package/Cameras/Inputs/followCameraPointersInput.js.map +1 -1
  61. package/Cameras/Inputs/freeCameraGamepadInput.js +127 -114
  62. package/Cameras/Inputs/freeCameraGamepadInput.js.map +1 -1
  63. package/Cameras/Inputs/freeCameraKeyboardMoveInput.js +278 -244
  64. package/Cameras/Inputs/freeCameraKeyboardMoveInput.js.map +1 -1
  65. package/Cameras/Inputs/freeCameraMouseInput.js +216 -202
  66. package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
  67. package/Cameras/Inputs/freeCameraMouseWheelInput.js +368 -353
  68. package/Cameras/Inputs/freeCameraMouseWheelInput.js.map +1 -1
  69. package/Cameras/Inputs/freeCameraTouchInput.js +185 -172
  70. package/Cameras/Inputs/freeCameraTouchInput.js.map +1 -1
  71. package/Cameras/Inputs/geospatialCameraKeyboardInput.d.ts +2 -0
  72. package/Cameras/Inputs/geospatialCameraKeyboardInput.js +291 -246
  73. package/Cameras/Inputs/geospatialCameraKeyboardInput.js.map +1 -1
  74. package/Cameras/Inputs/geospatialCameraPointersInput.d.ts +11 -1
  75. package/Cameras/Inputs/geospatialCameraPointersInput.js +18 -2
  76. package/Cameras/Inputs/geospatialCameraPointersInput.js.map +1 -1
  77. package/Cameras/Inputs/orbitCameraPointersInput.js +112 -96
  78. package/Cameras/Inputs/orbitCameraPointersInput.js.map +1 -1
  79. package/Cameras/VR/vrExperienceHelper.d.ts +0 -2
  80. package/Cameras/VR/vrExperienceHelper.js +0 -2
  81. package/Cameras/VR/vrExperienceHelper.js.map +1 -1
  82. package/Cameras/VR/vrExperienceHelper.pure.js +5 -0
  83. package/Cameras/VR/vrExperienceHelper.pure.js.map +1 -1
  84. package/Cameras/arcRotateCamera.pure.js +1559 -1479
  85. package/Cameras/arcRotateCamera.pure.js.map +1 -1
  86. package/Cameras/camera.pure.js +1225 -1178
  87. package/Cameras/camera.pure.js.map +1 -1
  88. package/Cameras/flyCamera.pure.js +369 -351
  89. package/Cameras/flyCamera.pure.js.map +1 -1
  90. package/Cameras/followCamera.pure.js +229 -192
  91. package/Cameras/followCamera.pure.js.map +1 -1
  92. package/Cameras/freeCamera.pure.js +373 -351
  93. package/Cameras/freeCamera.pure.js.map +1 -1
  94. package/Cameras/geospatialCamera.pure.d.ts +30 -7
  95. package/Cameras/geospatialCamera.pure.js +502 -457
  96. package/Cameras/geospatialCamera.pure.js.map +1 -1
  97. package/Cameras/geospatialCameraMovement.js +2 -2
  98. package/Cameras/geospatialCameraMovement.js.map +1 -1
  99. package/Cameras/targetCamera.pure.d.ts +7 -0
  100. package/Cameras/targetCamera.pure.js +550 -509
  101. package/Cameras/targetCamera.pure.js.map +1 -1
  102. package/Cameras/universalCamera.pure.js +98 -85
  103. package/Cameras/universalCamera.pure.js.map +1 -1
  104. package/Collisions/gpuPicker.d.ts +111 -4
  105. package/Collisions/gpuPicker.js +696 -119
  106. package/Collisions/gpuPicker.js.map +1 -1
  107. package/Compute/computeShader.pure.js +372 -355
  108. package/Compute/computeShader.pure.js.map +1 -1
  109. package/Culling/Helper/transformFeedbackBoundingHelper.pure.js +2 -2
  110. package/Decorators/nodeDecorator.d.ts +11 -1
  111. package/Decorators/nodeDecorator.js +43 -6
  112. package/Decorators/nodeDecorator.js.map +1 -1
  113. package/Engines/AbstractEngine/abstractEngine.loadFile.pure.js +8 -0
  114. package/Engines/AbstractEngine/abstractEngine.loadFile.pure.js.map +1 -1
  115. package/Engines/Native/nativeHelpers.js +15 -0
  116. package/Engines/Native/nativeHelpers.js.map +1 -1
  117. package/Engines/Native/nativeInterfaces.d.ts +7 -2
  118. package/Engines/Native/nativeInterfaces.js.map +1 -1
  119. package/Engines/Native/nativeRenderTargetWrapper.d.ts +5 -0
  120. package/Engines/Native/nativeRenderTargetWrapper.js +35 -1
  121. package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
  122. package/Engines/Processors/shaderProcessor.js +5 -3
  123. package/Engines/Processors/shaderProcessor.js.map +1 -1
  124. package/Engines/WebGPU/Extensions/engine.videoTexture.pure.js +16 -3
  125. package/Engines/WebGPU/Extensions/engine.videoTexture.pure.js.map +1 -1
  126. package/Engines/WebGPU/webgpuClearQuad.pure.js +7 -1
  127. package/Engines/WebGPU/webgpuClearQuad.pure.js.map +1 -1
  128. package/Engines/abstractEngine.functions.d.ts +8 -2
  129. package/Engines/abstractEngine.functions.js +12 -4
  130. package/Engines/abstractEngine.functions.js.map +1 -1
  131. package/Engines/abstractEngine.pure.d.ts +20 -1
  132. package/Engines/abstractEngine.pure.js +21 -134
  133. package/Engines/abstractEngine.pure.js.map +1 -1
  134. package/Engines/engine.d.ts +208 -0
  135. package/Engines/engine.pure.js +0 -15
  136. package/Engines/engine.pure.js.map +1 -1
  137. package/Engines/nullEngine.pure.d.ts +66 -0
  138. package/Engines/nullEngine.pure.js +97 -0
  139. package/Engines/nullEngine.pure.js.map +1 -1
  140. package/Engines/thinEngine.pure.d.ts +0 -13
  141. package/Engines/thinEngine.pure.js +4 -23
  142. package/Engines/thinEngine.pure.js.map +1 -1
  143. package/Engines/thinNativeEngine.d.ts +0 -1
  144. package/Engines/thinNativeEngine.js +0 -1
  145. package/Engines/thinNativeEngine.js.map +1 -1
  146. package/Engines/thinNativeEngine.pure.d.ts +27 -0
  147. package/Engines/thinNativeEngine.pure.js +383 -17
  148. package/Engines/thinNativeEngine.pure.js.map +1 -1
  149. package/Engines/webgpuEngine.d.ts +1 -0
  150. package/Engines/webgpuEngine.js +1 -0
  151. package/Engines/webgpuEngine.js.map +1 -1
  152. package/Engines/webgpuEngine.pure.d.ts +9 -0
  153. package/Engines/webgpuEngine.pure.js +7 -0
  154. package/Engines/webgpuEngine.pure.js.map +1 -1
  155. package/FlowGraph/flowGraph.js +9 -0
  156. package/FlowGraph/flowGraph.js.map +1 -1
  157. package/FlowGraph/flowGraphContext.js +597 -584
  158. package/FlowGraph/flowGraphContext.js.map +1 -1
  159. package/FlowGraph/flowGraphDataConnection.pure.d.ts +14 -0
  160. package/FlowGraph/flowGraphDataConnection.pure.js +38 -1
  161. package/FlowGraph/flowGraphDataConnection.pure.js.map +1 -1
  162. package/FlowGraph/serialization.d.ts +11 -0
  163. package/FlowGraph/serialization.js +11 -1
  164. package/FlowGraph/serialization.js.map +1 -1
  165. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.pure.js +182 -170
  166. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.pure.js.map +1 -1
  167. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.pure.js +196 -184
  168. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.pure.js.map +1 -1
  169. package/FrameGraph/Node/Blocks/Layers/selectionOutlineLayerBlock.pure.js +222 -210
  170. package/FrameGraph/Node/Blocks/Layers/selectionOutlineLayerBlock.pure.js.map +1 -1
  171. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js +123 -111
  172. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js.map +1 -1
  173. package/FrameGraph/Node/Blocks/PostProcesses/baseWithPropertiesPostProcessBlock.js +158 -146
  174. package/FrameGraph/Node/Blocks/PostProcesses/baseWithPropertiesPostProcessBlock.js.map +1 -1
  175. package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.pure.js +63 -51
  176. package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.pure.js.map +1 -1
  177. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.pure.js +122 -110
  178. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.pure.js.map +1 -1
  179. package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.pure.js +76 -64
  180. package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.pure.js.map +1 -1
  181. package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.pure.js +89 -77
  182. package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.pure.js.map +1 -1
  183. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.pure.js +134 -122
  184. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.pure.js.map +1 -1
  185. package/FrameGraph/Node/Blocks/PostProcesses/colorCorrectionPostProcessBlock.pure.js +58 -46
  186. package/FrameGraph/Node/Blocks/PostProcesses/colorCorrectionPostProcessBlock.pure.js.map +1 -1
  187. package/FrameGraph/Node/Blocks/PostProcesses/convolutionPostProcessBlock.pure.js +107 -95
  188. package/FrameGraph/Node/Blocks/PostProcesses/convolutionPostProcessBlock.pure.js.map +1 -1
  189. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.pure.js +181 -169
  190. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.pure.js.map +1 -1
  191. package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.pure.js +63 -51
  192. package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.pure.js.map +1 -1
  193. package/FrameGraph/Node/Blocks/PostProcesses/filterPostProcessBlock.pure.js +63 -51
  194. package/FrameGraph/Node/Blocks/PostProcesses/filterPostProcessBlock.pure.js.map +1 -1
  195. package/FrameGraph/Node/Blocks/PostProcesses/grainPostProcessBlock.pure.js +76 -64
  196. package/FrameGraph/Node/Blocks/PostProcesses/grainPostProcessBlock.pure.js.map +1 -1
  197. package/FrameGraph/Node/Blocks/PostProcesses/imageProcessingPostProcessBlock.pure.js +246 -234
  198. package/FrameGraph/Node/Blocks/PostProcesses/imageProcessingPostProcessBlock.pure.js.map +1 -1
  199. package/FrameGraph/Node/Blocks/PostProcesses/motionBlurPostProcessBlock.pure.js +108 -96
  200. package/FrameGraph/Node/Blocks/PostProcesses/motionBlurPostProcessBlock.pure.js.map +1 -1
  201. package/FrameGraph/Node/Blocks/PostProcesses/screenSpaceCurvaturePostProcessBlock.pure.js +87 -75
  202. package/FrameGraph/Node/Blocks/PostProcesses/screenSpaceCurvaturePostProcessBlock.pure.js.map +1 -1
  203. package/FrameGraph/Node/Blocks/PostProcesses/sharpenPostProcessBlock.pure.js +76 -64
  204. package/FrameGraph/Node/Blocks/PostProcesses/sharpenPostProcessBlock.pure.js.map +1 -1
  205. package/FrameGraph/Node/Blocks/PostProcesses/ssao2PostProcessBlock.pure.js +313 -301
  206. package/FrameGraph/Node/Blocks/PostProcesses/ssao2PostProcessBlock.pure.js.map +1 -1
  207. package/FrameGraph/Node/Blocks/PostProcesses/ssrPostProcessBlock.pure.js +502 -490
  208. package/FrameGraph/Node/Blocks/PostProcesses/ssrPostProcessBlock.pure.js.map +1 -1
  209. package/FrameGraph/Node/Blocks/PostProcesses/taaPostProcessBlock.pure.js +147 -135
  210. package/FrameGraph/Node/Blocks/PostProcesses/taaPostProcessBlock.pure.js.map +1 -1
  211. package/FrameGraph/Node/Blocks/PostProcesses/tonemapPostProcessBlock.pure.js +90 -78
  212. package/FrameGraph/Node/Blocks/PostProcesses/tonemapPostProcessBlock.pure.js.map +1 -1
  213. package/FrameGraph/Node/Blocks/PostProcesses/volumetricLightingBlock.pure.js +179 -167
  214. package/FrameGraph/Node/Blocks/PostProcesses/volumetricLightingBlock.pure.js.map +1 -1
  215. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +462 -451
  216. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
  217. package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js +265 -253
  218. package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js.map +1 -1
  219. package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.pure.js +204 -192
  220. package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.pure.js.map +1 -1
  221. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js +611 -550
  222. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js.map +1 -1
  223. package/FrameGraph/Node/Blocks/Rendering/iblShadowsRendererBlock.pure.js +320 -308
  224. package/FrameGraph/Node/Blocks/Rendering/iblShadowsRendererBlock.pure.js.map +1 -1
  225. package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.pure.js +87 -75
  226. package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.pure.js.map +1 -1
  227. package/FrameGraph/Node/Blocks/Textures/clearBlock.pure.js +154 -142
  228. package/FrameGraph/Node/Blocks/Textures/clearBlock.pure.js.map +1 -1
  229. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.pure.js +150 -138
  230. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.pure.js.map +1 -1
  231. package/FrameGraph/Node/Blocks/inputBlock.pure.js +270 -256
  232. package/FrameGraph/Node/Blocks/inputBlock.pure.js.map +1 -1
  233. package/FrameGraph/Node/Blocks/lightingVolumeBlock.pure.js +95 -83
  234. package/FrameGraph/Node/Blocks/lightingVolumeBlock.pure.js.map +1 -1
  235. package/FrameGraph/Node/nodeRenderGraph.js +715 -693
  236. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  237. package/FrameGraph/Node/nodeRenderGraphBlock.js +548 -533
  238. package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -1
  239. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsAccumulationTask.d.ts +2 -2
  240. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsAccumulationTask.js +43 -51
  241. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsAccumulationTask.js.map +1 -1
  242. package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.d.ts +0 -1
  243. package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.js +0 -1
  244. package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.js.map +1 -1
  245. package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.pure.d.ts +0 -1
  246. package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.pure.js +66 -35
  247. package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.pure.js.map +1 -1
  248. package/Helpers/environmentHelper.js +2 -2
  249. package/Helpers/environmentHelper.js.map +1 -1
  250. package/Layers/effectLayer.js +529 -519
  251. package/Layers/effectLayer.js.map +1 -1
  252. package/Layers/glowLayer.pure.js +428 -413
  253. package/Layers/glowLayer.pure.js.map +1 -1
  254. package/Layers/highlightLayer.pure.js +473 -458
  255. package/Layers/highlightLayer.pure.js.map +1 -1
  256. package/Layers/selectionOutlineLayer.pure.js +360 -345
  257. package/Layers/selectionOutlineLayer.pure.js.map +1 -1
  258. package/Lights/Clustered/clusteredLightContainer.pure.d.ts +1 -1
  259. package/Lights/Clustered/clusteredLightContainer.pure.js +583 -558
  260. package/Lights/Clustered/clusteredLightContainer.pure.js.map +1 -1
  261. package/Lights/Shadows/shadowGenerator.js +6 -1
  262. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  263. package/Lights/areaLight.pure.js +61 -39
  264. package/Lights/areaLight.pure.js.map +1 -1
  265. package/Lights/directionalLight.pure.js +308 -284
  266. package/Lights/directionalLight.pure.js.map +1 -1
  267. package/Lights/hemisphericLight.pure.js +123 -104
  268. package/Lights/hemisphericLight.pure.js.map +1 -1
  269. package/Lights/light.d.ts +5 -3
  270. package/Lights/light.js +869 -827
  271. package/Lights/light.js.map +1 -1
  272. package/Lights/pointLight.pure.js +185 -174
  273. package/Lights/pointLight.pure.js.map +1 -1
  274. package/Lights/rectAreaLight.pure.d.ts +17 -0
  275. package/Lights/rectAreaLight.pure.js +238 -159
  276. package/Lights/rectAreaLight.pure.js.map +1 -1
  277. package/Lights/shadowLight.js +280 -268
  278. package/Lights/shadowLight.js.map +1 -1
  279. package/Lights/spotLight.pure.js +460 -427
  280. package/Lights/spotLight.pure.js.map +1 -1
  281. package/Loading/Plugins/babylonFileLoader.pure.js +17 -5
  282. package/Loading/Plugins/babylonFileLoader.pure.js.map +1 -1
  283. package/Loading/sceneLoader.d.ts +5 -1
  284. package/Loading/sceneLoader.js +299 -402
  285. package/Loading/sceneLoader.js.map +1 -1
  286. package/Materials/Background/backgroundMaterial.pure.d.ts +18 -18
  287. package/Materials/Background/backgroundMaterial.pure.js +949 -794
  288. package/Materials/Background/backgroundMaterial.pure.js.map +1 -1
  289. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.d.ts +15 -0
  290. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js +34 -1
  291. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js.map +1 -1
  292. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.d.ts +9 -0
  293. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +26 -2
  294. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
  295. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.d.ts +2 -1
  296. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js +169 -149
  297. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js.map +1 -1
  298. package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.js +1 -1
  299. package/Materials/Node/Blocks/Dual/lightBlock.pure.js +442 -429
  300. package/Materials/Node/Blocks/Dual/lightBlock.pure.js.map +1 -1
  301. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.pure.js +396 -383
  302. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.pure.js.map +1 -1
  303. package/Materials/Node/Blocks/Dual/sceneDepthBlock.pure.js +237 -220
  304. package/Materials/Node/Blocks/Dual/sceneDepthBlock.pure.js.map +1 -1
  305. package/Materials/Node/Blocks/Dual/textureBlock.pure.js +1 -1
  306. package/Materials/Node/Blocks/Fragment/ambientOcclusionBlock.pure.js +150 -133
  307. package/Materials/Node/Blocks/Fragment/ambientOcclusionBlock.pure.js.map +1 -1
  308. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js +265 -250
  309. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js.map +1 -1
  310. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.pure.js +159 -142
  311. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.pure.js.map +1 -1
  312. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.pure.js +214 -201
  313. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.pure.js.map +1 -1
  314. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.pure.js +419 -400
  315. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.pure.js.map +1 -1
  316. package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js +3 -1
  317. package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js.map +1 -1
  318. package/Materials/Node/Blocks/PBR/clearCoatBlock.pure.js +302 -289
  319. package/Materials/Node/Blocks/PBR/clearCoatBlock.pure.js.map +1 -1
  320. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.js +1327 -1272
  321. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.js.map +1 -1
  322. package/Materials/Node/Blocks/PBR/reflectionBlock.pure.js +352 -337
  323. package/Materials/Node/Blocks/PBR/reflectionBlock.pure.js.map +1 -1
  324. package/Materials/Node/Blocks/PBR/refractionBlock.pure.js +297 -277
  325. package/Materials/Node/Blocks/PBR/refractionBlock.pure.js.map +1 -1
  326. package/Materials/Node/Blocks/PBR/sheenBlock.pure.js +146 -131
  327. package/Materials/Node/Blocks/PBR/sheenBlock.pure.js.map +1 -1
  328. package/Materials/Node/Blocks/PBR/subSurfaceBlock.pure.js +158 -145
  329. package/Materials/Node/Blocks/PBR/subSurfaceBlock.pure.js.map +1 -1
  330. package/Materials/Node/Blocks/clampBlock.pure.js +92 -77
  331. package/Materials/Node/Blocks/clampBlock.pure.js.map +1 -1
  332. package/Materials/Node/Blocks/cloudBlock.pure.js +145 -132
  333. package/Materials/Node/Blocks/cloudBlock.pure.js.map +1 -1
  334. package/Materials/Node/Blocks/conditionalBlock.pure.js +182 -169
  335. package/Materials/Node/Blocks/conditionalBlock.pure.js.map +1 -1
  336. package/Materials/Node/Blocks/curveBlock.pure.js +259 -246
  337. package/Materials/Node/Blocks/curveBlock.pure.js.map +1 -1
  338. package/Materials/Node/Blocks/debugBlock.pure.js +119 -106
  339. package/Materials/Node/Blocks/debugBlock.pure.js.map +1 -1
  340. package/Materials/Node/Blocks/loopBlock.pure.js +123 -110
  341. package/Materials/Node/Blocks/loopBlock.pure.js.map +1 -1
  342. package/Materials/Node/Blocks/meshAttributeExistsBlock.pure.js +185 -172
  343. package/Materials/Node/Blocks/meshAttributeExistsBlock.pure.js.map +1 -1
  344. package/Materials/Node/Blocks/remapBlock.pure.js +127 -112
  345. package/Materials/Node/Blocks/remapBlock.pure.js.map +1 -1
  346. package/Materials/Node/Blocks/transformBlock.pure.js +196 -185
  347. package/Materials/Node/Blocks/transformBlock.pure.js.map +1 -1
  348. package/Materials/Node/Blocks/triPlanarBlock.pure.js +451 -438
  349. package/Materials/Node/Blocks/triPlanarBlock.pure.js.map +1 -1
  350. package/Materials/Node/Blocks/trigonometryBlock.pure.js +184 -171
  351. package/Materials/Node/Blocks/trigonometryBlock.pure.js.map +1 -1
  352. package/Materials/Node/Blocks/waveBlock.pure.js +97 -84
  353. package/Materials/Node/Blocks/waveBlock.pure.js.map +1 -1
  354. package/Materials/Node/Blocks/worleyNoise3DBlock.pure.js +276 -263
  355. package/Materials/Node/Blocks/worleyNoise3DBlock.pure.js.map +1 -1
  356. package/Materials/Node/nodeMaterial.pure.js +1765 -1737
  357. package/Materials/Node/nodeMaterial.pure.js.map +1 -1
  358. package/Materials/Node/nodeMaterialBuildState.d.ts +3 -3
  359. package/Materials/PBR/openpbrMaterial.pure.d.ts +102 -102
  360. package/Materials/PBR/openpbrMaterial.pure.js +3115 -2243
  361. package/Materials/PBR/openpbrMaterial.pure.js.map +1 -1
  362. package/Materials/PBR/pbrAnisotropicConfiguration.d.ts +3 -3
  363. package/Materials/PBR/pbrAnisotropicConfiguration.js +255 -227
  364. package/Materials/PBR/pbrAnisotropicConfiguration.js.map +1 -1
  365. package/Materials/PBR/pbrBRDFConfiguration.d.ts +9 -9
  366. package/Materials/PBR/pbrBRDFConfiguration.js +203 -155
  367. package/Materials/PBR/pbrBRDFConfiguration.js.map +1 -1
  368. package/Materials/PBR/pbrBaseMaterial.pure.d.ts +1 -1
  369. package/Materials/PBR/pbrBaseMaterial.pure.js +1751 -1736
  370. package/Materials/PBR/pbrBaseMaterial.pure.js.map +1 -1
  371. package/Materials/PBR/pbrBaseSimpleMaterial.d.ts +13 -13
  372. package/Materials/PBR/pbrBaseSimpleMaterial.js +205 -117
  373. package/Materials/PBR/pbrBaseSimpleMaterial.js.map +1 -1
  374. package/Materials/PBR/pbrClearCoatConfiguration.d.ts +9 -9
  375. package/Materials/PBR/pbrClearCoatConfiguration.js +464 -406
  376. package/Materials/PBR/pbrClearCoatConfiguration.js.map +1 -1
  377. package/Materials/PBR/pbrIridescenceConfiguration.d.ts +3 -3
  378. package/Materials/PBR/pbrIridescenceConfiguration.js +271 -239
  379. package/Materials/PBR/pbrIridescenceConfiguration.js.map +1 -1
  380. package/Materials/PBR/pbrMaterial.pure.d.ts +66 -66
  381. package/Materials/PBR/pbrMaterial.pure.js +1041 -685
  382. package/Materials/PBR/pbrMaterial.pure.js.map +1 -1
  383. package/Materials/PBR/pbrMetallicRoughnessMaterial.pure.d.ts +5 -5
  384. package/Materials/PBR/pbrMetallicRoughnessMaterial.pure.js +176 -115
  385. package/Materials/PBR/pbrMetallicRoughnessMaterial.pure.js.map +1 -1
  386. package/Materials/PBR/pbrSheenConfiguration.d.ts +7 -7
  387. package/Materials/PBR/pbrSheenConfiguration.js +314 -270
  388. package/Materials/PBR/pbrSheenConfiguration.js.map +1 -1
  389. package/Materials/PBR/pbrSpecularGlossinessMaterial.pure.d.ts +5 -5
  390. package/Materials/PBR/pbrSpecularGlossinessMaterial.pure.js +172 -117
  391. package/Materials/PBR/pbrSpecularGlossinessMaterial.pure.js.map +1 -1
  392. package/Materials/PBR/pbrSubSurfaceConfiguration.d.ts +16 -16
  393. package/Materials/PBR/pbrSubSurfaceConfiguration.js +864 -764
  394. package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
  395. package/Materials/Textures/HTML/htmlInCanvasPolyfill.d.ts +43 -0
  396. package/Materials/Textures/HTML/htmlInCanvasPolyfill.js +64 -0
  397. package/Materials/Textures/HTML/htmlInCanvasPolyfill.js.map +1 -0
  398. package/Materials/Textures/HTML/htmlInteractionManager.d.ts +69 -0
  399. package/Materials/Textures/HTML/htmlInteractionManager.js +130 -0
  400. package/Materials/Textures/HTML/htmlInteractionManager.js.map +1 -0
  401. package/Materials/Textures/HTML/htmlRaycastInteractionManager.d.ts +84 -0
  402. package/Materials/Textures/HTML/htmlRaycastInteractionManager.js +246 -0
  403. package/Materials/Textures/HTML/htmlRaycastInteractionManager.js.map +1 -0
  404. package/Materials/Textures/HTML/htmlTexture.d.ts +148 -0
  405. package/Materials/Textures/HTML/htmlTexture.js +455 -0
  406. package/Materials/Textures/HTML/htmlTexture.js.map +1 -0
  407. package/Materials/Textures/HTML/index.d.ts +4 -0
  408. package/Materials/Textures/HTML/index.js +5 -0
  409. package/Materials/Textures/HTML/index.js.map +1 -0
  410. package/Materials/Textures/HTML/pure.d.ts +5 -0
  411. package/Materials/Textures/HTML/pure.js +6 -0
  412. package/Materials/Textures/HTML/pure.js.map +1 -0
  413. package/Materials/Textures/Procedurals/proceduralTexture.pure.js +671 -643
  414. package/Materials/Textures/Procedurals/proceduralTexture.pure.js.map +1 -1
  415. package/Materials/Textures/baseTexture.pure.js +880 -825
  416. package/Materials/Textures/baseTexture.pure.js.map +1 -1
  417. package/Materials/Textures/cubeTexture.d.ts +0 -1
  418. package/Materials/Textures/cubeTexture.js +0 -1
  419. package/Materials/Textures/cubeTexture.js.map +1 -1
  420. package/Materials/Textures/cubeTexture.pure.js +368 -333
  421. package/Materials/Textures/cubeTexture.pure.js.map +1 -1
  422. package/Materials/Textures/dynamicTexture.d.ts +0 -1
  423. package/Materials/Textures/dynamicTexture.js +0 -1
  424. package/Materials/Textures/dynamicTexture.js.map +1 -1
  425. package/Materials/Textures/dynamicTexture.pure.js +2 -0
  426. package/Materials/Textures/dynamicTexture.pure.js.map +1 -1
  427. package/Materials/Textures/htmlElementTexture.d.ts +0 -2
  428. package/Materials/Textures/htmlElementTexture.js +0 -2
  429. package/Materials/Textures/htmlElementTexture.js.map +1 -1
  430. package/Materials/Textures/htmlElementTexture.pure.js +4 -0
  431. package/Materials/Textures/htmlElementTexture.pure.js.map +1 -1
  432. package/Materials/Textures/index.d.ts +1 -0
  433. package/Materials/Textures/index.js +1 -1
  434. package/Materials/Textures/index.js.map +1 -1
  435. package/Materials/Textures/multiRenderTarget.d.ts +0 -1
  436. package/Materials/Textures/multiRenderTarget.js +0 -1
  437. package/Materials/Textures/multiRenderTarget.js.map +1 -1
  438. package/Materials/Textures/multiRenderTarget.pure.js +2 -0
  439. package/Materials/Textures/multiRenderTarget.pure.js.map +1 -1
  440. package/Materials/Textures/pure.d.ts +1 -0
  441. package/Materials/Textures/pure.js +1 -0
  442. package/Materials/Textures/pure.js.map +1 -1
  443. package/Materials/Textures/texture.pure.js +961 -923
  444. package/Materials/Textures/texture.pure.js.map +1 -1
  445. package/Materials/Textures/videoTexture.pure.d.ts +3 -0
  446. package/Materials/Textures/videoTexture.pure.js +450 -401
  447. package/Materials/Textures/videoTexture.pure.js.map +1 -1
  448. package/Materials/colorCurves.pure.js +510 -477
  449. package/Materials/colorCurves.pure.js.map +1 -1
  450. package/Materials/effect.pure.js +0 -7
  451. package/Materials/effect.pure.js.map +1 -1
  452. package/Materials/imageProcessing.js +12 -4
  453. package/Materials/imageProcessing.js.map +1 -1
  454. package/Materials/imageProcessingConfiguration.pure.js +647 -587
  455. package/Materials/imageProcessingConfiguration.pure.js.map +1 -1
  456. package/Materials/material.decalMapConfiguration.pure.d.ts +2 -2
  457. package/Materials/material.decalMapConfiguration.pure.js +149 -130
  458. package/Materials/material.decalMapConfiguration.pure.js.map +1 -1
  459. package/Materials/material.detailMapConfiguration.d.ts +3 -3
  460. package/Materials/material.detailMapConfiguration.js +213 -175
  461. package/Materials/material.detailMapConfiguration.js.map +1 -1
  462. package/Materials/material.pure.js +1815 -1721
  463. package/Materials/material.pure.js.map +1 -1
  464. package/Materials/materialPluginBase.pure.js +270 -249
  465. package/Materials/materialPluginBase.pure.js.map +1 -1
  466. package/Materials/materialPluginManager.pure.js +18 -8
  467. package/Materials/materialPluginManager.pure.js.map +1 -1
  468. package/Materials/materialStencilState.js +211 -200
  469. package/Materials/materialStencilState.js.map +1 -1
  470. package/Materials/meshDebugPluginMaterial.pure.d.ts +2 -2
  471. package/Materials/meshDebugPluginMaterial.pure.js +397 -275
  472. package/Materials/meshDebugPluginMaterial.pure.js.map +1 -1
  473. package/Materials/standardMaterial.pure.d.ts +32 -32
  474. package/Materials/standardMaterial.pure.js +1804 -1394
  475. package/Materials/standardMaterial.pure.js.map +1 -1
  476. package/Maths/math.color.pure.js +5 -5
  477. package/Maths/math.functions.js +38 -30
  478. package/Maths/math.functions.js.map +1 -1
  479. package/Maths/math.vector.pure.js +25 -25
  480. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +18 -8
  481. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
  482. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +86 -1
  483. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +255 -104
  484. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
  485. package/Meshes/GaussianSplatting/gaussianSplattingSortWorker.d.ts +39 -0
  486. package/Meshes/GaussianSplatting/gaussianSplattingSortWorker.js +322 -0
  487. package/Meshes/GaussianSplatting/gaussianSplattingSortWorker.js.map +1 -0
  488. package/Meshes/GreasedLine/greasedLineMesh.pure.js +4 -4
  489. package/Meshes/GreasedLine/greasedLineRibbonMesh.pure.js +3 -3
  490. package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js +107 -94
  491. package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js.map +1 -1
  492. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.pure.js +276 -263
  493. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.pure.js.map +1 -1
  494. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.pure.js +247 -232
  495. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.pure.js.map +1 -1
  496. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.pure.js +299 -284
  497. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.pure.js.map +1 -1
  498. package/Meshes/Node/Blocks/Set/aggregatorBlock.pure.js +196 -181
  499. package/Meshes/Node/Blocks/Set/aggregatorBlock.pure.js.map +1 -1
  500. package/Meshes/Node/Blocks/Set/latticeBlock.pure.js +198 -179
  501. package/Meshes/Node/Blocks/Set/latticeBlock.pure.js.map +1 -1
  502. package/Meshes/Node/Blocks/Set/setColorsBlock.pure.js +151 -138
  503. package/Meshes/Node/Blocks/Set/setColorsBlock.pure.js.map +1 -1
  504. package/Meshes/Node/Blocks/Set/setMaterialIDBlock.pure.js +107 -94
  505. package/Meshes/Node/Blocks/Set/setMaterialIDBlock.pure.js.map +1 -1
  506. package/Meshes/Node/Blocks/Set/setNormalsBlock.pure.js +138 -125
  507. package/Meshes/Node/Blocks/Set/setNormalsBlock.pure.js.map +1 -1
  508. package/Meshes/Node/Blocks/Set/setPositionsBlock.pure.js +213 -200
  509. package/Meshes/Node/Blocks/Set/setPositionsBlock.pure.js.map +1 -1
  510. package/Meshes/Node/Blocks/Set/setTangentsBlock.pure.js +138 -125
  511. package/Meshes/Node/Blocks/Set/setTangentsBlock.pure.js.map +1 -1
  512. package/Meshes/Node/Blocks/Set/setUVsBlock.pure.js +179 -164
  513. package/Meshes/Node/Blocks/Set/setUVsBlock.pure.js.map +1 -1
  514. package/Meshes/Node/Blocks/Sources/boxBlock.pure.js +183 -170
  515. package/Meshes/Node/Blocks/Sources/boxBlock.pure.js.map +1 -1
  516. package/Meshes/Node/Blocks/Sources/capsuleBlock.pure.js +125 -112
  517. package/Meshes/Node/Blocks/Sources/capsuleBlock.pure.js.map +1 -1
  518. package/Meshes/Node/Blocks/Sources/cylinderBlock.pure.js +153 -140
  519. package/Meshes/Node/Blocks/Sources/cylinderBlock.pure.js.map +1 -1
  520. package/Meshes/Node/Blocks/Sources/discBlock.pure.js +112 -99
  521. package/Meshes/Node/Blocks/Sources/discBlock.pure.js.map +1 -1
  522. package/Meshes/Node/Blocks/Sources/gridBlock.pure.js +133 -120
  523. package/Meshes/Node/Blocks/Sources/gridBlock.pure.js.map +1 -1
  524. package/Meshes/Node/Blocks/Sources/icoSphereBlock.pure.js +128 -115
  525. package/Meshes/Node/Blocks/Sources/icoSphereBlock.pure.js.map +1 -1
  526. package/Meshes/Node/Blocks/Sources/meshBlock.pure.js +116 -103
  527. package/Meshes/Node/Blocks/Sources/meshBlock.pure.js.map +1 -1
  528. package/Meshes/Node/Blocks/Sources/planeBlock.pure.js +160 -147
  529. package/Meshes/Node/Blocks/Sources/planeBlock.pure.js.map +1 -1
  530. package/Meshes/Node/Blocks/Sources/sphereBlock.pure.js +144 -131
  531. package/Meshes/Node/Blocks/Sources/sphereBlock.pure.js.map +1 -1
  532. package/Meshes/Node/Blocks/Sources/torusBlock.pure.js +112 -99
  533. package/Meshes/Node/Blocks/Sources/torusBlock.pure.js.map +1 -1
  534. package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.pure.js +200 -185
  535. package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.pure.js.map +1 -1
  536. package/Meshes/Node/Blocks/bevelBlock.pure.js +111 -98
  537. package/Meshes/Node/Blocks/bevelBlock.pure.js.map +1 -1
  538. package/Meshes/Node/Blocks/booleanGeometryBlock.pure.js +182 -165
  539. package/Meshes/Node/Blocks/booleanGeometryBlock.pure.js.map +1 -1
  540. package/Meshes/Node/Blocks/cleanGeometryBlock.pure.js +89 -76
  541. package/Meshes/Node/Blocks/cleanGeometryBlock.pure.js.map +1 -1
  542. package/Meshes/Node/Blocks/conditionBlock.pure.js +184 -169
  543. package/Meshes/Node/Blocks/conditionBlock.pure.js.map +1 -1
  544. package/Meshes/Node/Blocks/extrudeGeometryBlock.pure.js +270 -255
  545. package/Meshes/Node/Blocks/extrudeGeometryBlock.pure.js.map +1 -1
  546. package/Meshes/Node/Blocks/geometryCollectionBlock.pure.js +172 -159
  547. package/Meshes/Node/Blocks/geometryCollectionBlock.pure.js.map +1 -1
  548. package/Meshes/Node/Blocks/geometryCurveBlock.pure.js +230 -217
  549. package/Meshes/Node/Blocks/geometryCurveBlock.pure.js.map +1 -1
  550. package/Meshes/Node/Blocks/geometryEaseBlock.pure.js +256 -245
  551. package/Meshes/Node/Blocks/geometryEaseBlock.pure.js.map +1 -1
  552. package/Meshes/Node/Blocks/geometryOptimizeBlock.pure.js +206 -189
  553. package/Meshes/Node/Blocks/geometryOptimizeBlock.pure.js.map +1 -1
  554. package/Meshes/Node/Blocks/geometryTransformBlock.pure.js +166 -153
  555. package/Meshes/Node/Blocks/geometryTransformBlock.pure.js.map +1 -1
  556. package/Meshes/Node/Blocks/geometryTrigonometryBlock.pure.js +221 -208
  557. package/Meshes/Node/Blocks/geometryTrigonometryBlock.pure.js.map +1 -1
  558. package/Meshes/Node/Blocks/mappingBlock.pure.js +150 -137
  559. package/Meshes/Node/Blocks/mappingBlock.pure.js.map +1 -1
  560. package/Meshes/Node/Blocks/mathBlock.pure.js +269 -256
  561. package/Meshes/Node/Blocks/mathBlock.pure.js.map +1 -1
  562. package/Meshes/Node/Blocks/mergeGeometryBlock.pure.js +141 -128
  563. package/Meshes/Node/Blocks/mergeGeometryBlock.pure.js.map +1 -1
  564. package/Meshes/Node/Blocks/randomBlock.pure.js +161 -148
  565. package/Meshes/Node/Blocks/randomBlock.pure.js.map +1 -1
  566. package/Meshes/Node/Blocks/subdivideBlock.pure.js +102 -87
  567. package/Meshes/Node/Blocks/subdivideBlock.pure.js.map +1 -1
  568. package/Meshes/Node/nodeGeometry.js +560 -538
  569. package/Meshes/Node/nodeGeometry.js.map +1 -1
  570. package/Meshes/Node/nodeGeometryBlock.js +473 -458
  571. package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
  572. package/Meshes/abstractMesh.pure.js +2218 -2207
  573. package/Meshes/abstractMesh.pure.js.map +1 -1
  574. package/Meshes/geometry.js +30 -15
  575. package/Meshes/geometry.js.map +1 -1
  576. package/Meshes/mesh.pure.js +26 -14
  577. package/Meshes/mesh.pure.js.map +1 -1
  578. package/Meshes/mesh.vertexData.js +1665 -1655
  579. package/Meshes/mesh.vertexData.js.map +1 -1
  580. package/Meshes/transformNode.pure.js +1400 -1372
  581. package/Meshes/transformNode.pure.js.map +1 -1
  582. package/Misc/decorators.d.ts +34 -19
  583. package/Misc/decorators.functions.d.ts +33 -2
  584. package/Misc/decorators.functions.js +114 -35
  585. package/Misc/decorators.functions.js.map +1 -1
  586. package/Misc/decorators.js +96 -68
  587. package/Misc/decorators.js.map +1 -1
  588. package/Misc/decorators.serialization.js +47 -40
  589. package/Misc/decorators.serialization.js.map +1 -1
  590. package/Misc/decorators.serializationUtilities.d.ts +24 -0
  591. package/Misc/decorators.serializationUtilities.js +20 -0
  592. package/Misc/decorators.serializationUtilities.js.map +1 -0
  593. package/Misc/dumpTools.pure.js +43 -33
  594. package/Misc/dumpTools.pure.js.map +1 -1
  595. package/Misc/fileTools.pure.js +8 -0
  596. package/Misc/fileTools.pure.js.map +1 -1
  597. package/Misc/observable.pure.js +0 -7
  598. package/Misc/observable.pure.js.map +1 -1
  599. package/Misc/snapshotRenderingHelper.d.ts +4 -1
  600. package/Misc/snapshotRenderingHelper.js.map +1 -1
  601. package/Misc/symbolMetadataPolyfill.d.ts +11 -0
  602. package/Misc/symbolMetadataPolyfill.js +22 -0
  603. package/Misc/symbolMetadataPolyfill.js.map +1 -0
  604. package/Misc/tools.pure.js +2 -2
  605. package/Misc/tools.pure.js.map +1 -1
  606. package/Morph/morphTarget.js +382 -365
  607. package/Morph/morphTarget.js.map +1 -1
  608. package/Particles/Node/Blocks/Conditions/particleConditionBlock.pure.js +160 -145
  609. package/Particles/Node/Blocks/Conditions/particleConditionBlock.pure.js.map +1 -1
  610. package/Particles/Node/Blocks/Emitters/coneShapeBlock.pure.js +187 -174
  611. package/Particles/Node/Blocks/Emitters/coneShapeBlock.pure.js.map +1 -1
  612. package/Particles/Node/Blocks/Emitters/meshShapeBlock.pure.js +238 -219
  613. package/Particles/Node/Blocks/Emitters/meshShapeBlock.pure.js.map +1 -1
  614. package/Particles/Node/Blocks/Emitters/setupSpriteSheetBlock.pure.js +140 -115
  615. package/Particles/Node/Blocks/Emitters/setupSpriteSheetBlock.pure.js.map +1 -1
  616. package/Particles/Node/Blocks/Emitters/sphereShapeBlock.pure.js +157 -144
  617. package/Particles/Node/Blocks/Emitters/sphereShapeBlock.pure.js.map +1 -1
  618. package/Particles/Node/Blocks/Triggers/particleTriggerBlock.pure.js +133 -119
  619. package/Particles/Node/Blocks/Triggers/particleTriggerBlock.pure.js.map +1 -1
  620. package/Particles/Node/Blocks/Update/alignAngleBlock.pure.js +93 -80
  621. package/Particles/Node/Blocks/Update/alignAngleBlock.pure.js.map +1 -1
  622. package/Particles/Node/Blocks/particleDebugBlock.pure.js +117 -105
  623. package/Particles/Node/Blocks/particleDebugBlock.pure.js.map +1 -1
  624. package/Particles/Node/Blocks/particleFloatToIntBlock.pure.js +105 -92
  625. package/Particles/Node/Blocks/particleFloatToIntBlock.pure.js.map +1 -1
  626. package/Particles/Node/Blocks/particleGradientValueBlock.pure.js +82 -69
  627. package/Particles/Node/Blocks/particleGradientValueBlock.pure.js.map +1 -1
  628. package/Particles/Node/Blocks/particleLocalVariableBlock.pure.js +113 -101
  629. package/Particles/Node/Blocks/particleLocalVariableBlock.pure.js.map +1 -1
  630. package/Particles/Node/Blocks/particleMathBlock.pure.js +278 -265
  631. package/Particles/Node/Blocks/particleMathBlock.pure.js.map +1 -1
  632. package/Particles/Node/Blocks/particleNumberMathBlock.pure.js +155 -142
  633. package/Particles/Node/Blocks/particleNumberMathBlock.pure.js.map +1 -1
  634. package/Particles/Node/Blocks/particleRandomBlock.pure.js +156 -143
  635. package/Particles/Node/Blocks/particleRandomBlock.pure.js.map +1 -1
  636. package/Particles/Node/Blocks/particleTrigonometryBlock.pure.js +217 -204
  637. package/Particles/Node/Blocks/particleTrigonometryBlock.pure.js.map +1 -1
  638. package/Particles/Node/Blocks/particleVectorMathBlock.pure.js +106 -93
  639. package/Particles/Node/Blocks/particleVectorMathBlock.pure.js.map +1 -1
  640. package/Particles/Node/Blocks/systemBlock.pure.js +366 -330
  641. package/Particles/Node/Blocks/systemBlock.pure.js.map +1 -1
  642. package/Particles/Node/nodeParticleBlock.js +339 -324
  643. package/Particles/Node/nodeParticleBlock.js.map +1 -1
  644. package/Particles/Node/nodeParticleSystemSet.js +494 -473
  645. package/Particles/Node/nodeParticleSystemSet.js.map +1 -1
  646. package/Particles/gpuParticleSystem.d.ts +0 -1
  647. package/Particles/gpuParticleSystem.js +0 -1
  648. package/Particles/gpuParticleSystem.js.map +1 -1
  649. package/Particles/gpuParticleSystem.pure.d.ts +4 -3
  650. package/Particles/gpuParticleSystem.pure.js +27 -16
  651. package/Particles/gpuParticleSystem.pure.js.map +1 -1
  652. package/Particles/particleSystem.pure.js +57 -2
  653. package/Particles/particleSystem.pure.js.map +1 -1
  654. package/Particles/thinParticleSystem.d.ts +0 -1
  655. package/Particles/thinParticleSystem.js +0 -1
  656. package/Particles/thinParticleSystem.js.map +1 -1
  657. package/Particles/thinParticleSystem.pure.js +2 -0
  658. package/Particles/thinParticleSystem.pure.js.map +1 -1
  659. package/Particles/webgl2ParticleSystem.pure.js +2 -0
  660. package/Particles/webgl2ParticleSystem.pure.js.map +1 -1
  661. package/Physics/v1/physicsImpostor.pure.js +4 -4
  662. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.pure.js +675 -656
  663. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.pure.js.map +1 -1
  664. package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.d.ts +0 -1
  665. package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.js +0 -1
  666. package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.js.map +1 -1
  667. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.pure.js +521 -486
  668. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.pure.js.map +1 -1
  669. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.d.ts +0 -1
  670. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js +0 -1
  671. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js.map +1 -1
  672. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.pure.js +241 -220
  673. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.pure.js.map +1 -1
  674. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.pure.js +852 -835
  675. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.pure.js.map +1 -1
  676. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.pure.js +1135 -1073
  677. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.pure.js.map +1 -1
  678. package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.pure.js +319 -303
  679. package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.pure.js.map +1 -1
  680. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js +212 -199
  681. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
  682. package/PostProcesses/blackAndWhitePostProcess.pure.js +67 -55
  683. package/PostProcesses/blackAndWhitePostProcess.pure.js.map +1 -1
  684. package/PostProcesses/bloomMergePostProcess.pure.js +74 -62
  685. package/PostProcesses/bloomMergePostProcess.pure.js.map +1 -1
  686. package/PostProcesses/blurPostProcess.pure.js +127 -115
  687. package/PostProcesses/blurPostProcess.pure.js.map +1 -1
  688. package/PostProcesses/chromaticAberrationPostProcess.pure.js +130 -118
  689. package/PostProcesses/chromaticAberrationPostProcess.pure.js.map +1 -1
  690. package/PostProcesses/circleOfConfusionPostProcess.pure.js +115 -104
  691. package/PostProcesses/circleOfConfusionPostProcess.pure.js.map +1 -1
  692. package/PostProcesses/colorCorrectionPostProcess.pure.js +55 -43
  693. package/PostProcesses/colorCorrectionPostProcess.pure.js.map +1 -1
  694. package/PostProcesses/convolutionPostProcess.pure.js +96 -84
  695. package/PostProcesses/convolutionPostProcess.pure.js.map +1 -1
  696. package/PostProcesses/extractHighlightsPostProcess.pure.js +68 -57
  697. package/PostProcesses/extractHighlightsPostProcess.pure.js.map +1 -1
  698. package/PostProcesses/filterPostProcess.pure.js +66 -54
  699. package/PostProcesses/filterPostProcess.pure.js.map +1 -1
  700. package/PostProcesses/fxaaPostProcess.pure.js.map +1 -1
  701. package/PostProcesses/grainPostProcess.pure.js +82 -70
  702. package/PostProcesses/grainPostProcess.pure.js.map +1 -1
  703. package/PostProcesses/imageProcessingPostProcess.js +334 -322
  704. package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
  705. package/PostProcesses/motionBlurPostProcess.pure.js +246 -235
  706. package/PostProcesses/motionBlurPostProcess.pure.js.map +1 -1
  707. package/PostProcesses/passPostProcess.pure.js +75 -63
  708. package/PostProcesses/passPostProcess.pure.js.map +1 -1
  709. package/PostProcesses/postProcess.pure.js +899 -835
  710. package/PostProcesses/postProcess.pure.js.map +1 -1
  711. package/PostProcesses/refractionPostProcess.pure.js +114 -87
  712. package/PostProcesses/refractionPostProcess.pure.js.map +1 -1
  713. package/PostProcesses/screenSpaceCurvaturePostProcess.pure.js +108 -96
  714. package/PostProcesses/screenSpaceCurvaturePostProcess.pure.js.map +1 -1
  715. package/PostProcesses/screenSpaceReflectionPostProcess.pure.js +241 -220
  716. package/PostProcesses/screenSpaceReflectionPostProcess.pure.js.map +1 -1
  717. package/PostProcesses/sharpenPostProcess.pure.js +86 -74
  718. package/PostProcesses/sharpenPostProcess.pure.js.map +1 -1
  719. package/PostProcesses/tonemapPostProcess.pure.js +82 -70
  720. package/PostProcesses/tonemapPostProcess.pure.js.map +1 -1
  721. package/PostProcesses/volumetricLightScatteringPostProcess.pure.js +500 -465
  722. package/PostProcesses/volumetricLightScatteringPostProcess.pure.js.map +1 -1
  723. package/PostProcesses/vrMultiviewToSingleviewPostProcess.d.ts +0 -1
  724. package/PostProcesses/vrMultiviewToSingleviewPostProcess.js +0 -1
  725. package/PostProcesses/vrMultiviewToSingleviewPostProcess.js.map +1 -1
  726. package/PostProcesses/vrMultiviewToSingleviewPostProcess.pure.js +2 -0
  727. package/PostProcesses/vrMultiviewToSingleviewPostProcess.pure.js.map +1 -1
  728. package/Probes/reflectionProbe.pure.js +238 -224
  729. package/Probes/reflectionProbe.pure.js.map +1 -1
  730. package/Rendering/GlobalIllumination/giRSMManager.pure.d.ts +1 -1
  731. package/Rendering/GlobalIllumination/giRSMManager.pure.js +138 -105
  732. package/Rendering/GlobalIllumination/giRSMManager.pure.js.map +1 -1
  733. package/Rendering/IBLShadows/iblShadowsPluginMaterial.pure.d.ts +1 -1
  734. package/Rendering/IBLShadows/iblShadowsPluginMaterial.pure.js +155 -138
  735. package/Rendering/IBLShadows/iblShadowsPluginMaterial.pure.js.map +1 -1
  736. package/Rendering/IBLShadows/iblShadowsRenderPipeline.d.ts +0 -2
  737. package/Rendering/IBLShadows/iblShadowsRenderPipeline.js +0 -2
  738. package/Rendering/IBLShadows/iblShadowsRenderPipeline.js.map +1 -1
  739. package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js +5 -0
  740. package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js.map +1 -1
  741. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.d.ts +0 -1
  742. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js +0 -1
  743. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js.map +1 -1
  744. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.d.ts +1 -0
  745. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js +34 -0
  746. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js.map +1 -1
  747. package/Rendering/edgesRenderer.pure.js.map +1 -1
  748. package/Rendering/prePassRenderer.d.ts +0 -2
  749. package/Rendering/prePassRenderer.js +0 -2
  750. package/Rendering/prePassRenderer.js.map +1 -1
  751. package/Rendering/prePassRenderer.pure.js +2 -0
  752. package/Rendering/prePassRenderer.pure.js.map +1 -1
  753. package/Rendering/reflectiveShadowMap.pure.d.ts +1 -1
  754. package/Rendering/reflectiveShadowMap.pure.js +151 -130
  755. package/Rendering/reflectiveShadowMap.pure.js.map +1 -1
  756. package/Rendering/thinDepthPeelingRenderer.d.ts +0 -1
  757. package/Rendering/thinDepthPeelingRenderer.js +0 -1
  758. package/Rendering/thinDepthPeelingRenderer.js.map +1 -1
  759. package/Shaders/ShadersInclude/gaussianSplatting.js +1 -0
  760. package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
  761. package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js +35 -5
  762. package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
  763. package/Shaders/gaussianSplatting.fragment.js +17 -1
  764. package/Shaders/gaussianSplatting.fragment.js.map +1 -1
  765. package/Shaders/gaussianSplatting.vertex.js +1 -1
  766. package/Shaders/gaussianSplatting.vertex.js.map +1 -1
  767. package/Shaders/gaussianSplattingDepth.vertex.js +1 -1
  768. package/Shaders/gaussianSplattingDepth.vertex.js.map +1 -1
  769. package/Shaders/picking.fragment.js +39 -3
  770. package/Shaders/picking.fragment.js.map +1 -1
  771. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +3 -1
  772. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
  773. package/ShadersWGSL/ShadersInclude/helperFunctions.js +2 -2
  774. package/ShadersWGSL/ShadersInclude/helperFunctions.js.map +1 -1
  775. package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js +39 -7
  776. package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
  777. package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js +4 -3
  778. package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js.map +1 -1
  779. package/ShadersWGSL/gaussianSplatting.fragment.js +14 -1
  780. package/ShadersWGSL/gaussianSplatting.fragment.js.map +1 -1
  781. package/ShadersWGSL/gaussianSplatting.vertex.js +2 -2
  782. package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
  783. package/ShadersWGSL/gaussianSplattingDepth.vertex.js +2 -2
  784. package/ShadersWGSL/gaussianSplattingDepth.vertex.js.map +1 -1
  785. package/ShadersWGSL/lightingVolume.compute.js +2 -2
  786. package/ShadersWGSL/lightingVolume.compute.js.map +1 -1
  787. package/ShadersWGSL/picking.fragment.js +22 -1
  788. package/ShadersWGSL/picking.fragment.js.map +1 -1
  789. package/XR/features/Layers/WebXRCompositionLayer.d.ts +3 -2
  790. package/XR/features/Layers/WebXRCompositionLayer.js +2 -2
  791. package/XR/features/Layers/WebXRCompositionLayer.js.map +1 -1
  792. package/XR/features/Layers/WebXRWebGPUCompositionLayer.d.ts +59 -0
  793. package/XR/features/Layers/WebXRWebGPUCompositionLayer.js +120 -0
  794. package/XR/features/Layers/WebXRWebGPUCompositionLayer.js.map +1 -0
  795. package/XR/features/Layers/WebXRWebGPUProjectionLayer.d.ts +25 -0
  796. package/XR/features/Layers/WebXRWebGPUProjectionLayer.js +69 -0
  797. package/XR/features/Layers/WebXRWebGPUProjectionLayer.js.map +1 -0
  798. package/XR/features/WebXRLayers.pure.d.ts +8 -0
  799. package/XR/features/WebXRLayers.pure.js +43 -6
  800. package/XR/features/WebXRLayers.pure.js.map +1 -1
  801. package/XR/native/nativeXRRenderTarget.d.ts +2 -2
  802. package/XR/native/nativeXRRenderTarget.js +2 -2
  803. package/XR/native/nativeXRRenderTarget.js.map +1 -1
  804. package/XR/webXRExperienceHelper.js +10 -1
  805. package/XR/webXRExperienceHelper.js.map +1 -1
  806. package/XR/webXRGraphicsBinding.d.ts +90 -0
  807. package/XR/webXRGraphicsBinding.js +85 -0
  808. package/XR/webXRGraphicsBinding.js.map +1 -0
  809. package/XR/webXRLayerRenderTargetTexture.d.ts +24 -0
  810. package/XR/webXRLayerRenderTargetTexture.js +30 -0
  811. package/XR/webXRLayerRenderTargetTexture.js.map +1 -0
  812. package/XR/webXRManagedOutputCanvas.d.ts +14 -0
  813. package/XR/webXRManagedOutputCanvas.js +24 -5
  814. package/XR/webXRManagedOutputCanvas.js.map +1 -1
  815. package/XR/webXRRenderTargetTextureProvider.d.ts +25 -4
  816. package/XR/webXRRenderTargetTextureProvider.js +33 -35
  817. package/XR/webXRRenderTargetTextureProvider.js.map +1 -1
  818. package/XR/webXRSessionManager.d.ts +11 -0
  819. package/XR/webXRSessionManager.js +37 -0
  820. package/XR/webXRSessionManager.js.map +1 -1
  821. package/XR/webXRTypes.d.ts +9 -6
  822. package/XR/webXRTypes.js.map +1 -1
  823. package/XR/webXRWebGLLayer.d.ts +2 -2
  824. package/XR/webXRWebGLLayer.js +2 -2
  825. package/XR/webXRWebGLLayer.js.map +1 -1
  826. package/XR/webXRWebGLRenderTargetTextureProvider.d.ts +12 -0
  827. package/XR/webXRWebGLRenderTargetTextureProvider.js +58 -0
  828. package/XR/webXRWebGLRenderTargetTextureProvider.js.map +1 -0
  829. package/XR/webXRWebGPURenderTargetTextureProvider.d.ts +69 -0
  830. package/XR/webXRWebGPURenderTargetTextureProvider.js +148 -0
  831. package/XR/webXRWebGPURenderTargetTextureProvider.js.map +1 -0
  832. package/index.d.ts +1 -0
  833. package/index.js +1 -0
  834. package/index.js.map +1 -1
  835. package/node.js +878 -845
  836. package/node.js.map +1 -1
  837. package/package.json +8 -14
  838. package/scene.pure.d.ts +12 -0
  839. package/scene.pure.js +36 -0
  840. package/scene.pure.js.map +1 -1
  841. package/tslib.es6.js +304 -150
@@ -1,6 +1,6 @@
1
1
  /** This file must only contain pure code and pure imports */
2
2
  var _a;
3
- import { __decorate } from "../../tslib.es6.js";
3
+ import { __esDecorate, __runInitializers } from "../../tslib.es6.js";
4
4
  import { serialize, serializeAsTexture } from "../../Misc/decorators.js";
5
5
  import { Observable } from "../../Misc/observable.pure.js";
6
6
  import { Matrix } from "../../Maths/math.vector.pure.js";
@@ -14,845 +14,900 @@ import { SerializationHelper } from "../../Misc/decorators.serialization.js";
14
14
  * It groups all the common properties the materials, post process, lights... might need
15
15
  * in order to make a correct use of the texture.
16
16
  */
17
- export class BaseTexture extends ThinTexture {
18
- /**
19
- * Indicates the texture is disposed now
20
- */
21
- get isDisposed() {
22
- return this._isDisposed;
23
- }
24
- /**
25
- * Define if the texture is having a usable alpha value (can be use for transparency or glossiness for instance).
26
- */
27
- set hasAlpha(value) {
28
- if (this._hasAlpha === value) {
29
- return;
30
- }
31
- this._hasAlpha = value;
32
- if (this._scene) {
33
- this._scene.markAllMaterialsAsDirty(1, (mat) => {
34
- return mat.hasTexture(this);
35
- });
36
- }
37
- }
38
- get hasAlpha() {
39
- return this._hasAlpha;
40
- }
41
- /**
42
- * Defines if the alpha value should be determined via the rgb values.
43
- * If true the luminance of the pixel might be used to find the corresponding alpha value.
44
- */
45
- set getAlphaFromRGB(value) {
46
- if (this._getAlphaFromRGB === value) {
47
- return;
48
- }
49
- this._getAlphaFromRGB = value;
50
- if (this._scene) {
51
- this._scene.markAllMaterialsAsDirty(1, (mat) => {
52
- return mat.hasTexture(this);
53
- });
54
- }
55
- }
56
- get getAlphaFromRGB() {
57
- return this._getAlphaFromRGB;
58
- }
59
- /**
60
- * Define the UV channel to use starting from 0 and defaulting to 0.
61
- * This is part of the texture as textures usually maps to one uv set.
62
- */
63
- set coordinatesIndex(value) {
64
- if (this._coordinatesIndex === value) {
65
- return;
66
- }
67
- this._coordinatesIndex = value;
68
- if (this._scene) {
69
- this._scene.markAllMaterialsAsDirty(1, (mat) => {
70
- return mat.hasTexture(this);
71
- });
72
- }
73
- }
74
- get coordinatesIndex() {
75
- return this._coordinatesIndex;
76
- }
77
- /**
78
- * How a texture is mapped.
79
- *
80
- * | Value | Type | Description |
81
- * | ----- | ----------------------------------- | ----------- |
82
- * | 0 | EXPLICIT_MODE | |
83
- * | 1 | SPHERICAL_MODE | |
84
- * | 2 | PLANAR_MODE | |
85
- * | 3 | CUBIC_MODE | |
86
- * | 4 | PROJECTION_MODE | |
87
- * | 5 | SKYBOX_MODE | |
88
- * | 6 | INVCUBIC_MODE | |
89
- * | 7 | EQUIRECTANGULAR_MODE | |
90
- * | 8 | FIXED_EQUIRECTANGULAR_MODE | |
91
- * | 9 | FIXED_EQUIRECTANGULAR_MIRRORED_MODE | |
92
- */
93
- set coordinatesMode(value) {
94
- if (this._coordinatesMode === value) {
95
- return;
96
- }
97
- this._coordinatesMode = value;
98
- if (this._scene) {
99
- this._scene.markAllMaterialsAsDirty(1, (mat) => {
100
- return mat.hasTexture(this);
101
- });
102
- }
103
- }
104
- get coordinatesMode() {
105
- return this._coordinatesMode;
106
- }
107
- /**
108
- * | Value | Type | Description |
109
- * | ----- | ------------------ | ----------- |
110
- * | 0 | CLAMP_ADDRESSMODE | |
111
- * | 1 | WRAP_ADDRESSMODE | |
112
- * | 2 | MIRROR_ADDRESSMODE | |
113
- */
114
- get wrapU() {
115
- return this._wrapU;
116
- }
117
- set wrapU(value) {
118
- this._wrapU = value;
119
- }
120
- /**
121
- * | Value | Type | Description |
122
- * | ----- | ------------------ | ----------- |
123
- * | 0 | CLAMP_ADDRESSMODE | |
124
- * | 1 | WRAP_ADDRESSMODE | |
125
- * | 2 | MIRROR_ADDRESSMODE | |
126
- */
127
- get wrapV() {
128
- return this._wrapV;
129
- }
130
- set wrapV(value) {
131
- this._wrapV = value;
132
- }
133
- /**
134
- * Define if the texture is a cube texture or if false a 2d texture.
135
- */
136
- get isCube() {
137
- if (!this._texture) {
138
- return this._isCube;
139
- }
140
- return this._texture.isCube;
141
- }
142
- // eslint-disable-next-line @typescript-eslint/naming-convention
143
- set isCube(value) {
144
- if (!this._texture) {
145
- this._isCube = value;
146
- }
147
- else {
148
- this._texture.isCube = value;
149
- }
150
- }
151
- /**
152
- * Define if the texture is a 3d texture (webgl 2) or if false a 2d texture.
153
- */
154
- get is3D() {
155
- if (!this._texture) {
156
- return false;
157
- }
158
- return this._texture.is3D;
159
- }
160
- // eslint-disable-next-line @typescript-eslint/naming-convention
161
- set is3D(value) {
162
- if (!this._texture) {
163
- return;
164
- }
165
- this._texture.is3D = value;
166
- }
167
- /**
168
- * Define if the texture is a 2d array texture (webgl 2) or if false a 2d texture.
169
- */
170
- get is2DArray() {
171
- if (!this._texture) {
172
- return false;
173
- }
174
- return this._texture.is2DArray;
175
- }
176
- // eslint-disable-next-line @typescript-eslint/naming-convention
177
- set is2DArray(value) {
178
- if (!this._texture) {
179
- return;
180
- }
181
- this._texture.is2DArray = value;
182
- }
183
- /**
184
- * Define if the texture contains data in gamma space (most of the png/jpg aside bump).
185
- * HDR texture are usually stored in linear space.
186
- * This only impacts the PBR and Background materials
187
- */
188
- get gammaSpace() {
189
- if (!this._texture) {
190
- return this._gammaSpace;
191
- }
192
- else {
193
- if (this._texture._gammaSpace === null) {
194
- this._texture._gammaSpace = this._gammaSpace;
195
- }
196
- }
197
- return this._texture._gammaSpace && !this._texture._useSRGBBuffer;
198
- }
199
- set gammaSpace(gamma) {
200
- if (!this._texture) {
201
- if (this._gammaSpace === gamma) {
202
- return;
203
- }
204
- this._gammaSpace = gamma;
205
- }
206
- else {
207
- if (this._texture._gammaSpace === gamma) {
208
- return;
209
- }
210
- this._texture._gammaSpace = gamma;
211
- }
212
- this.getScene()?.markAllMaterialsAsDirty(1, (mat) => {
213
- return mat.hasTexture(this);
214
- });
215
- }
216
- /**
217
- * Define gamma space which not affected by useSRGBBuffer
218
- */
219
- get currentGammaSpace() {
220
- if (!this._texture) {
221
- return this._gammaSpace;
222
- }
223
- else {
224
- if (this._texture._gammaSpace === null) {
225
- this._texture._gammaSpace = this._gammaSpace;
226
- }
227
- }
228
- return this._texture._gammaSpace;
229
- }
230
- set currentGammaSpace(gamma) {
231
- this.gammaSpace = gamma;
232
- }
233
- /**
234
- * Gets or sets whether or not the texture contains RGBD data.
235
- */
236
- get isRGBD() {
237
- return this._texture != null && this._texture._isRGBD;
238
- }
239
- set isRGBD(value) {
240
- if (value === this.isRGBD) {
241
- return;
242
- }
243
- if (this._texture) {
244
- this._texture._isRGBD = value;
245
- }
246
- this.getScene()?.markAllMaterialsAsDirty(1, (mat) => {
247
- return mat.hasTexture(this);
248
- });
249
- }
250
- /**
251
- * Are mip maps generated for this texture or not.
252
- */
253
- get noMipmap() {
254
- return false;
255
- }
256
- /**
257
- * With prefiltered texture, defined the offset used during the prefiltering steps.
258
- */
259
- get lodGenerationOffset() {
260
- if (this._texture) {
261
- return this._texture._lodGenerationOffset;
262
- }
263
- return 0.0;
264
- }
265
- set lodGenerationOffset(value) {
266
- if (this._texture) {
267
- this._texture._lodGenerationOffset = value;
268
- }
269
- }
270
- /**
271
- * With prefiltered texture, defined the scale used during the prefiltering steps.
272
- */
273
- get lodGenerationScale() {
274
- if (this._texture) {
275
- return this._texture._lodGenerationScale;
276
- }
277
- return 0.0;
278
- }
279
- set lodGenerationScale(value) {
280
- if (this._texture) {
281
- this._texture._lodGenerationScale = value;
282
- }
283
- }
284
- /**
285
- * With prefiltered texture, defined if the specular generation is based on a linear ramp.
286
- * By default we are using a log2 of the linear roughness helping to keep a better resolution for
287
- * average roughness values.
288
- */
289
- get linearSpecularLOD() {
290
- if (this._texture) {
291
- return this._texture._linearSpecularLOD;
292
- }
293
- return false;
294
- }
295
- set linearSpecularLOD(value) {
296
- if (this._texture) {
297
- this._texture._linearSpecularLOD = value;
298
- }
299
- }
300
- /**
301
- * In case a better definition than spherical harmonics is required for the diffuse part of the environment.
302
- * You can set the irradiance texture to rely on a texture instead of the spherical approach.
303
- * This texture need to have the same characteristics than its parent (Cube vs 2d, coordinates mode, Gamma/Linear, RGBD).
304
- */
305
- get irradianceTexture() {
306
- if (this._texture) {
307
- return this._texture._irradianceTexture;
308
- }
309
- return null;
310
- }
311
- set irradianceTexture(value) {
312
- if (this._texture) {
313
- this._texture._irradianceTexture = value;
314
- }
315
- }
316
- /**
317
- * Define the unique id of the texture in the scene.
318
- */
319
- get uid() {
320
- if (!this._uid) {
321
- this._uid = RandomGUID();
322
- }
323
- return this._uid;
324
- }
325
- /**
326
- * Return a string representation of the texture.
327
- * @returns the texture as a string
328
- */
329
- toString() {
330
- return this.name;
331
- }
332
- /**
333
- * Get the class name of the texture.
334
- * @returns "BaseTexture"
335
- */
336
- getClassName() {
337
- return "BaseTexture";
338
- }
339
- /**
340
- * Callback triggered when the texture has been disposed.
341
- * Kept for back compatibility, you can use the onDisposeObservable instead.
342
- */
343
- set onDispose(callback) {
344
- if (this._onDisposeObserver) {
345
- this.onDisposeObservable.remove(this._onDisposeObserver);
346
- }
347
- this._onDisposeObserver = this.onDisposeObservable.add(callback);
348
- }
349
- /**
350
- * Define if the texture is preventing a material to render or not.
351
- * If not and the texture is not ready, the engine will use a default black texture instead.
352
- */
353
- get isBlocking() {
354
- return true;
355
- }
356
- /**
357
- * Was there any loading error?
358
- */
359
- get loadingError() {
360
- return this._loadingError;
361
- }
362
- /**
363
- * If a loading error occurred this object will be populated with information about the error.
364
- */
365
- get errorObject() {
366
- return this._errorObject;
367
- }
368
- /**
369
- * Instantiates a new BaseTexture.
370
- * Base class of all the textures in babylon.
371
- * It groups all the common properties the materials, post process, lights... might need
372
- * in order to make a correct use of the texture.
373
- * @param sceneOrEngine Define the scene or engine the texture belongs to
374
- * @param internalTexture Define the internal texture associated with the texture
375
- */
376
- constructor(sceneOrEngine, internalTexture = null) {
377
- super(null);
378
- /**
379
- * Gets or sets an object used to store user defined information.
380
- */
381
- this.metadata = null;
382
- /**
383
- * For internal use only. Please do not use.
384
- */
385
- this.reservedDataStore = null;
386
- /**
387
- * For control if the texture should be serialized with material
388
- */
389
- this.doNotSerialize = false;
390
- this._isDisposed = false;
391
- this._hasAlpha = false;
392
- this._getAlphaFromRGB = false;
393
- /**
394
- * Intensity or strength of the texture.
395
- * It is commonly used by materials to fine tune the intensity of the texture
396
- */
397
- this.level = 1;
398
- this._coordinatesIndex = 0;
399
- /**
400
- * Gets or sets a boolean indicating that the texture should try to reduce shader code if there is no UV manipulation.
401
- * (ie. when texture.getTextureMatrix().isIdentityAs3x2() returns true)
402
- */
403
- this.optimizeUVAllocation = true;
404
- this._coordinatesMode = 0;
405
- /**
406
- * | Value | Type | Description |
407
- * | ----- | ------------------ | ----------- |
408
- * | 0 | CLAMP_ADDRESSMODE | |
409
- * | 1 | WRAP_ADDRESSMODE | |
410
- * | 2 | MIRROR_ADDRESSMODE | |
411
- */
412
- this.wrapR = 1;
413
- /**
414
- * With compliant hardware and browser (supporting anisotropic filtering)
415
- * this defines the level of anisotropic filtering in the texture.
416
- * The higher the better but the slower. This defaults to 4 as it seems to be the best tradeoff.
417
- */
418
- this.anisotropicFilteringLevel = BaseTexture.DEFAULT_ANISOTROPIC_FILTERING_LEVEL;
419
- /** @internal */
420
- this._isCube = false;
421
- /** @internal */
422
- this._gammaSpace = true;
423
- /**
424
- * Is Z inverted in the texture (useful in a cube texture).
425
- */
426
- this.invertZ = false;
427
- /**
428
- * @internal
429
- */
430
- this.lodLevelInAlpha = false;
431
- /**
432
- * Indicates the average direction of light in an environment map. This
433
- * can be treated as the most dominant direction but it's magnitude also
434
- * tells you something about how dominant that direction is.
435
- */
436
- /** @internal */
437
- this._dominantDirection = null;
438
- /**
439
- * Define if the texture is a render target.
440
- */
441
- this.isRenderTarget = false;
442
- /** @internal */
443
- this._prefiltered = false;
444
- /** @internal */
445
- this._forceSerialize = false;
446
- /**
447
- * Define the list of animation attached to the texture.
448
- */
449
- this.animations = [];
450
- /**
451
- * An event triggered when the texture is disposed.
452
- */
453
- this.onDisposeObservable = new Observable();
454
- this._onDisposeObserver = null;
455
- this._scene = null;
456
- /** @internal */
457
- this._uid = null;
458
- /** @internal */
459
- this._parentContainer = null;
460
- this._loadingError = false;
461
- if (sceneOrEngine) {
462
- if (BaseTexture._IsScene(sceneOrEngine)) {
463
- this._scene = sceneOrEngine;
464
- }
465
- else {
466
- this._engine = sceneOrEngine;
467
- }
468
- }
469
- else {
470
- this._scene = EngineStore.LastCreatedScene;
471
- }
472
- if (this._scene) {
473
- this.uniqueId = this._scene.getUniqueId();
474
- this._scene.addTexture(this);
475
- this._engine = this._scene.getEngine();
476
- }
477
- this._texture = internalTexture;
478
- this._uid = null;
479
- }
480
- /**
481
- * Get the scene the texture belongs to.
482
- * @returns the scene or null if undefined
483
- */
484
- getScene() {
485
- return this._scene;
486
- }
487
- /** @internal */
488
- _getEngine() {
489
- return this._engine;
490
- }
491
- /**
492
- * Get the texture transform matrix used to offset tile the texture for instance.
493
- * @returns the transformation matrix
494
- */
495
- getTextureMatrix() {
496
- return Matrix.IdentityReadOnly;
497
- }
498
- /**
499
- * Get the texture reflection matrix used to rotate/transform the reflection.
500
- * @returns the reflection matrix
501
- */
502
- getReflectionTextureMatrix() {
503
- return Matrix.IdentityReadOnly;
504
- }
505
- /**
506
- * Gets a suitable rotate/transform matrix when the texture is used for refraction.
507
- * There's a separate function from getReflectionTextureMatrix because refraction requires a special configuration of the matrix in right-handed mode.
508
- * @returns The refraction matrix
509
- */
510
- getRefractionTextureMatrix() {
511
- return this.getReflectionTextureMatrix();
512
- }
513
- /**
514
- * Get if the texture is ready to be consumed (either it is ready or it is not blocking)
515
- * @returns true if ready, not blocking or if there was an error loading the texture
516
- */
517
- isReadyOrNotBlocking() {
518
- return !this.isBlocking || this.isReady() || this.loadingError;
519
- }
520
- /**
521
- * Scales the texture if is `canRescale()`
522
- * @param ratio the resize factor we want to use to rescale
523
- */
524
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
525
- scale(ratio) { }
526
- /**
527
- * Get if the texture can rescale.
528
- */
529
- get canRescale() {
530
- return false;
531
- }
532
- /**
533
- * @internal
534
- */
535
- _getFromCache(url, noMipmap, sampling, invertY, useSRGBBuffer, isCube) {
536
- const engine = this._getEngine();
537
- if (!engine) {
538
- return null;
539
- }
540
- const correctedUseSRGBBuffer = engine._getUseSRGBBuffer(!!useSRGBBuffer, noMipmap);
541
- const texturesCache = engine.getLoadedTexturesCache();
542
- for (let index = 0; index < texturesCache.length; index++) {
543
- const texturesCacheEntry = texturesCache[index];
544
- if (useSRGBBuffer === undefined || correctedUseSRGBBuffer === texturesCacheEntry._useSRGBBuffer) {
545
- if (invertY === undefined || invertY === texturesCacheEntry.invertY) {
546
- if (texturesCacheEntry.url === url && texturesCacheEntry.generateMipMaps === !noMipmap) {
547
- if (!sampling || sampling === texturesCacheEntry.samplingMode) {
548
- if (isCube === undefined || isCube === texturesCacheEntry.isCube) {
549
- texturesCacheEntry.incrementReferences();
550
- return texturesCacheEntry;
17
+ let BaseTexture = (() => {
18
+ var _a;
19
+ let _classSuper = ThinTexture;
20
+ let _instanceExtraInitializers = [];
21
+ let _uniqueId_decorators;
22
+ let _uniqueId_initializers = [];
23
+ let _uniqueId_extraInitializers = [];
24
+ let _name_decorators;
25
+ let _name_initializers = [];
26
+ let _name_extraInitializers = [];
27
+ let _displayName_decorators;
28
+ let _displayName_initializers = [];
29
+ let _displayName_extraInitializers = [];
30
+ let _metadata_decorators;
31
+ let _metadata_initializers = [];
32
+ let _metadata_extraInitializers = [];
33
+ let __hasAlpha_decorators;
34
+ let __hasAlpha_initializers = [];
35
+ let __hasAlpha_extraInitializers = [];
36
+ let __getAlphaFromRGB_decorators;
37
+ let __getAlphaFromRGB_initializers = [];
38
+ let __getAlphaFromRGB_extraInitializers = [];
39
+ let _level_decorators;
40
+ let _level_initializers = [];
41
+ let _level_extraInitializers = [];
42
+ let __coordinatesIndex_decorators;
43
+ let __coordinatesIndex_initializers = [];
44
+ let __coordinatesIndex_extraInitializers = [];
45
+ let _optimizeUVAllocation_decorators;
46
+ let _optimizeUVAllocation_initializers = [];
47
+ let _optimizeUVAllocation_extraInitializers = [];
48
+ let __coordinatesMode_decorators;
49
+ let __coordinatesMode_initializers = [];
50
+ let __coordinatesMode_extraInitializers = [];
51
+ let _get_wrapU_decorators;
52
+ let _get_wrapV_decorators;
53
+ let _wrapR_decorators;
54
+ let _wrapR_initializers = [];
55
+ let _wrapR_extraInitializers = [];
56
+ let _anisotropicFilteringLevel_decorators;
57
+ let _anisotropicFilteringLevel_initializers = [];
58
+ let _anisotropicFilteringLevel_extraInitializers = [];
59
+ let _get_isCube_decorators;
60
+ let _get_is3D_decorators;
61
+ let _get_is2DArray_decorators;
62
+ let _get_gammaSpace_decorators;
63
+ let _get_currentGammaSpace_decorators;
64
+ let _invertZ_decorators;
65
+ let _invertZ_initializers = [];
66
+ let _invertZ_extraInitializers = [];
67
+ let _lodLevelInAlpha_decorators;
68
+ let _lodLevelInAlpha_initializers = [];
69
+ let _lodLevelInAlpha_extraInitializers = [];
70
+ let _get_lodGenerationOffset_decorators;
71
+ let _get_lodGenerationScale_decorators;
72
+ let _get_linearSpecularLOD_decorators;
73
+ let _get_irradianceTexture_decorators;
74
+ let _isRenderTarget_decorators;
75
+ let _isRenderTarget_initializers = [];
76
+ let _isRenderTarget_extraInitializers = [];
77
+ return _a = class BaseTexture extends _classSuper {
78
+ /**
79
+ * Indicates the texture is disposed now
80
+ */
81
+ get isDisposed() {
82
+ return this._isDisposed;
83
+ }
84
+ /**
85
+ * Define if the texture is having a usable alpha value (can be use for transparency or glossiness for instance).
86
+ */
87
+ set hasAlpha(value) {
88
+ if (this._hasAlpha === value) {
89
+ return;
90
+ }
91
+ this._hasAlpha = value;
92
+ if (this._scene) {
93
+ this._scene.markAllMaterialsAsDirty(1, (mat) => {
94
+ return mat.hasTexture(this);
95
+ });
96
+ }
97
+ }
98
+ get hasAlpha() {
99
+ return this._hasAlpha;
100
+ }
101
+ /**
102
+ * Defines if the alpha value should be determined via the rgb values.
103
+ * If true the luminance of the pixel might be used to find the corresponding alpha value.
104
+ */
105
+ set getAlphaFromRGB(value) {
106
+ if (this._getAlphaFromRGB === value) {
107
+ return;
108
+ }
109
+ this._getAlphaFromRGB = value;
110
+ if (this._scene) {
111
+ this._scene.markAllMaterialsAsDirty(1, (mat) => {
112
+ return mat.hasTexture(this);
113
+ });
114
+ }
115
+ }
116
+ get getAlphaFromRGB() {
117
+ return this._getAlphaFromRGB;
118
+ }
119
+ /**
120
+ * Define the UV channel to use starting from 0 and defaulting to 0.
121
+ * This is part of the texture as textures usually maps to one uv set.
122
+ */
123
+ set coordinatesIndex(value) {
124
+ if (this._coordinatesIndex === value) {
125
+ return;
126
+ }
127
+ this._coordinatesIndex = value;
128
+ if (this._scene) {
129
+ this._scene.markAllMaterialsAsDirty(1, (mat) => {
130
+ return mat.hasTexture(this);
131
+ });
132
+ }
133
+ }
134
+ get coordinatesIndex() {
135
+ return this._coordinatesIndex;
136
+ }
137
+ /**
138
+ * How a texture is mapped.
139
+ *
140
+ * | Value | Type | Description |
141
+ * | ----- | ----------------------------------- | ----------- |
142
+ * | 0 | EXPLICIT_MODE | |
143
+ * | 1 | SPHERICAL_MODE | |
144
+ * | 2 | PLANAR_MODE | |
145
+ * | 3 | CUBIC_MODE | |
146
+ * | 4 | PROJECTION_MODE | |
147
+ * | 5 | SKYBOX_MODE | |
148
+ * | 6 | INVCUBIC_MODE | |
149
+ * | 7 | EQUIRECTANGULAR_MODE | |
150
+ * | 8 | FIXED_EQUIRECTANGULAR_MODE | |
151
+ * | 9 | FIXED_EQUIRECTANGULAR_MIRRORED_MODE | |
152
+ */
153
+ set coordinatesMode(value) {
154
+ if (this._coordinatesMode === value) {
155
+ return;
156
+ }
157
+ this._coordinatesMode = value;
158
+ if (this._scene) {
159
+ this._scene.markAllMaterialsAsDirty(1, (mat) => {
160
+ return mat.hasTexture(this);
161
+ });
162
+ }
163
+ }
164
+ get coordinatesMode() {
165
+ return this._coordinatesMode;
166
+ }
167
+ /**
168
+ * | Value | Type | Description |
169
+ * | ----- | ------------------ | ----------- |
170
+ * | 0 | CLAMP_ADDRESSMODE | |
171
+ * | 1 | WRAP_ADDRESSMODE | |
172
+ * | 2 | MIRROR_ADDRESSMODE | |
173
+ */
174
+ get wrapU() {
175
+ return this._wrapU;
176
+ }
177
+ set wrapU(value) {
178
+ this._wrapU = value;
179
+ }
180
+ /**
181
+ * | Value | Type | Description |
182
+ * | ----- | ------------------ | ----------- |
183
+ * | 0 | CLAMP_ADDRESSMODE | |
184
+ * | 1 | WRAP_ADDRESSMODE | |
185
+ * | 2 | MIRROR_ADDRESSMODE | |
186
+ */
187
+ get wrapV() {
188
+ return this._wrapV;
189
+ }
190
+ set wrapV(value) {
191
+ this._wrapV = value;
192
+ }
193
+ /**
194
+ * Define if the texture is a cube texture or if false a 2d texture.
195
+ */
196
+ get isCube() {
197
+ if (!this._texture) {
198
+ return this._isCube;
199
+ }
200
+ return this._texture.isCube;
201
+ }
202
+ // eslint-disable-next-line @typescript-eslint/naming-convention
203
+ set isCube(value) {
204
+ if (!this._texture) {
205
+ this._isCube = value;
206
+ }
207
+ else {
208
+ this._texture.isCube = value;
209
+ }
210
+ }
211
+ /**
212
+ * Define if the texture is a 3d texture (webgl 2) or if false a 2d texture.
213
+ */
214
+ get is3D() {
215
+ if (!this._texture) {
216
+ return false;
217
+ }
218
+ return this._texture.is3D;
219
+ }
220
+ // eslint-disable-next-line @typescript-eslint/naming-convention
221
+ set is3D(value) {
222
+ if (!this._texture) {
223
+ return;
224
+ }
225
+ this._texture.is3D = value;
226
+ }
227
+ /**
228
+ * Define if the texture is a 2d array texture (webgl 2) or if false a 2d texture.
229
+ */
230
+ get is2DArray() {
231
+ if (!this._texture) {
232
+ return false;
233
+ }
234
+ return this._texture.is2DArray;
235
+ }
236
+ // eslint-disable-next-line @typescript-eslint/naming-convention
237
+ set is2DArray(value) {
238
+ if (!this._texture) {
239
+ return;
240
+ }
241
+ this._texture.is2DArray = value;
242
+ }
243
+ /**
244
+ * Define if the texture contains data in gamma space (most of the png/jpg aside bump).
245
+ * HDR texture are usually stored in linear space.
246
+ * This only impacts the PBR and Background materials
247
+ */
248
+ get gammaSpace() {
249
+ if (!this._texture) {
250
+ return this._gammaSpace;
251
+ }
252
+ else {
253
+ if (this._texture._gammaSpace === null) {
254
+ this._texture._gammaSpace = this._gammaSpace;
255
+ }
256
+ }
257
+ return this._texture._gammaSpace && !this._texture._useSRGBBuffer;
258
+ }
259
+ set gammaSpace(gamma) {
260
+ if (!this._texture) {
261
+ if (this._gammaSpace === gamma) {
262
+ return;
263
+ }
264
+ this._gammaSpace = gamma;
265
+ }
266
+ else {
267
+ if (this._texture._gammaSpace === gamma) {
268
+ return;
269
+ }
270
+ this._texture._gammaSpace = gamma;
271
+ }
272
+ this.getScene()?.markAllMaterialsAsDirty(1, (mat) => {
273
+ return mat.hasTexture(this);
274
+ });
275
+ }
276
+ /**
277
+ * Define gamma space which not affected by useSRGBBuffer
278
+ */
279
+ get currentGammaSpace() {
280
+ if (!this._texture) {
281
+ return this._gammaSpace;
282
+ }
283
+ else {
284
+ if (this._texture._gammaSpace === null) {
285
+ this._texture._gammaSpace = this._gammaSpace;
286
+ }
287
+ }
288
+ return this._texture._gammaSpace;
289
+ }
290
+ set currentGammaSpace(gamma) {
291
+ this.gammaSpace = gamma;
292
+ }
293
+ /**
294
+ * Gets or sets whether or not the texture contains RGBD data.
295
+ */
296
+ get isRGBD() {
297
+ return this._texture != null && this._texture._isRGBD;
298
+ }
299
+ set isRGBD(value) {
300
+ if (value === this.isRGBD) {
301
+ return;
302
+ }
303
+ if (this._texture) {
304
+ this._texture._isRGBD = value;
305
+ }
306
+ this.getScene()?.markAllMaterialsAsDirty(1, (mat) => {
307
+ return mat.hasTexture(this);
308
+ });
309
+ }
310
+ /**
311
+ * Are mip maps generated for this texture or not.
312
+ */
313
+ get noMipmap() {
314
+ return false;
315
+ }
316
+ /**
317
+ * With prefiltered texture, defined the offset used during the prefiltering steps.
318
+ */
319
+ get lodGenerationOffset() {
320
+ if (this._texture) {
321
+ return this._texture._lodGenerationOffset;
322
+ }
323
+ return 0.0;
324
+ }
325
+ set lodGenerationOffset(value) {
326
+ if (this._texture) {
327
+ this._texture._lodGenerationOffset = value;
328
+ }
329
+ }
330
+ /**
331
+ * With prefiltered texture, defined the scale used during the prefiltering steps.
332
+ */
333
+ get lodGenerationScale() {
334
+ if (this._texture) {
335
+ return this._texture._lodGenerationScale;
336
+ }
337
+ return 0.0;
338
+ }
339
+ set lodGenerationScale(value) {
340
+ if (this._texture) {
341
+ this._texture._lodGenerationScale = value;
342
+ }
343
+ }
344
+ /**
345
+ * With prefiltered texture, defined if the specular generation is based on a linear ramp.
346
+ * By default we are using a log2 of the linear roughness helping to keep a better resolution for
347
+ * average roughness values.
348
+ */
349
+ get linearSpecularLOD() {
350
+ if (this._texture) {
351
+ return this._texture._linearSpecularLOD;
352
+ }
353
+ return false;
354
+ }
355
+ set linearSpecularLOD(value) {
356
+ if (this._texture) {
357
+ this._texture._linearSpecularLOD = value;
358
+ }
359
+ }
360
+ /**
361
+ * In case a better definition than spherical harmonics is required for the diffuse part of the environment.
362
+ * You can set the irradiance texture to rely on a texture instead of the spherical approach.
363
+ * This texture need to have the same characteristics than its parent (Cube vs 2d, coordinates mode, Gamma/Linear, RGBD).
364
+ */
365
+ get irradianceTexture() {
366
+ if (this._texture) {
367
+ return this._texture._irradianceTexture;
368
+ }
369
+ return null;
370
+ }
371
+ set irradianceTexture(value) {
372
+ if (this._texture) {
373
+ this._texture._irradianceTexture = value;
374
+ }
375
+ }
376
+ /**
377
+ * Define the unique id of the texture in the scene.
378
+ */
379
+ get uid() {
380
+ if (!this._uid) {
381
+ this._uid = RandomGUID();
382
+ }
383
+ return this._uid;
384
+ }
385
+ /**
386
+ * Return a string representation of the texture.
387
+ * @returns the texture as a string
388
+ */
389
+ toString() {
390
+ return this.name;
391
+ }
392
+ /**
393
+ * Get the class name of the texture.
394
+ * @returns "BaseTexture"
395
+ */
396
+ getClassName() {
397
+ return "BaseTexture";
398
+ }
399
+ /**
400
+ * Callback triggered when the texture has been disposed.
401
+ * Kept for back compatibility, you can use the onDisposeObservable instead.
402
+ */
403
+ set onDispose(callback) {
404
+ if (this._onDisposeObserver) {
405
+ this.onDisposeObservable.remove(this._onDisposeObserver);
406
+ }
407
+ this._onDisposeObserver = this.onDisposeObservable.add(callback);
408
+ }
409
+ /**
410
+ * Define if the texture is preventing a material to render or not.
411
+ * If not and the texture is not ready, the engine will use a default black texture instead.
412
+ */
413
+ get isBlocking() {
414
+ return true;
415
+ }
416
+ /**
417
+ * Was there any loading error?
418
+ */
419
+ get loadingError() {
420
+ return this._loadingError;
421
+ }
422
+ /**
423
+ * If a loading error occurred this object will be populated with information about the error.
424
+ */
425
+ get errorObject() {
426
+ return this._errorObject;
427
+ }
428
+ /**
429
+ * Instantiates a new BaseTexture.
430
+ * Base class of all the textures in babylon.
431
+ * It groups all the common properties the materials, post process, lights... might need
432
+ * in order to make a correct use of the texture.
433
+ * @param sceneOrEngine Define the scene or engine the texture belongs to
434
+ * @param internalTexture Define the internal texture associated with the texture
435
+ */
436
+ constructor(sceneOrEngine, internalTexture = null) {
437
+ super(null);
438
+ /**
439
+ * Gets or sets the unique id of the texture
440
+ */
441
+ this.uniqueId = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _uniqueId_initializers, void 0));
442
+ /**
443
+ * Define the name of the texture.
444
+ */
445
+ this.name = (__runInitializers(this, _uniqueId_extraInitializers), __runInitializers(this, _name_initializers, void 0));
446
+ /**
447
+ * Define the display name of the texture, which is used as tree item name of the dedicated node in the inspector
448
+ */
449
+ this.displayName = (__runInitializers(this, _name_extraInitializers), __runInitializers(this, _displayName_initializers, void 0));
450
+ /**
451
+ * Gets or sets an object used to store user defined information.
452
+ */
453
+ this.metadata = (__runInitializers(this, _displayName_extraInitializers), __runInitializers(this, _metadata_initializers, null));
454
+ /** @internal */
455
+ this._internalMetadata = __runInitializers(this, _metadata_extraInitializers);
456
+ /**
457
+ * For internal use only. Please do not use.
458
+ */
459
+ this.reservedDataStore = null;
460
+ /**
461
+ * For control if the texture should be serialized with material
462
+ */
463
+ this.doNotSerialize = false;
464
+ this._isDisposed = false;
465
+ this._hasAlpha = __runInitializers(this, __hasAlpha_initializers, false);
466
+ this._getAlphaFromRGB = (__runInitializers(this, __hasAlpha_extraInitializers), __runInitializers(this, __getAlphaFromRGB_initializers, false));
467
+ /**
468
+ * Intensity or strength of the texture.
469
+ * It is commonly used by materials to fine tune the intensity of the texture
470
+ */
471
+ this.level = (__runInitializers(this, __getAlphaFromRGB_extraInitializers), __runInitializers(this, _level_initializers, 1));
472
+ this._coordinatesIndex = (__runInitializers(this, _level_extraInitializers), __runInitializers(this, __coordinatesIndex_initializers, 0));
473
+ /**
474
+ * Gets or sets a boolean indicating that the texture should try to reduce shader code if there is no UV manipulation.
475
+ * (ie. when texture.getTextureMatrix().isIdentityAs3x2() returns true)
476
+ */
477
+ this.optimizeUVAllocation = (__runInitializers(this, __coordinatesIndex_extraInitializers), __runInitializers(this, _optimizeUVAllocation_initializers, true));
478
+ this._coordinatesMode = (__runInitializers(this, _optimizeUVAllocation_extraInitializers), __runInitializers(this, __coordinatesMode_initializers, 0));
479
+ /**
480
+ * | Value | Type | Description |
481
+ * | ----- | ------------------ | ----------- |
482
+ * | 0 | CLAMP_ADDRESSMODE | |
483
+ * | 1 | WRAP_ADDRESSMODE | |
484
+ * | 2 | MIRROR_ADDRESSMODE | |
485
+ */
486
+ this.wrapR = (__runInitializers(this, __coordinatesMode_extraInitializers), __runInitializers(this, _wrapR_initializers, 1));
487
+ /**
488
+ * With compliant hardware and browser (supporting anisotropic filtering)
489
+ * this defines the level of anisotropic filtering in the texture.
490
+ * The higher the better but the slower. This defaults to 4 as it seems to be the best tradeoff.
491
+ */
492
+ this.anisotropicFilteringLevel = (__runInitializers(this, _wrapR_extraInitializers), __runInitializers(this, _anisotropicFilteringLevel_initializers, _a.DEFAULT_ANISOTROPIC_FILTERING_LEVEL));
493
+ /** @internal */
494
+ this._isCube = (__runInitializers(this, _anisotropicFilteringLevel_extraInitializers), false);
495
+ /** @internal */
496
+ this._gammaSpace = true;
497
+ /**
498
+ * Is Z inverted in the texture (useful in a cube texture).
499
+ */
500
+ this.invertZ = __runInitializers(this, _invertZ_initializers, false);
501
+ /**
502
+ * @internal
503
+ */
504
+ this.lodLevelInAlpha = (__runInitializers(this, _invertZ_extraInitializers), __runInitializers(this, _lodLevelInAlpha_initializers, false));
505
+ /**
506
+ * Indicates the average direction of light in an environment map. This
507
+ * can be treated as the most dominant direction but it's magnitude also
508
+ * tells you something about how dominant that direction is.
509
+ */
510
+ /** @internal */
511
+ this._dominantDirection = (__runInitializers(this, _lodLevelInAlpha_extraInitializers), null);
512
+ /**
513
+ * Define if the texture is a render target.
514
+ */
515
+ this.isRenderTarget = __runInitializers(this, _isRenderTarget_initializers, false);
516
+ /** @internal */
517
+ this._prefiltered = (__runInitializers(this, _isRenderTarget_extraInitializers), false);
518
+ /** @internal */
519
+ this._forceSerialize = false;
520
+ /**
521
+ * Define the list of animation attached to the texture.
522
+ */
523
+ this.animations = [];
524
+ /**
525
+ * An event triggered when the texture is disposed.
526
+ */
527
+ this.onDisposeObservable = new Observable();
528
+ this._onDisposeObserver = null;
529
+ this._scene = null;
530
+ /** @internal */
531
+ this._uid = null;
532
+ /** @internal */
533
+ this._parentContainer = null;
534
+ this._loadingError = false;
535
+ if (sceneOrEngine) {
536
+ if (_a._IsScene(sceneOrEngine)) {
537
+ this._scene = sceneOrEngine;
538
+ }
539
+ else {
540
+ this._engine = sceneOrEngine;
541
+ }
542
+ }
543
+ else {
544
+ this._scene = EngineStore.LastCreatedScene;
545
+ }
546
+ if (this._scene) {
547
+ this.uniqueId = this._scene.getUniqueId();
548
+ this._scene.addTexture(this);
549
+ this._engine = this._scene.getEngine();
550
+ }
551
+ this._texture = internalTexture;
552
+ this._uid = null;
553
+ }
554
+ /**
555
+ * Get the scene the texture belongs to.
556
+ * @returns the scene or null if undefined
557
+ */
558
+ getScene() {
559
+ return this._scene;
560
+ }
561
+ /** @internal */
562
+ _getEngine() {
563
+ return this._engine;
564
+ }
565
+ /**
566
+ * Get the texture transform matrix used to offset tile the texture for instance.
567
+ * @returns the transformation matrix
568
+ */
569
+ getTextureMatrix() {
570
+ return Matrix.IdentityReadOnly;
571
+ }
572
+ /**
573
+ * Get the texture reflection matrix used to rotate/transform the reflection.
574
+ * @returns the reflection matrix
575
+ */
576
+ getReflectionTextureMatrix() {
577
+ return Matrix.IdentityReadOnly;
578
+ }
579
+ /**
580
+ * Gets a suitable rotate/transform matrix when the texture is used for refraction.
581
+ * There's a separate function from getReflectionTextureMatrix because refraction requires a special configuration of the matrix in right-handed mode.
582
+ * @returns The refraction matrix
583
+ */
584
+ getRefractionTextureMatrix() {
585
+ return this.getReflectionTextureMatrix();
586
+ }
587
+ /**
588
+ * Get if the texture is ready to be consumed (either it is ready or it is not blocking)
589
+ * @returns true if ready, not blocking or if there was an error loading the texture
590
+ */
591
+ isReadyOrNotBlocking() {
592
+ return !this.isBlocking || this.isReady() || this.loadingError;
593
+ }
594
+ /**
595
+ * Scales the texture if is `canRescale()`
596
+ * @param ratio the resize factor we want to use to rescale
597
+ */
598
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
599
+ scale(ratio) { }
600
+ /**
601
+ * Get if the texture can rescale.
602
+ */
603
+ get canRescale() {
604
+ return false;
605
+ }
606
+ /**
607
+ * @internal
608
+ */
609
+ _getFromCache(url, noMipmap, sampling, invertY, useSRGBBuffer, isCube) {
610
+ const engine = this._getEngine();
611
+ if (!engine) {
612
+ return null;
613
+ }
614
+ const correctedUseSRGBBuffer = engine._getUseSRGBBuffer(!!useSRGBBuffer, noMipmap);
615
+ const texturesCache = engine.getLoadedTexturesCache();
616
+ for (let index = 0; index < texturesCache.length; index++) {
617
+ const texturesCacheEntry = texturesCache[index];
618
+ if (useSRGBBuffer === undefined || correctedUseSRGBBuffer === texturesCacheEntry._useSRGBBuffer) {
619
+ if (invertY === undefined || invertY === texturesCacheEntry.invertY) {
620
+ if (texturesCacheEntry.url === url && texturesCacheEntry.generateMipMaps === !noMipmap) {
621
+ if (!sampling || sampling === texturesCacheEntry.samplingMode) {
622
+ if (isCube === undefined || isCube === texturesCacheEntry.isCube) {
623
+ texturesCacheEntry.incrementReferences();
624
+ return texturesCacheEntry;
625
+ }
626
+ }
551
627
  }
552
628
  }
553
629
  }
554
630
  }
631
+ return null;
632
+ }
633
+ /** @internal */
634
+ _rebuild(_fromContextLost = false) { }
635
+ /**
636
+ * Clones the texture.
637
+ * @returns the cloned texture
638
+ */
639
+ clone() {
640
+ return null;
555
641
  }
556
- }
557
- return null;
558
- }
559
- /** @internal */
560
- _rebuild(_fromContextLost = false) { }
561
- /**
562
- * Clones the texture.
563
- * @returns the cloned texture
564
- */
565
- clone() {
566
- return null;
567
- }
568
- /**
569
- * Get the texture underlying type (INT, FLOAT...)
570
- */
571
- get textureType() {
572
- if (!this._texture) {
573
- return 0;
574
- }
575
- return this._texture.type !== undefined ? this._texture.type : 0;
576
- }
577
- /**
578
- * Get the texture underlying format (RGB, RGBA...)
579
- */
580
- get textureFormat() {
581
- if (!this._texture) {
582
- return 5;
583
- }
584
- return this._texture.format !== undefined ? this._texture.format : 5;
585
- }
586
- /**
587
- * Indicates that textures need to be re-calculated for all materials
588
- */
589
- _markAllSubMeshesAsTexturesDirty() {
590
- const scene = this.getScene();
591
- if (!scene) {
592
- return;
593
- }
594
- scene.markAllMaterialsAsDirty(1);
595
- }
596
- /**
597
- * Reads the pixels stored in the webgl texture and returns them as an ArrayBuffer.
598
- * This will returns an RGBA array buffer containing either in values (0-255) or
599
- * float values (0-1) depending of the underlying buffer type.
600
- * Note that you can use {@link GetTextureDataAsync} instead, which will also support reading from a compressed texture (by rendering it to an intermediate RGBA texture and retrieving the bytes from it).
601
- * @param faceIndex defines the face of the texture to read (in case of cube texture)
602
- * @param level defines the LOD level of the texture to read (in case of Mip Maps)
603
- * @param buffer defines a user defined buffer to fill with data (can be null)
604
- * @param flushRenderer true to flush the renderer from the pending commands before reading the pixels
605
- * @param noDataConversion false to convert the data to Uint8Array (if texture type is UNSIGNED_BYTE) or to Float32Array (if texture type is anything but UNSIGNED_BYTE). If true, the type of the generated buffer (if buffer==null) will depend on the type of the texture
606
- * @param x defines the region x coordinates to start reading from (default to 0)
607
- * @param y defines the region y coordinates to start reading from (default to 0)
608
- * @param width defines the region width to read from (default to the texture size at level)
609
- * @param height defines the region width to read from (default to the texture size at level)
610
- * @returns The Array buffer promise containing the pixels data.
611
- */
612
- readPixels(faceIndex = 0, level = 0, buffer = null, flushRenderer = true, noDataConversion = false, x = 0, y = 0, width = Number.MAX_VALUE, height = Number.MAX_VALUE) {
613
- if (!this._texture) {
614
- return null;
615
- }
616
- const engine = this._getEngine();
617
- if (!engine) {
618
- return null;
619
- }
620
- const size = this.getSize();
621
- let maxWidth = size.width;
622
- let maxHeight = size.height;
623
- if (level !== 0) {
624
- maxWidth = maxWidth / Math.pow(2, level);
625
- maxHeight = maxHeight / Math.pow(2, level);
626
- maxWidth = Math.round(maxWidth);
627
- maxHeight = Math.round(maxHeight);
628
- }
629
- width = Math.min(maxWidth, width);
630
- height = Math.min(maxHeight, height);
631
- try {
632
- if (this._texture.isCube || this._texture.is2DArray) {
633
- return engine._readTexturePixels(this._texture, width, height, faceIndex, level, buffer, flushRenderer, noDataConversion, x, y);
634
- }
635
- return engine._readTexturePixels(this._texture, width, height, -1, level, buffer, flushRenderer, noDataConversion, x, y);
636
- }
637
- catch (e) {
638
- return null;
639
- }
640
- }
641
- /**
642
- * @internal
643
- */
644
- _readPixelsSync(faceIndex = 0, level = 0, buffer = null, flushRenderer = true, noDataConversion = false) {
645
- if (!this._texture) {
646
- return null;
647
- }
648
- const size = this.getSize();
649
- let width = size.width;
650
- let height = size.height;
651
- const engine = this._getEngine();
652
- if (!engine) {
653
- return null;
654
- }
655
- if (level != 0) {
656
- width = width / Math.pow(2, level);
657
- height = height / Math.pow(2, level);
658
- width = Math.round(width);
659
- height = Math.round(height);
660
- }
661
- try {
662
- if (this._texture.isCube) {
663
- return engine._readTexturePixelsSync(this._texture, width, height, faceIndex, level, buffer, flushRenderer, noDataConversion);
664
- }
665
- return engine._readTexturePixelsSync(this._texture, width, height, -1, level, buffer, flushRenderer, noDataConversion);
666
- }
667
- catch (e) {
668
- return null;
669
- }
670
- }
671
- /** @internal */
672
- get _lodTextureHigh() {
673
- if (this._texture) {
674
- return this._texture._lodTextureHigh;
675
- }
676
- return null;
677
- }
678
- /** @internal */
679
- get _lodTextureMid() {
680
- if (this._texture) {
681
- return this._texture._lodTextureMid;
682
- }
683
- return null;
684
- }
685
- /** @internal */
686
- get _lodTextureLow() {
687
- if (this._texture) {
688
- return this._texture._lodTextureLow;
689
- }
690
- return null;
691
- }
692
- /**
693
- * Dispose the texture and release its associated resources.
694
- */
695
- dispose() {
696
- if (this._scene) {
697
- // Animations
698
- if (this._scene.stopAnimation) {
699
- this._scene.stopAnimation(this);
700
- }
701
- // Remove from scene
702
- this._scene.removePendingData(this);
703
- this._scene.removeTexture(this);
704
- this._scene = null;
705
- if (this._parentContainer) {
706
- const index = this._parentContainer.textures.indexOf(this);
707
- if (index > -1) {
708
- this._parentContainer.textures.splice(index, 1);
642
+ /**
643
+ * Get the texture underlying type (INT, FLOAT...)
644
+ */
645
+ get textureType() {
646
+ if (!this._texture) {
647
+ return 0;
709
648
  }
710
- this._parentContainer = null;
649
+ return this._texture.type !== undefined ? this._texture.type : 0;
711
650
  }
712
- }
713
- // Callback
714
- this.onDisposeObservable.notifyObservers(this);
715
- this.onDisposeObservable.clear();
716
- this.metadata = null;
717
- this._isDisposed = true;
718
- super.dispose();
719
- }
720
- /**
721
- * Serialize the texture into a JSON representation that can be parsed later on.
722
- * @param allowEmptyName True to force serialization even if name is empty. Default: false
723
- * @returns the JSON representation of the texture
724
- */
725
- serialize(allowEmptyName = false) {
726
- if (!this.name && !allowEmptyName) {
727
- return null;
728
- }
729
- const serializationObject = SerializationHelper.Serialize(this);
730
- // Animations
731
- SerializationHelper.AppendSerializedAnimations(this, serializationObject);
732
- return serializationObject;
733
- }
734
- /**
735
- * Helper function to be called back once a list of texture contains only ready textures.
736
- * @param textures Define the list of textures to wait for
737
- * @param callback Define the callback triggered once the entire list will be ready
738
- */
739
- static WhenAllReady(textures, callback) {
740
- let numRemaining = textures.length;
741
- if (numRemaining === 0) {
742
- callback();
743
- return;
744
- }
745
- for (let i = 0; i < textures.length; i++) {
746
- const texture = textures[i];
747
- if (texture.isReady()) {
748
- if (--numRemaining === 0) {
749
- callback();
651
+ /**
652
+ * Get the texture underlying format (RGB, RGBA...)
653
+ */
654
+ get textureFormat() {
655
+ if (!this._texture) {
656
+ return 5;
750
657
  }
658
+ return this._texture.format !== undefined ? this._texture.format : 5;
751
659
  }
752
- else {
753
- const onLoadObservable = texture.onLoadObservable;
754
- if (onLoadObservable) {
755
- onLoadObservable.addOnce(() => {
660
+ /**
661
+ * Indicates that textures need to be re-calculated for all materials
662
+ */
663
+ _markAllSubMeshesAsTexturesDirty() {
664
+ const scene = this.getScene();
665
+ if (!scene) {
666
+ return;
667
+ }
668
+ scene.markAllMaterialsAsDirty(1);
669
+ }
670
+ /**
671
+ * Reads the pixels stored in the webgl texture and returns them as an ArrayBuffer.
672
+ * This will returns an RGBA array buffer containing either in values (0-255) or
673
+ * float values (0-1) depending of the underlying buffer type.
674
+ * Note that you can use {@link GetTextureDataAsync} instead, which will also support reading from a compressed texture (by rendering it to an intermediate RGBA texture and retrieving the bytes from it).
675
+ * @param faceIndex defines the face of the texture to read (in case of cube texture)
676
+ * @param level defines the LOD level of the texture to read (in case of Mip Maps)
677
+ * @param buffer defines a user defined buffer to fill with data (can be null)
678
+ * @param flushRenderer true to flush the renderer from the pending commands before reading the pixels
679
+ * @param noDataConversion false to convert the data to Uint8Array (if texture type is UNSIGNED_BYTE) or to Float32Array (if texture type is anything but UNSIGNED_BYTE). If true, the type of the generated buffer (if buffer==null) will depend on the type of the texture
680
+ * @param x defines the region x coordinates to start reading from (default to 0)
681
+ * @param y defines the region y coordinates to start reading from (default to 0)
682
+ * @param width defines the region width to read from (default to the texture size at level)
683
+ * @param height defines the region width to read from (default to the texture size at level)
684
+ * @returns The Array buffer promise containing the pixels data.
685
+ */
686
+ readPixels(faceIndex = 0, level = 0, buffer = null, flushRenderer = true, noDataConversion = false, x = 0, y = 0, width = Number.MAX_VALUE, height = Number.MAX_VALUE) {
687
+ if (!this._texture) {
688
+ return null;
689
+ }
690
+ const engine = this._getEngine();
691
+ if (!engine) {
692
+ return null;
693
+ }
694
+ const size = this.getSize();
695
+ let maxWidth = size.width;
696
+ let maxHeight = size.height;
697
+ if (level !== 0) {
698
+ maxWidth = maxWidth / Math.pow(2, level);
699
+ maxHeight = maxHeight / Math.pow(2, level);
700
+ maxWidth = Math.round(maxWidth);
701
+ maxHeight = Math.round(maxHeight);
702
+ }
703
+ width = Math.min(maxWidth, width);
704
+ height = Math.min(maxHeight, height);
705
+ try {
706
+ if (this._texture.isCube || this._texture.is2DArray) {
707
+ return engine._readTexturePixels(this._texture, width, height, faceIndex, level, buffer, flushRenderer, noDataConversion, x, y);
708
+ }
709
+ return engine._readTexturePixels(this._texture, width, height, -1, level, buffer, flushRenderer, noDataConversion, x, y);
710
+ }
711
+ catch (e) {
712
+ return null;
713
+ }
714
+ }
715
+ /**
716
+ * @internal
717
+ */
718
+ _readPixelsSync(faceIndex = 0, level = 0, buffer = null, flushRenderer = true, noDataConversion = false) {
719
+ if (!this._texture) {
720
+ return null;
721
+ }
722
+ const size = this.getSize();
723
+ let width = size.width;
724
+ let height = size.height;
725
+ const engine = this._getEngine();
726
+ if (!engine) {
727
+ return null;
728
+ }
729
+ if (level != 0) {
730
+ width = width / Math.pow(2, level);
731
+ height = height / Math.pow(2, level);
732
+ width = Math.round(width);
733
+ height = Math.round(height);
734
+ }
735
+ try {
736
+ if (this._texture.isCube) {
737
+ return engine._readTexturePixelsSync(this._texture, width, height, faceIndex, level, buffer, flushRenderer, noDataConversion);
738
+ }
739
+ return engine._readTexturePixelsSync(this._texture, width, height, -1, level, buffer, flushRenderer, noDataConversion);
740
+ }
741
+ catch (e) {
742
+ return null;
743
+ }
744
+ }
745
+ /** @internal */
746
+ get _lodTextureHigh() {
747
+ if (this._texture) {
748
+ return this._texture._lodTextureHigh;
749
+ }
750
+ return null;
751
+ }
752
+ /** @internal */
753
+ get _lodTextureMid() {
754
+ if (this._texture) {
755
+ return this._texture._lodTextureMid;
756
+ }
757
+ return null;
758
+ }
759
+ /** @internal */
760
+ get _lodTextureLow() {
761
+ if (this._texture) {
762
+ return this._texture._lodTextureLow;
763
+ }
764
+ return null;
765
+ }
766
+ /**
767
+ * Dispose the texture and release its associated resources.
768
+ */
769
+ dispose() {
770
+ if (this._scene) {
771
+ // Animations
772
+ if (this._scene.stopAnimation) {
773
+ this._scene.stopAnimation(this);
774
+ }
775
+ // Remove from scene
776
+ this._scene.removePendingData(this);
777
+ this._scene.removeTexture(this);
778
+ this._scene = null;
779
+ if (this._parentContainer) {
780
+ const index = this._parentContainer.textures.indexOf(this);
781
+ if (index > -1) {
782
+ this._parentContainer.textures.splice(index, 1);
783
+ }
784
+ this._parentContainer = null;
785
+ }
786
+ }
787
+ // Callback
788
+ this.onDisposeObservable.notifyObservers(this);
789
+ this.onDisposeObservable.clear();
790
+ this.metadata = null;
791
+ this._isDisposed = true;
792
+ super.dispose();
793
+ }
794
+ /**
795
+ * Serialize the texture into a JSON representation that can be parsed later on.
796
+ * @param allowEmptyName True to force serialization even if name is empty. Default: false
797
+ * @returns the JSON representation of the texture
798
+ */
799
+ serialize(allowEmptyName = false) {
800
+ if (!this.name && !allowEmptyName) {
801
+ return null;
802
+ }
803
+ const serializationObject = SerializationHelper.Serialize(this);
804
+ // Animations
805
+ SerializationHelper.AppendSerializedAnimations(this, serializationObject);
806
+ return serializationObject;
807
+ }
808
+ /**
809
+ * Helper function to be called back once a list of texture contains only ready textures.
810
+ * @param textures Define the list of textures to wait for
811
+ * @param callback Define the callback triggered once the entire list will be ready
812
+ */
813
+ static WhenAllReady(textures, callback) {
814
+ let numRemaining = textures.length;
815
+ if (numRemaining === 0) {
816
+ callback();
817
+ return;
818
+ }
819
+ for (let i = 0; i < textures.length; i++) {
820
+ const texture = textures[i];
821
+ if (texture.isReady()) {
756
822
  if (--numRemaining === 0) {
757
823
  callback();
758
824
  }
759
- });
760
- }
761
- else {
762
- if (--numRemaining === 0) {
763
- callback();
825
+ }
826
+ else {
827
+ const onLoadObservable = texture.onLoadObservable;
828
+ if (onLoadObservable) {
829
+ onLoadObservable.addOnce(() => {
830
+ if (--numRemaining === 0) {
831
+ callback();
832
+ }
833
+ });
834
+ }
835
+ else {
836
+ if (--numRemaining === 0) {
837
+ callback();
838
+ }
839
+ }
764
840
  }
765
841
  }
766
842
  }
767
- }
768
- }
769
- static _IsScene(sceneOrEngine) {
770
- return sceneOrEngine.getClassName() === "Scene";
771
- }
772
- }
773
- /**
774
- * Default anisotropic filtering level for the application.
775
- * It is set to 4 as a good tradeoff between perf and quality.
776
- */
777
- BaseTexture.DEFAULT_ANISOTROPIC_FILTERING_LEVEL = 4;
778
- __decorate([
779
- serialize()
780
- ], BaseTexture.prototype, "uniqueId", void 0);
781
- __decorate([
782
- serialize()
783
- ], BaseTexture.prototype, "name", void 0);
784
- __decorate([
785
- serialize()
786
- ], BaseTexture.prototype, "displayName", void 0);
787
- __decorate([
788
- serialize()
789
- ], BaseTexture.prototype, "metadata", void 0);
790
- __decorate([
791
- serialize("hasAlpha")
792
- ], BaseTexture.prototype, "_hasAlpha", void 0);
793
- __decorate([
794
- serialize("getAlphaFromRGB")
795
- ], BaseTexture.prototype, "_getAlphaFromRGB", void 0);
796
- __decorate([
797
- serialize()
798
- ], BaseTexture.prototype, "level", void 0);
799
- __decorate([
800
- serialize("coordinatesIndex")
801
- ], BaseTexture.prototype, "_coordinatesIndex", void 0);
802
- __decorate([
803
- serialize()
804
- ], BaseTexture.prototype, "optimizeUVAllocation", void 0);
805
- __decorate([
806
- serialize("coordinatesMode")
807
- ], BaseTexture.prototype, "_coordinatesMode", void 0);
808
- __decorate([
809
- serialize()
810
- ], BaseTexture.prototype, "wrapU", null);
811
- __decorate([
812
- serialize()
813
- ], BaseTexture.prototype, "wrapV", null);
814
- __decorate([
815
- serialize()
816
- ], BaseTexture.prototype, "wrapR", void 0);
817
- __decorate([
818
- serialize()
819
- ], BaseTexture.prototype, "anisotropicFilteringLevel", void 0);
820
- __decorate([
821
- serialize()
822
- ], BaseTexture.prototype, "isCube", null);
823
- __decorate([
824
- serialize()
825
- ], BaseTexture.prototype, "is3D", null);
826
- __decorate([
827
- serialize()
828
- ], BaseTexture.prototype, "is2DArray", null);
829
- __decorate([
830
- serialize()
831
- ], BaseTexture.prototype, "gammaSpace", null);
832
- __decorate([
833
- serialize()
834
- ], BaseTexture.prototype, "currentGammaSpace", null);
835
- __decorate([
836
- serialize()
837
- ], BaseTexture.prototype, "invertZ", void 0);
838
- __decorate([
839
- serialize()
840
- ], BaseTexture.prototype, "lodLevelInAlpha", void 0);
841
- __decorate([
842
- serialize()
843
- ], BaseTexture.prototype, "lodGenerationOffset", null);
844
- __decorate([
845
- serialize()
846
- ], BaseTexture.prototype, "lodGenerationScale", null);
847
- __decorate([
848
- serialize()
849
- ], BaseTexture.prototype, "linearSpecularLOD", null);
850
- __decorate([
851
- serializeAsTexture()
852
- ], BaseTexture.prototype, "irradianceTexture", null);
853
- __decorate([
854
- serialize()
855
- ], BaseTexture.prototype, "isRenderTarget", void 0);
843
+ static _IsScene(sceneOrEngine) {
844
+ return sceneOrEngine.getClassName() === "Scene";
845
+ }
846
+ },
847
+ (() => {
848
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
849
+ _uniqueId_decorators = [serialize()];
850
+ _name_decorators = [serialize()];
851
+ _displayName_decorators = [serialize()];
852
+ _metadata_decorators = [serialize()];
853
+ __hasAlpha_decorators = [serialize("hasAlpha")];
854
+ __getAlphaFromRGB_decorators = [serialize("getAlphaFromRGB")];
855
+ _level_decorators = [serialize()];
856
+ __coordinatesIndex_decorators = [serialize("coordinatesIndex")];
857
+ _optimizeUVAllocation_decorators = [serialize()];
858
+ __coordinatesMode_decorators = [serialize("coordinatesMode")];
859
+ _get_wrapU_decorators = [serialize()];
860
+ _get_wrapV_decorators = [serialize()];
861
+ _wrapR_decorators = [serialize()];
862
+ _anisotropicFilteringLevel_decorators = [serialize()];
863
+ _get_isCube_decorators = [serialize()];
864
+ _get_is3D_decorators = [serialize()];
865
+ _get_is2DArray_decorators = [serialize()];
866
+ _get_gammaSpace_decorators = [serialize()];
867
+ _get_currentGammaSpace_decorators = [serialize()];
868
+ _invertZ_decorators = [serialize()];
869
+ _lodLevelInAlpha_decorators = [serialize()];
870
+ _get_lodGenerationOffset_decorators = [serialize()];
871
+ _get_lodGenerationScale_decorators = [serialize()];
872
+ _get_linearSpecularLOD_decorators = [serialize()];
873
+ _get_irradianceTexture_decorators = [serializeAsTexture()];
874
+ _isRenderTarget_decorators = [serialize()];
875
+ __esDecorate(_a, null, _get_wrapU_decorators, { kind: "getter", name: "wrapU", static: false, private: false, access: { has: obj => "wrapU" in obj, get: obj => obj.wrapU }, metadata: _metadata }, null, _instanceExtraInitializers);
876
+ __esDecorate(_a, null, _get_wrapV_decorators, { kind: "getter", name: "wrapV", static: false, private: false, access: { has: obj => "wrapV" in obj, get: obj => obj.wrapV }, metadata: _metadata }, null, _instanceExtraInitializers);
877
+ __esDecorate(_a, null, _get_isCube_decorators, { kind: "getter", name: "isCube", static: false, private: false, access: { has: obj => "isCube" in obj, get: obj => obj.isCube }, metadata: _metadata }, null, _instanceExtraInitializers);
878
+ __esDecorate(_a, null, _get_is3D_decorators, { kind: "getter", name: "is3D", static: false, private: false, access: { has: obj => "is3D" in obj, get: obj => obj.is3D }, metadata: _metadata }, null, _instanceExtraInitializers);
879
+ __esDecorate(_a, null, _get_is2DArray_decorators, { kind: "getter", name: "is2DArray", static: false, private: false, access: { has: obj => "is2DArray" in obj, get: obj => obj.is2DArray }, metadata: _metadata }, null, _instanceExtraInitializers);
880
+ __esDecorate(_a, null, _get_gammaSpace_decorators, { kind: "getter", name: "gammaSpace", static: false, private: false, access: { has: obj => "gammaSpace" in obj, get: obj => obj.gammaSpace }, metadata: _metadata }, null, _instanceExtraInitializers);
881
+ __esDecorate(_a, null, _get_currentGammaSpace_decorators, { kind: "getter", name: "currentGammaSpace", static: false, private: false, access: { has: obj => "currentGammaSpace" in obj, get: obj => obj.currentGammaSpace }, metadata: _metadata }, null, _instanceExtraInitializers);
882
+ __esDecorate(_a, null, _get_lodGenerationOffset_decorators, { kind: "getter", name: "lodGenerationOffset", static: false, private: false, access: { has: obj => "lodGenerationOffset" in obj, get: obj => obj.lodGenerationOffset }, metadata: _metadata }, null, _instanceExtraInitializers);
883
+ __esDecorate(_a, null, _get_lodGenerationScale_decorators, { kind: "getter", name: "lodGenerationScale", static: false, private: false, access: { has: obj => "lodGenerationScale" in obj, get: obj => obj.lodGenerationScale }, metadata: _metadata }, null, _instanceExtraInitializers);
884
+ __esDecorate(_a, null, _get_linearSpecularLOD_decorators, { kind: "getter", name: "linearSpecularLOD", static: false, private: false, access: { has: obj => "linearSpecularLOD" in obj, get: obj => obj.linearSpecularLOD }, metadata: _metadata }, null, _instanceExtraInitializers);
885
+ __esDecorate(_a, null, _get_irradianceTexture_decorators, { kind: "getter", name: "irradianceTexture", static: false, private: false, access: { has: obj => "irradianceTexture" in obj, get: obj => obj.irradianceTexture }, metadata: _metadata }, null, _instanceExtraInitializers);
886
+ __esDecorate(null, null, _uniqueId_decorators, { kind: "field", name: "uniqueId", static: false, private: false, access: { has: obj => "uniqueId" in obj, get: obj => obj.uniqueId, set: (obj, value) => { obj.uniqueId = value; } }, metadata: _metadata }, _uniqueId_initializers, _uniqueId_extraInitializers);
887
+ __esDecorate(null, null, _name_decorators, { kind: "field", name: "name", static: false, private: false, access: { has: obj => "name" in obj, get: obj => obj.name, set: (obj, value) => { obj.name = value; } }, metadata: _metadata }, _name_initializers, _name_extraInitializers);
888
+ __esDecorate(null, null, _displayName_decorators, { kind: "field", name: "displayName", static: false, private: false, access: { has: obj => "displayName" in obj, get: obj => obj.displayName, set: (obj, value) => { obj.displayName = value; } }, metadata: _metadata }, _displayName_initializers, _displayName_extraInitializers);
889
+ __esDecorate(null, null, _metadata_decorators, { kind: "field", name: "metadata", static: false, private: false, access: { has: obj => "metadata" in obj, get: obj => obj.metadata, set: (obj, value) => { obj.metadata = value; } }, metadata: _metadata }, _metadata_initializers, _metadata_extraInitializers);
890
+ __esDecorate(null, null, __hasAlpha_decorators, { kind: "field", name: "_hasAlpha", static: false, private: false, access: { has: obj => "_hasAlpha" in obj, get: obj => obj._hasAlpha, set: (obj, value) => { obj._hasAlpha = value; } }, metadata: _metadata }, __hasAlpha_initializers, __hasAlpha_extraInitializers);
891
+ __esDecorate(null, null, __getAlphaFromRGB_decorators, { kind: "field", name: "_getAlphaFromRGB", static: false, private: false, access: { has: obj => "_getAlphaFromRGB" in obj, get: obj => obj._getAlphaFromRGB, set: (obj, value) => { obj._getAlphaFromRGB = value; } }, metadata: _metadata }, __getAlphaFromRGB_initializers, __getAlphaFromRGB_extraInitializers);
892
+ __esDecorate(null, null, _level_decorators, { kind: "field", name: "level", static: false, private: false, access: { has: obj => "level" in obj, get: obj => obj.level, set: (obj, value) => { obj.level = value; } }, metadata: _metadata }, _level_initializers, _level_extraInitializers);
893
+ __esDecorate(null, null, __coordinatesIndex_decorators, { kind: "field", name: "_coordinatesIndex", static: false, private: false, access: { has: obj => "_coordinatesIndex" in obj, get: obj => obj._coordinatesIndex, set: (obj, value) => { obj._coordinatesIndex = value; } }, metadata: _metadata }, __coordinatesIndex_initializers, __coordinatesIndex_extraInitializers);
894
+ __esDecorate(null, null, _optimizeUVAllocation_decorators, { kind: "field", name: "optimizeUVAllocation", static: false, private: false, access: { has: obj => "optimizeUVAllocation" in obj, get: obj => obj.optimizeUVAllocation, set: (obj, value) => { obj.optimizeUVAllocation = value; } }, metadata: _metadata }, _optimizeUVAllocation_initializers, _optimizeUVAllocation_extraInitializers);
895
+ __esDecorate(null, null, __coordinatesMode_decorators, { kind: "field", name: "_coordinatesMode", static: false, private: false, access: { has: obj => "_coordinatesMode" in obj, get: obj => obj._coordinatesMode, set: (obj, value) => { obj._coordinatesMode = value; } }, metadata: _metadata }, __coordinatesMode_initializers, __coordinatesMode_extraInitializers);
896
+ __esDecorate(null, null, _wrapR_decorators, { kind: "field", name: "wrapR", static: false, private: false, access: { has: obj => "wrapR" in obj, get: obj => obj.wrapR, set: (obj, value) => { obj.wrapR = value; } }, metadata: _metadata }, _wrapR_initializers, _wrapR_extraInitializers);
897
+ __esDecorate(null, null, _anisotropicFilteringLevel_decorators, { kind: "field", name: "anisotropicFilteringLevel", static: false, private: false, access: { has: obj => "anisotropicFilteringLevel" in obj, get: obj => obj.anisotropicFilteringLevel, set: (obj, value) => { obj.anisotropicFilteringLevel = value; } }, metadata: _metadata }, _anisotropicFilteringLevel_initializers, _anisotropicFilteringLevel_extraInitializers);
898
+ __esDecorate(null, null, _invertZ_decorators, { kind: "field", name: "invertZ", static: false, private: false, access: { has: obj => "invertZ" in obj, get: obj => obj.invertZ, set: (obj, value) => { obj.invertZ = value; } }, metadata: _metadata }, _invertZ_initializers, _invertZ_extraInitializers);
899
+ __esDecorate(null, null, _lodLevelInAlpha_decorators, { kind: "field", name: "lodLevelInAlpha", static: false, private: false, access: { has: obj => "lodLevelInAlpha" in obj, get: obj => obj.lodLevelInAlpha, set: (obj, value) => { obj.lodLevelInAlpha = value; } }, metadata: _metadata }, _lodLevelInAlpha_initializers, _lodLevelInAlpha_extraInitializers);
900
+ __esDecorate(null, null, _isRenderTarget_decorators, { kind: "field", name: "isRenderTarget", static: false, private: false, access: { has: obj => "isRenderTarget" in obj, get: obj => obj.isRenderTarget, set: (obj, value) => { obj.isRenderTarget = value; } }, metadata: _metadata }, _isRenderTarget_initializers, _isRenderTarget_extraInitializers);
901
+ if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
902
+ })(),
903
+ /**
904
+ * Default anisotropic filtering level for the application.
905
+ * It is set to 4 as a good tradeoff between perf and quality.
906
+ */
907
+ _a.DEFAULT_ANISOTROPIC_FILTERING_LEVEL = 4,
908
+ _a;
909
+ })();
910
+ export { BaseTexture };
856
911
  // #region GENERATED_SIDE_EFFECT_STUBS — do not edit, regenerate with `npm run generate:side-effect-stubs`
857
912
  import { _MissingSideEffect, _MissingSideEffectProperty } from "../../Misc/devTools.js";
858
913
  (_a = BaseTexture.prototype).forceSphericalPolynomialsRecompute ?? (_a.forceSphericalPolynomialsRecompute = _MissingSideEffect("BaseTexture", "forceSphericalPolynomialsRecompute"));