@onerjs/core 8.53.5 → 8.53.7

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,5 +1,5 @@
1
1
  /** This file must only contain pure code and pure imports */
2
- import { __decorate } from "../../tslib.es6.js";
2
+ import { __esDecorate, __runInitializers } from "../../tslib.es6.js";
3
3
  import { serialize } from "../../Misc/decorators.js";
4
4
  import { Observable } from "../../Misc/observable.pure.js";
5
5
  import { Matrix, TmpVectors, Vector3 } from "../../Maths/math.vector.pure.js";
@@ -18,956 +18,994 @@ import { SerializationHelper } from "../../Misc/decorators.serialization.js";
18
18
  * This represents a texture in babylon. It can be easily loaded from a network, base64 or html input.
19
19
  * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction#texture
20
20
  */
21
- export class Texture extends BaseTexture {
22
- /**
23
- * @internal
24
- */
25
- static _CreateVideoTexture(name, src, scene, generateMipMaps = false, invertY = false, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, settings = {}, onError, format = 5) {
26
- throw _WarnImport("VideoTexture");
27
- }
28
- /**
29
- * Are mip maps generated for this texture or not.
30
- */
31
- get noMipmap() {
32
- return this._noMipmap;
33
- }
34
- /** Returns the texture mime type if it was defined by a loader (undefined else) */
35
- get mimeType() {
36
- return this._mimeType;
37
- }
38
- /**
39
- * Is the texture preventing material to render while loading.
40
- * If false, a default texture will be used instead of the loading one during the preparation step.
41
- */
42
- set isBlocking(value) {
43
- this._isBlocking = value;
44
- }
45
- get isBlocking() {
46
- return this._isBlocking;
47
- }
48
- /**
49
- * Gets a boolean indicating if the texture needs to be inverted on the y axis during loading
50
- */
51
- get invertY() {
52
- return this._invertY;
53
- }
54
- /**
55
- * Instantiates a new texture.
56
- * This represents a texture in babylon. It can be easily loaded from a network, base64 or html input.
57
- * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction#texture
58
- * @param url defines the url of the picture to load as a texture
59
- * @param sceneOrEngine defines the scene or engine the texture will belong to
60
- * @param noMipmapOrOptions defines if the texture will require mip maps or not or set of all options to create the texture
61
- * @param invertY defines if the texture needs to be inverted on the y axis during loading
62
- * @param samplingMode defines the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...)
63
- * @param onLoad defines a callback triggered when the texture has been loaded
64
- * @param onError defines a callback triggered when an error occurred during the loading session
65
- * @param buffer defines the buffer to load the texture from in case the texture is loaded from a buffer representation
66
- * @param deleteBuffer defines if the buffer we are loading the texture from should be deleted after load
67
- * @param format defines the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)
68
- * @param mimeType defines an optional mime type information
69
- * @param loaderOptions options to be passed to the loader
70
- * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
71
- * @param forcedExtension defines the extension to use to pick the right loader
72
- */
73
- constructor(url, sceneOrEngine, noMipmapOrOptions, invertY, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, onLoad = null, onError = null, buffer = null, deleteBuffer = false, format, mimeType, loaderOptions, creationFlags, forcedExtension) {
74
- super(sceneOrEngine);
75
- /**
76
- * Define the url of the texture.
77
- */
78
- this.url = null;
79
- /**
80
- * Define an offset on the texture to offset the u coordinates of the UVs
81
- * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#offsetting
82
- */
83
- this.uOffset = 0;
84
- /**
85
- * Define an offset on the texture to offset the v coordinates of the UVs
86
- * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#offsetting
87
- */
88
- this.vOffset = 0;
89
- /**
90
- * Define an offset on the texture to scale the u coordinates of the UVs
91
- * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#tiling
92
- */
93
- this.uScale = 1.0;
94
- /**
95
- * Define an offset on the texture to scale the v coordinates of the UVs
96
- * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#tiling
97
- */
98
- this.vScale = 1.0;
99
- /**
100
- * Define an offset on the texture to rotate around the u coordinates of the UVs
101
- * The angle is defined in radians.
102
- * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials
103
- */
104
- this.uAng = 0;
105
- /**
106
- * Define an offset on the texture to rotate around the v coordinates of the UVs
107
- * The angle is defined in radians.
108
- * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials
109
- */
110
- this.vAng = 0;
111
- /**
112
- * Define an offset on the texture to rotate around the w coordinates of the UVs (in case of 3d texture)
113
- * The angle is defined in radians.
114
- * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials
115
- */
116
- this.wAng = 0;
117
- /**
118
- * Defines the center of rotation (U)
119
- */
120
- this.uRotationCenter = 0.5;
121
- /**
122
- * Defines the center of rotation (V)
123
- */
124
- this.vRotationCenter = 0.5;
125
- /**
126
- * Defines the center of rotation (W)
127
- */
128
- this.wRotationCenter = 0.5;
129
- /**
130
- * Sets this property to true to avoid deformations when rotating the texture with non-uniform scaling
131
- */
132
- this.homogeneousRotationInUVTransform = false;
133
- /**
134
- * List of inspectable custom properties (used by the Inspector)
135
- * @see https://doc.babylonjs.com/toolsAndResources/inspector#extensibility
136
- */
137
- this.inspectableCustomProperties = null;
138
- /** @internal */
139
- this._noMipmap = false;
140
- /** @internal */
141
- this._invertY = false;
142
- this._rowGenerationMatrix = null;
143
- this._cachedTextureMatrix = null;
144
- this._projectionModeMatrix = null;
145
- this._t0 = null;
146
- this._t1 = null;
147
- this._t2 = null;
148
- this._cachedUOffset = -1;
149
- this._cachedVOffset = -1;
150
- this._cachedUScale = 0;
151
- this._cachedVScale = 0;
152
- this._cachedUAng = -1;
153
- this._cachedVAng = -1;
154
- this._cachedWAng = -1;
155
- this._cachedReflectionProjectionMatrixId = -1;
156
- this._cachedURotationCenter = -1;
157
- this._cachedVRotationCenter = -1;
158
- this._cachedWRotationCenter = -1;
159
- this._cachedHomogeneousRotationInUVTransform = false;
160
- this._cachedIdentity3x2 = true;
161
- this._cachedReflectionTextureMatrix = null;
162
- this._cachedReflectionUOffset = -1;
163
- this._cachedReflectionVOffset = -1;
164
- this._cachedReflectionUScale = 0;
165
- this._cachedReflectionVScale = 0;
166
- this._cachedReflectionCoordinatesMode = -1;
167
- /** @internal */
168
- this._buffer = null;
169
- this._deleteBuffer = false;
170
- this._format = null;
171
- this._delayedOnLoad = null;
172
- this._delayedOnError = null;
173
- /**
174
- * Observable triggered once the texture has been loaded.
175
- */
176
- this.onLoadObservable = new Observable();
177
- this._isBlocking = true;
178
- let name = url || "";
179
- this.url = url;
180
- let noMipmap;
181
- let useSRGBBuffer = false;
182
- let internalTexture = null;
183
- let gammaSpace = true;
184
- if (typeof noMipmapOrOptions === "object" && noMipmapOrOptions !== null) {
185
- noMipmap = noMipmapOrOptions.noMipmap ?? false;
186
- invertY = noMipmapOrOptions.invertY ?? !useOpenGLOrientationForUV;
187
- samplingMode = noMipmapOrOptions.samplingMode ?? Texture.TRILINEAR_SAMPLINGMODE;
188
- onLoad = noMipmapOrOptions.onLoad ?? null;
189
- onError = noMipmapOrOptions.onError ?? null;
190
- buffer = noMipmapOrOptions.buffer ?? null;
191
- deleteBuffer = noMipmapOrOptions.deleteBuffer ?? false;
192
- format = noMipmapOrOptions.format;
193
- mimeType = noMipmapOrOptions.mimeType;
194
- loaderOptions = noMipmapOrOptions.loaderOptions;
195
- creationFlags = noMipmapOrOptions.creationFlags;
196
- useSRGBBuffer = noMipmapOrOptions.useSRGBBuffer ?? false;
197
- internalTexture = noMipmapOrOptions.internalTexture ?? null;
198
- gammaSpace = noMipmapOrOptions.gammaSpace ?? gammaSpace;
199
- forcedExtension = noMipmapOrOptions.forcedExtension ?? forcedExtension;
200
- name = noMipmapOrOptions.name ?? name;
201
- }
202
- else {
203
- noMipmap = !!noMipmapOrOptions;
204
- }
205
- this.name = name;
206
- this._gammaSpace = gammaSpace;
207
- this._noMipmap = noMipmap;
208
- this._invertY = invertY === undefined ? !useOpenGLOrientationForUV : invertY;
209
- this._initialSamplingMode = samplingMode;
210
- this._buffer = buffer;
211
- this._deleteBuffer = deleteBuffer;
212
- this._mimeType = mimeType;
213
- this._loaderOptions = loaderOptions;
214
- this._creationFlags = creationFlags;
215
- this._useSRGBBuffer = useSRGBBuffer;
216
- this._forcedExtension = forcedExtension;
217
- if (format !== undefined) {
218
- this._format = format;
219
- }
220
- const scene = this.getScene();
221
- const engine = this._getEngine();
222
- if (!engine) {
223
- return;
224
- }
225
- engine.onBeforeTextureInitObservable.notifyObservers(this);
226
- const load = () => {
227
- if (this._texture) {
228
- if (this._texture._invertVScale) {
229
- this.vScale *= -1;
230
- this.vOffset += 1;
231
- }
232
- // Update texture to match internal texture's wrapping
233
- if (this._texture._cachedWrapU !== null) {
234
- this.wrapU = this._texture._cachedWrapU;
235
- this._texture._cachedWrapU = null;
236
- }
237
- if (this._texture._cachedWrapV !== null) {
238
- this.wrapV = this._texture._cachedWrapV;
239
- this._texture._cachedWrapV = null;
240
- }
241
- if (this._texture._cachedWrapR !== null) {
242
- this.wrapR = this._texture._cachedWrapR;
243
- this._texture._cachedWrapR = null;
21
+ let Texture = (() => {
22
+ var _a;
23
+ let _classSuper = BaseTexture;
24
+ let _instanceExtraInitializers = [];
25
+ let _url_decorators;
26
+ let _url_initializers = [];
27
+ let _url_extraInitializers = [];
28
+ let _uOffset_decorators;
29
+ let _uOffset_initializers = [];
30
+ let _uOffset_extraInitializers = [];
31
+ let _vOffset_decorators;
32
+ let _vOffset_initializers = [];
33
+ let _vOffset_extraInitializers = [];
34
+ let _uScale_decorators;
35
+ let _uScale_initializers = [];
36
+ let _uScale_extraInitializers = [];
37
+ let _vScale_decorators;
38
+ let _vScale_initializers = [];
39
+ let _vScale_extraInitializers = [];
40
+ let _uAng_decorators;
41
+ let _uAng_initializers = [];
42
+ let _uAng_extraInitializers = [];
43
+ let _vAng_decorators;
44
+ let _vAng_initializers = [];
45
+ let _vAng_extraInitializers = [];
46
+ let _wAng_decorators;
47
+ let _wAng_initializers = [];
48
+ let _wAng_extraInitializers = [];
49
+ let _uRotationCenter_decorators;
50
+ let _uRotationCenter_initializers = [];
51
+ let _uRotationCenter_extraInitializers = [];
52
+ let _vRotationCenter_decorators;
53
+ let _vRotationCenter_initializers = [];
54
+ let _vRotationCenter_extraInitializers = [];
55
+ let _wRotationCenter_decorators;
56
+ let _wRotationCenter_initializers = [];
57
+ let _wRotationCenter_extraInitializers = [];
58
+ let _homogeneousRotationInUVTransform_decorators;
59
+ let _homogeneousRotationInUVTransform_initializers = [];
60
+ let _homogeneousRotationInUVTransform_extraInitializers = [];
61
+ let _get_isBlocking_decorators;
62
+ return _a = class Texture extends _classSuper {
63
+ /**
64
+ * @internal
65
+ */
66
+ static _CreateVideoTexture(name, src, scene, generateMipMaps = false, invertY = false, samplingMode = _a.TRILINEAR_SAMPLINGMODE, settings = {}, onError, format = 5) {
67
+ throw _WarnImport("VideoTexture");
68
+ }
69
+ /**
70
+ * Are mip maps generated for this texture or not.
71
+ */
72
+ get noMipmap() {
73
+ return this._noMipmap;
74
+ }
75
+ /** Returns the texture mime type if it was defined by a loader (undefined else) */
76
+ get mimeType() {
77
+ return this._mimeType;
78
+ }
79
+ /**
80
+ * Is the texture preventing material to render while loading.
81
+ * If false, a default texture will be used instead of the loading one during the preparation step.
82
+ */
83
+ set isBlocking(value) {
84
+ this._isBlocking = value;
85
+ }
86
+ get isBlocking() {
87
+ return this._isBlocking;
88
+ }
89
+ /**
90
+ * Gets a boolean indicating if the texture needs to be inverted on the y axis during loading
91
+ */
92
+ get invertY() {
93
+ return this._invertY;
94
+ }
95
+ /**
96
+ * Instantiates a new texture.
97
+ * This represents a texture in babylon. It can be easily loaded from a network, base64 or html input.
98
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction#texture
99
+ * @param url defines the url of the picture to load as a texture
100
+ * @param sceneOrEngine defines the scene or engine the texture will belong to
101
+ * @param noMipmapOrOptions defines if the texture will require mip maps or not or set of all options to create the texture
102
+ * @param invertY defines if the texture needs to be inverted on the y axis during loading
103
+ * @param samplingMode defines the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...)
104
+ * @param onLoad defines a callback triggered when the texture has been loaded
105
+ * @param onError defines a callback triggered when an error occurred during the loading session
106
+ * @param buffer defines the buffer to load the texture from in case the texture is loaded from a buffer representation
107
+ * @param deleteBuffer defines if the buffer we are loading the texture from should be deleted after load
108
+ * @param format defines the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)
109
+ * @param mimeType defines an optional mime type information
110
+ * @param loaderOptions options to be passed to the loader
111
+ * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
112
+ * @param forcedExtension defines the extension to use to pick the right loader
113
+ */
114
+ constructor(url, sceneOrEngine, noMipmapOrOptions, invertY, samplingMode = _a.TRILINEAR_SAMPLINGMODE, onLoad = null, onError = null, buffer = null, deleteBuffer = false, format, mimeType, loaderOptions, creationFlags, forcedExtension) {
115
+ super(sceneOrEngine);
116
+ /**
117
+ * Define the url of the texture.
118
+ */
119
+ this.url = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _url_initializers, null));
120
+ /**
121
+ * Define an offset on the texture to offset the u coordinates of the UVs
122
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#offsetting
123
+ */
124
+ this.uOffset = (__runInitializers(this, _url_extraInitializers), __runInitializers(this, _uOffset_initializers, 0));
125
+ /**
126
+ * Define an offset on the texture to offset the v coordinates of the UVs
127
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#offsetting
128
+ */
129
+ this.vOffset = (__runInitializers(this, _uOffset_extraInitializers), __runInitializers(this, _vOffset_initializers, 0));
130
+ /**
131
+ * Define an offset on the texture to scale the u coordinates of the UVs
132
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#tiling
133
+ */
134
+ this.uScale = (__runInitializers(this, _vOffset_extraInitializers), __runInitializers(this, _uScale_initializers, 1.0));
135
+ /**
136
+ * Define an offset on the texture to scale the v coordinates of the UVs
137
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#tiling
138
+ */
139
+ this.vScale = (__runInitializers(this, _uScale_extraInitializers), __runInitializers(this, _vScale_initializers, 1.0));
140
+ /**
141
+ * Define an offset on the texture to rotate around the u coordinates of the UVs
142
+ * The angle is defined in radians.
143
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials
144
+ */
145
+ this.uAng = (__runInitializers(this, _vScale_extraInitializers), __runInitializers(this, _uAng_initializers, 0));
146
+ /**
147
+ * Define an offset on the texture to rotate around the v coordinates of the UVs
148
+ * The angle is defined in radians.
149
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials
150
+ */
151
+ this.vAng = (__runInitializers(this, _uAng_extraInitializers), __runInitializers(this, _vAng_initializers, 0));
152
+ /**
153
+ * Define an offset on the texture to rotate around the w coordinates of the UVs (in case of 3d texture)
154
+ * The angle is defined in radians.
155
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials
156
+ */
157
+ this.wAng = (__runInitializers(this, _vAng_extraInitializers), __runInitializers(this, _wAng_initializers, 0));
158
+ /**
159
+ * Defines the center of rotation (U)
160
+ */
161
+ this.uRotationCenter = (__runInitializers(this, _wAng_extraInitializers), __runInitializers(this, _uRotationCenter_initializers, 0.5));
162
+ /**
163
+ * Defines the center of rotation (V)
164
+ */
165
+ this.vRotationCenter = (__runInitializers(this, _uRotationCenter_extraInitializers), __runInitializers(this, _vRotationCenter_initializers, 0.5));
166
+ /**
167
+ * Defines the center of rotation (W)
168
+ */
169
+ this.wRotationCenter = (__runInitializers(this, _vRotationCenter_extraInitializers), __runInitializers(this, _wRotationCenter_initializers, 0.5));
170
+ /**
171
+ * Sets this property to true to avoid deformations when rotating the texture with non-uniform scaling
172
+ */
173
+ this.homogeneousRotationInUVTransform = (__runInitializers(this, _wRotationCenter_extraInitializers), __runInitializers(this, _homogeneousRotationInUVTransform_initializers, false));
174
+ /**
175
+ * List of inspectable custom properties (used by the Inspector)
176
+ * @see https://doc.babylonjs.com/toolsAndResources/inspector#extensibility
177
+ */
178
+ this.inspectableCustomProperties = (__runInitializers(this, _homogeneousRotationInUVTransform_extraInitializers), null);
179
+ /** @internal */
180
+ this._noMipmap = false;
181
+ /** @internal */
182
+ this._invertY = false;
183
+ this._rowGenerationMatrix = null;
184
+ this._cachedTextureMatrix = null;
185
+ this._projectionModeMatrix = null;
186
+ this._t0 = null;
187
+ this._t1 = null;
188
+ this._t2 = null;
189
+ this._cachedUOffset = -1;
190
+ this._cachedVOffset = -1;
191
+ this._cachedUScale = 0;
192
+ this._cachedVScale = 0;
193
+ this._cachedUAng = -1;
194
+ this._cachedVAng = -1;
195
+ this._cachedWAng = -1;
196
+ this._cachedReflectionProjectionMatrixId = -1;
197
+ this._cachedURotationCenter = -1;
198
+ this._cachedVRotationCenter = -1;
199
+ this._cachedWRotationCenter = -1;
200
+ this._cachedHomogeneousRotationInUVTransform = false;
201
+ this._cachedIdentity3x2 = true;
202
+ this._cachedReflectionTextureMatrix = null;
203
+ this._cachedReflectionUOffset = -1;
204
+ this._cachedReflectionVOffset = -1;
205
+ this._cachedReflectionUScale = 0;
206
+ this._cachedReflectionVScale = 0;
207
+ this._cachedReflectionCoordinatesMode = -1;
208
+ /** @internal */
209
+ this._buffer = null;
210
+ this._deleteBuffer = false;
211
+ this._format = null;
212
+ this._delayedOnLoad = null;
213
+ this._delayedOnError = null;
214
+ /**
215
+ * Observable triggered once the texture has been loaded.
216
+ */
217
+ this.onLoadObservable = new Observable();
218
+ this._isBlocking = true;
219
+ let name = url || "";
220
+ this.url = url;
221
+ let noMipmap;
222
+ let useSRGBBuffer = false;
223
+ let internalTexture = null;
224
+ let gammaSpace = true;
225
+ if (typeof noMipmapOrOptions === "object" && noMipmapOrOptions !== null) {
226
+ noMipmap = noMipmapOrOptions.noMipmap ?? false;
227
+ invertY = noMipmapOrOptions.invertY ?? !useOpenGLOrientationForUV;
228
+ samplingMode = noMipmapOrOptions.samplingMode ?? _a.TRILINEAR_SAMPLINGMODE;
229
+ onLoad = noMipmapOrOptions.onLoad ?? null;
230
+ onError = noMipmapOrOptions.onError ?? null;
231
+ buffer = noMipmapOrOptions.buffer ?? null;
232
+ deleteBuffer = noMipmapOrOptions.deleteBuffer ?? false;
233
+ format = noMipmapOrOptions.format;
234
+ mimeType = noMipmapOrOptions.mimeType;
235
+ loaderOptions = noMipmapOrOptions.loaderOptions;
236
+ creationFlags = noMipmapOrOptions.creationFlags;
237
+ useSRGBBuffer = noMipmapOrOptions.useSRGBBuffer ?? false;
238
+ internalTexture = noMipmapOrOptions.internalTexture ?? null;
239
+ gammaSpace = noMipmapOrOptions.gammaSpace ?? gammaSpace;
240
+ forcedExtension = noMipmapOrOptions.forcedExtension ?? forcedExtension;
241
+ name = noMipmapOrOptions.name ?? name;
244
242
  }
245
- }
246
- if (this.onLoadObservable.hasObservers()) {
247
- this.onLoadObservable.notifyObservers(this);
248
- }
249
- if (onLoad) {
250
- onLoad();
251
- }
252
- if (!this.isBlocking && scene) {
253
- scene.resetCachedMaterial();
254
- }
255
- };
256
- const errorHandler = (message, exception) => {
257
- this._loadingError = true;
258
- this._errorObject = { message, exception };
259
- if (onError) {
260
- onError(message, exception);
261
- }
262
- Texture.OnTextureLoadErrorObservable.notifyObservers(this);
263
- };
264
- if (!this.url && !internalTexture) {
265
- this._delayedOnLoad = load;
266
- this._delayedOnError = errorHandler;
267
- return;
268
- }
269
- this._texture = internalTexture ?? this._getFromCache(this.url, noMipmap, samplingMode, this._invertY, useSRGBBuffer, this.isCube);
270
- if (!this._texture) {
271
- if (!scene || !scene.useDelayedTextureLoading) {
272
- try {
273
- this._texture = engine.createTexture(this.url, noMipmap, this._invertY, scene, samplingMode, load, errorHandler, this._buffer, undefined, this._format, this._forcedExtension, mimeType, loaderOptions, creationFlags, useSRGBBuffer);
274
- }
275
- catch (e) {
276
- errorHandler("error loading", e);
277
- throw e;
278
- }
279
- if (deleteBuffer) {
280
- this._buffer = null;
243
+ else {
244
+ noMipmap = !!noMipmapOrOptions;
245
+ }
246
+ this.name = name;
247
+ this._gammaSpace = gammaSpace;
248
+ this._noMipmap = noMipmap;
249
+ this._invertY = invertY === undefined ? !useOpenGLOrientationForUV : invertY;
250
+ this._initialSamplingMode = samplingMode;
251
+ this._buffer = buffer;
252
+ this._deleteBuffer = deleteBuffer;
253
+ this._mimeType = mimeType;
254
+ this._loaderOptions = loaderOptions;
255
+ this._creationFlags = creationFlags;
256
+ this._useSRGBBuffer = useSRGBBuffer;
257
+ this._forcedExtension = forcedExtension;
258
+ if (format !== undefined) {
259
+ this._format = format;
260
+ }
261
+ const scene = this.getScene();
262
+ const engine = this._getEngine();
263
+ if (!engine) {
264
+ return;
265
+ }
266
+ engine.onBeforeTextureInitObservable.notifyObservers(this);
267
+ const load = () => {
268
+ if (this._texture) {
269
+ if (this._texture._invertVScale) {
270
+ this.vScale *= -1;
271
+ this.vOffset += 1;
272
+ }
273
+ // Update texture to match internal texture's wrapping
274
+ if (this._texture._cachedWrapU !== null) {
275
+ this.wrapU = this._texture._cachedWrapU;
276
+ this._texture._cachedWrapU = null;
277
+ }
278
+ if (this._texture._cachedWrapV !== null) {
279
+ this.wrapV = this._texture._cachedWrapV;
280
+ this._texture._cachedWrapV = null;
281
+ }
282
+ if (this._texture._cachedWrapR !== null) {
283
+ this.wrapR = this._texture._cachedWrapR;
284
+ this._texture._cachedWrapR = null;
285
+ }
286
+ }
287
+ if (this.onLoadObservable.hasObservers()) {
288
+ this.onLoadObservable.notifyObservers(this);
289
+ }
290
+ if (onLoad) {
291
+ onLoad();
292
+ }
293
+ if (!this.isBlocking && scene) {
294
+ scene.resetCachedMaterial();
295
+ }
296
+ };
297
+ const errorHandler = (message, exception) => {
298
+ this._loadingError = true;
299
+ this._errorObject = { message, exception };
300
+ if (onError) {
301
+ onError(message, exception);
302
+ }
303
+ _a.OnTextureLoadErrorObservable.notifyObservers(this);
304
+ };
305
+ if (!this.url && !internalTexture) {
306
+ this._delayedOnLoad = load;
307
+ this._delayedOnError = errorHandler;
308
+ return;
309
+ }
310
+ this._texture = internalTexture ?? this._getFromCache(this.url, noMipmap, samplingMode, this._invertY, useSRGBBuffer, this.isCube);
311
+ if (!this._texture) {
312
+ if (!scene || !scene.useDelayedTextureLoading) {
313
+ try {
314
+ this._texture = engine.createTexture(this.url, noMipmap, this._invertY, scene, samplingMode, load, errorHandler, this._buffer, undefined, this._format, this._forcedExtension, mimeType, loaderOptions, creationFlags, useSRGBBuffer);
315
+ }
316
+ catch (e) {
317
+ errorHandler("error loading", e);
318
+ throw e;
319
+ }
320
+ if (deleteBuffer) {
321
+ this._buffer = null;
322
+ }
323
+ }
324
+ else {
325
+ this.delayLoadState = 4;
326
+ this._delayedOnLoad = load;
327
+ this._delayedOnError = errorHandler;
328
+ }
329
+ }
330
+ else {
331
+ if (this._texture.isReady) {
332
+ TimingTools.SetImmediate(() => load());
333
+ }
334
+ else {
335
+ const loadObserver = this._texture.onLoadedObservable.add(load);
336
+ this._texture.onErrorObservable.add((e) => {
337
+ errorHandler(e.message, e.exception);
338
+ this._texture?.onLoadedObservable.remove(loadObserver);
339
+ });
340
+ }
281
341
  }
282
342
  }
283
- else {
343
+ /**
344
+ * Update the url (and optional buffer) of this texture if url was null during construction.
345
+ * @param url the url of the texture
346
+ * @param buffer the buffer of the texture (defaults to null)
347
+ * @param onLoad callback called when the texture is loaded (defaults to null)
348
+ * @param forcedExtension defines the extension to use to pick the right loader
349
+ */
350
+ updateURL(url, buffer = null, onLoad, forcedExtension) {
351
+ if (this.url) {
352
+ this.releaseInternalTexture();
353
+ this.getScene().markAllMaterialsAsDirty(1, (mat) => {
354
+ return mat.hasTexture(this);
355
+ });
356
+ }
357
+ if (!this.name || this.name.startsWith("data:")) {
358
+ this.name = url;
359
+ }
360
+ this.url = url;
361
+ this._buffer = buffer;
362
+ this._forcedExtension = forcedExtension;
284
363
  this.delayLoadState = 4;
364
+ const existingOnLoad = this._delayedOnLoad;
365
+ const load = () => {
366
+ if (existingOnLoad) {
367
+ existingOnLoad();
368
+ }
369
+ else if (this.onLoadObservable.hasObservers()) {
370
+ this.onLoadObservable.notifyObservers(this);
371
+ }
372
+ if (onLoad) {
373
+ onLoad();
374
+ }
375
+ };
285
376
  this._delayedOnLoad = load;
286
- this._delayedOnError = errorHandler;
287
- }
288
- }
289
- else {
290
- if (this._texture.isReady) {
291
- TimingTools.SetImmediate(() => load());
292
- }
293
- else {
294
- const loadObserver = this._texture.onLoadedObservable.add(load);
295
- this._texture.onErrorObservable.add((e) => {
296
- errorHandler(e.message, e.exception);
297
- this._texture?.onLoadedObservable.remove(loadObserver);
298
- });
299
- }
300
- }
301
- }
302
- /**
303
- * Update the url (and optional buffer) of this texture if url was null during construction.
304
- * @param url the url of the texture
305
- * @param buffer the buffer of the texture (defaults to null)
306
- * @param onLoad callback called when the texture is loaded (defaults to null)
307
- * @param forcedExtension defines the extension to use to pick the right loader
308
- */
309
- updateURL(url, buffer = null, onLoad, forcedExtension) {
310
- if (this.url) {
311
- this.releaseInternalTexture();
312
- this.getScene().markAllMaterialsAsDirty(1, (mat) => {
313
- return mat.hasTexture(this);
314
- });
315
- }
316
- if (!this.name || this.name.startsWith("data:")) {
317
- this.name = url;
318
- }
319
- this.url = url;
320
- this._buffer = buffer;
321
- this._forcedExtension = forcedExtension;
322
- this.delayLoadState = 4;
323
- const existingOnLoad = this._delayedOnLoad;
324
- const load = () => {
325
- if (existingOnLoad) {
326
- existingOnLoad();
327
- }
328
- else if (this.onLoadObservable.hasObservers()) {
329
- this.onLoadObservable.notifyObservers(this);
330
- }
331
- if (onLoad) {
332
- onLoad();
333
- }
334
- };
335
- this._delayedOnLoad = load;
336
- this.delayLoad();
337
- }
338
- /**
339
- * Finish the loading sequence of a texture flagged as delayed load.
340
- * @internal
341
- */
342
- delayLoad() {
343
- if (this.delayLoadState !== 4) {
344
- return;
345
- }
346
- const scene = this.getScene();
347
- if (!scene) {
348
- return;
349
- }
350
- let url = this.url;
351
- if (!url && (this.name.indexOf("://") > 0 || this.name.startsWith("data:"))) {
352
- // Some textures are serialized with an empty url and use name instead for storing the url.
353
- // When created without delayed load, the url is set properly because it is passed to the constructor and the texture is created right away.
354
- // But when created with delayed load, the url property is overwritten to "" (because it is the value in the serialized data) when the properties are parsed (see SerializationHelper.Parse).
355
- url = this.name;
356
- }
357
- this.delayLoadState = 1;
358
- this._texture = this._getFromCache(url, this._noMipmap, this.samplingMode, this._invertY, this._useSRGBBuffer, this.isCube);
359
- if (!this._texture) {
360
- this._texture = scene
361
- .getEngine()
362
- .createTexture(url, this._noMipmap, this._invertY, scene, this.samplingMode, this._delayedOnLoad, this._delayedOnError, this._buffer, null, this._format, this._forcedExtension, this._mimeType, this._loaderOptions, this._creationFlags, this._useSRGBBuffer);
363
- if (this._deleteBuffer) {
364
- this._buffer = null;
365
- }
366
- }
367
- else {
368
- if (this._delayedOnLoad) {
369
- if (this._texture.isReady) {
370
- TimingTools.SetImmediate(this._delayedOnLoad);
377
+ this.delayLoad();
378
+ }
379
+ /**
380
+ * Finish the loading sequence of a texture flagged as delayed load.
381
+ * @internal
382
+ */
383
+ delayLoad() {
384
+ if (this.delayLoadState !== 4) {
385
+ return;
386
+ }
387
+ const scene = this.getScene();
388
+ if (!scene) {
389
+ return;
390
+ }
391
+ let url = this.url;
392
+ if (!url && (this.name.indexOf("://") > 0 || this.name.startsWith("data:"))) {
393
+ // Some textures are serialized with an empty url and use name instead for storing the url.
394
+ // When created without delayed load, the url is set properly because it is passed to the constructor and the texture is created right away.
395
+ // But when created with delayed load, the url property is overwritten to "" (because it is the value in the serialized data) when the properties are parsed (see SerializationHelper.Parse).
396
+ url = this.name;
397
+ }
398
+ this.delayLoadState = 1;
399
+ this._texture = this._getFromCache(url, this._noMipmap, this.samplingMode, this._invertY, this._useSRGBBuffer, this.isCube);
400
+ if (!this._texture) {
401
+ this._texture = scene
402
+ .getEngine()
403
+ .createTexture(url, this._noMipmap, this._invertY, scene, this.samplingMode, this._delayedOnLoad, this._delayedOnError, this._buffer, null, this._format, this._forcedExtension, this._mimeType, this._loaderOptions, this._creationFlags, this._useSRGBBuffer);
404
+ if (this._deleteBuffer) {
405
+ this._buffer = null;
406
+ }
371
407
  }
372
408
  else {
373
- this._texture.onLoadedObservable.add(this._delayedOnLoad);
409
+ if (this._delayedOnLoad) {
410
+ if (this._texture.isReady) {
411
+ TimingTools.SetImmediate(this._delayedOnLoad);
412
+ }
413
+ else {
414
+ this._texture.onLoadedObservable.add(this._delayedOnLoad);
415
+ }
416
+ }
374
417
  }
375
- }
376
- }
377
- this._delayedOnLoad = null;
378
- this._delayedOnError = null;
379
- }
380
- _prepareRowForTextureGeneration(x, y, z, t) {
381
- x *= this._cachedUScale;
382
- y *= this._cachedVScale;
383
- x -= this.uRotationCenter * this._cachedUScale;
384
- y -= this.vRotationCenter * this._cachedVScale;
385
- z -= this.wRotationCenter;
386
- Vector3.TransformCoordinatesFromFloatsToRef(x, y, z, this._rowGenerationMatrix, t);
387
- t.x += this.uRotationCenter * this._cachedUScale + this._cachedUOffset;
388
- t.y += this.vRotationCenter * this._cachedVScale + this._cachedVOffset;
389
- t.z += this.wRotationCenter;
390
- }
391
- /**
392
- * Get the current texture matrix which includes the requested offsetting, tiling and rotation components.
393
- * @param uBase The horizontal base offset multiplier (1 by default)
394
- * @returns the transform matrix of the texture.
395
- */
396
- getTextureMatrix(uBase = 1) {
397
- if (this.uOffset === this._cachedUOffset &&
398
- this.vOffset === this._cachedVOffset &&
399
- this.uScale * uBase === this._cachedUScale &&
400
- this.vScale === this._cachedVScale &&
401
- this.uAng === this._cachedUAng &&
402
- this.vAng === this._cachedVAng &&
403
- this.wAng === this._cachedWAng &&
404
- this.uRotationCenter === this._cachedURotationCenter &&
405
- this.vRotationCenter === this._cachedVRotationCenter &&
406
- this.wRotationCenter === this._cachedWRotationCenter &&
407
- this.homogeneousRotationInUVTransform === this._cachedHomogeneousRotationInUVTransform) {
408
- return this._cachedTextureMatrix;
409
- }
410
- this._cachedUOffset = this.uOffset;
411
- this._cachedVOffset = this.vOffset;
412
- this._cachedUScale = this.uScale * uBase;
413
- this._cachedVScale = this.vScale;
414
- this._cachedUAng = this.uAng;
415
- this._cachedVAng = this.vAng;
416
- this._cachedWAng = this.wAng;
417
- this._cachedURotationCenter = this.uRotationCenter;
418
- this._cachedVRotationCenter = this.vRotationCenter;
419
- this._cachedWRotationCenter = this.wRotationCenter;
420
- this._cachedHomogeneousRotationInUVTransform = this.homogeneousRotationInUVTransform;
421
- if (!this._cachedTextureMatrix || !this._rowGenerationMatrix) {
422
- this._cachedTextureMatrix = Matrix.Zero();
423
- this._rowGenerationMatrix = new Matrix();
424
- this._t0 = Vector3.Zero();
425
- this._t1 = Vector3.Zero();
426
- this._t2 = Vector3.Zero();
427
- }
428
- Matrix.RotationYawPitchRollToRef(this.vAng, this.uAng, this.wAng, this._rowGenerationMatrix);
429
- if (this.homogeneousRotationInUVTransform) {
430
- Matrix.TranslationToRef(-this._cachedURotationCenter, -this._cachedVRotationCenter, -this._cachedWRotationCenter, TmpVectors.Matrix[0]);
431
- Matrix.TranslationToRef(this._cachedURotationCenter, this._cachedVRotationCenter, this._cachedWRotationCenter, TmpVectors.Matrix[1]);
432
- Matrix.ScalingToRef(this._cachedUScale, this._cachedVScale, 0, TmpVectors.Matrix[2]);
433
- Matrix.TranslationToRef(this._cachedUOffset, this._cachedVOffset, 0, TmpVectors.Matrix[3]);
434
- TmpVectors.Matrix[0].multiplyToRef(this._rowGenerationMatrix, this._cachedTextureMatrix);
435
- this._cachedTextureMatrix.multiplyToRef(TmpVectors.Matrix[1], this._cachedTextureMatrix);
436
- this._cachedTextureMatrix.multiplyToRef(TmpVectors.Matrix[2], this._cachedTextureMatrix);
437
- this._cachedTextureMatrix.multiplyToRef(TmpVectors.Matrix[3], this._cachedTextureMatrix);
438
- // copy the translation row to the 3rd row of the matrix so that we don't need to update the shaders (which expects the translation to be on the 3rd row)
439
- this._cachedTextureMatrix.setRowFromFloats(2, this._cachedTextureMatrix.m[12], this._cachedTextureMatrix.m[13], this._cachedTextureMatrix.m[14], 1);
440
- }
441
- else {
442
- this._prepareRowForTextureGeneration(0, 0, 0, this._t0);
443
- this._prepareRowForTextureGeneration(1.0, 0, 0, this._t1);
444
- this._prepareRowForTextureGeneration(0, 1.0, 0, this._t2);
445
- this._t1.subtractInPlace(this._t0);
446
- this._t2.subtractInPlace(this._t0);
447
- Matrix.FromValuesToRef(this._t1.x, this._t1.y, this._t1.z, 0.0, this._t2.x, this._t2.y, this._t2.z, 0.0, this._t0.x, this._t0.y, this._t0.z, 0.0, 0.0, 0.0, 0.0, 1.0, this._cachedTextureMatrix);
448
- }
449
- const scene = this.getScene();
450
- if (!scene) {
451
- return this._cachedTextureMatrix;
452
- }
453
- const previousIdentity3x2 = this._cachedIdentity3x2;
454
- this._cachedIdentity3x2 = this._cachedTextureMatrix.isIdentityAs3x2();
455
- if (this.optimizeUVAllocation && previousIdentity3x2 !== this._cachedIdentity3x2) {
456
- // We flag the materials that are using this texture as "texture dirty" because depending on the fact that the matrix is the identity or not, some defines
457
- // will get different values (see PrepareDefinesForMergedUV), meaning we should regenerate the effect accordingly
458
- scene.markAllMaterialsAsDirty(1, (mat) => {
459
- return mat.hasTexture(this);
460
- });
461
- }
462
- return this._cachedTextureMatrix;
463
- }
464
- /**
465
- * Get the current matrix used to apply reflection. This is useful to rotate an environment texture for instance.
466
- * @returns The reflection texture transform
467
- */
468
- getReflectionTextureMatrix() {
469
- const scene = this.getScene();
470
- if (!scene) {
471
- return this._cachedReflectionTextureMatrix;
472
- }
473
- if (this.uOffset === this._cachedReflectionUOffset &&
474
- this.vOffset === this._cachedReflectionVOffset &&
475
- this.uScale === this._cachedReflectionUScale &&
476
- this.vScale === this._cachedReflectionVScale &&
477
- this.coordinatesMode === this._cachedReflectionCoordinatesMode) {
478
- if (this.coordinatesMode === Texture.PROJECTION_MODE) {
479
- if (this._cachedReflectionProjectionMatrixId === scene.getProjectionMatrix().updateFlag) {
418
+ this._delayedOnLoad = null;
419
+ this._delayedOnError = null;
420
+ }
421
+ _prepareRowForTextureGeneration(x, y, z, t) {
422
+ x *= this._cachedUScale;
423
+ y *= this._cachedVScale;
424
+ x -= this.uRotationCenter * this._cachedUScale;
425
+ y -= this.vRotationCenter * this._cachedVScale;
426
+ z -= this.wRotationCenter;
427
+ Vector3.TransformCoordinatesFromFloatsToRef(x, y, z, this._rowGenerationMatrix, t);
428
+ t.x += this.uRotationCenter * this._cachedUScale + this._cachedUOffset;
429
+ t.y += this.vRotationCenter * this._cachedVScale + this._cachedVOffset;
430
+ t.z += this.wRotationCenter;
431
+ }
432
+ /**
433
+ * Get the current texture matrix which includes the requested offsetting, tiling and rotation components.
434
+ * @param uBase The horizontal base offset multiplier (1 by default)
435
+ * @returns the transform matrix of the texture.
436
+ */
437
+ getTextureMatrix(uBase = 1) {
438
+ if (this.uOffset === this._cachedUOffset &&
439
+ this.vOffset === this._cachedVOffset &&
440
+ this.uScale * uBase === this._cachedUScale &&
441
+ this.vScale === this._cachedVScale &&
442
+ this.uAng === this._cachedUAng &&
443
+ this.vAng === this._cachedVAng &&
444
+ this.wAng === this._cachedWAng &&
445
+ this.uRotationCenter === this._cachedURotationCenter &&
446
+ this.vRotationCenter === this._cachedVRotationCenter &&
447
+ this.wRotationCenter === this._cachedWRotationCenter &&
448
+ this.homogeneousRotationInUVTransform === this._cachedHomogeneousRotationInUVTransform) {
449
+ return this._cachedTextureMatrix;
450
+ }
451
+ this._cachedUOffset = this.uOffset;
452
+ this._cachedVOffset = this.vOffset;
453
+ this._cachedUScale = this.uScale * uBase;
454
+ this._cachedVScale = this.vScale;
455
+ this._cachedUAng = this.uAng;
456
+ this._cachedVAng = this.vAng;
457
+ this._cachedWAng = this.wAng;
458
+ this._cachedURotationCenter = this.uRotationCenter;
459
+ this._cachedVRotationCenter = this.vRotationCenter;
460
+ this._cachedWRotationCenter = this.wRotationCenter;
461
+ this._cachedHomogeneousRotationInUVTransform = this.homogeneousRotationInUVTransform;
462
+ if (!this._cachedTextureMatrix || !this._rowGenerationMatrix) {
463
+ this._cachedTextureMatrix = Matrix.Zero();
464
+ this._rowGenerationMatrix = new Matrix();
465
+ this._t0 = Vector3.Zero();
466
+ this._t1 = Vector3.Zero();
467
+ this._t2 = Vector3.Zero();
468
+ }
469
+ Matrix.RotationYawPitchRollToRef(this.vAng, this.uAng, this.wAng, this._rowGenerationMatrix);
470
+ if (this.homogeneousRotationInUVTransform) {
471
+ Matrix.TranslationToRef(-this._cachedURotationCenter, -this._cachedVRotationCenter, -this._cachedWRotationCenter, TmpVectors.Matrix[0]);
472
+ Matrix.TranslationToRef(this._cachedURotationCenter, this._cachedVRotationCenter, this._cachedWRotationCenter, TmpVectors.Matrix[1]);
473
+ Matrix.ScalingToRef(this._cachedUScale, this._cachedVScale, 0, TmpVectors.Matrix[2]);
474
+ Matrix.TranslationToRef(this._cachedUOffset, this._cachedVOffset, 0, TmpVectors.Matrix[3]);
475
+ TmpVectors.Matrix[0].multiplyToRef(this._rowGenerationMatrix, this._cachedTextureMatrix);
476
+ this._cachedTextureMatrix.multiplyToRef(TmpVectors.Matrix[1], this._cachedTextureMatrix);
477
+ this._cachedTextureMatrix.multiplyToRef(TmpVectors.Matrix[2], this._cachedTextureMatrix);
478
+ this._cachedTextureMatrix.multiplyToRef(TmpVectors.Matrix[3], this._cachedTextureMatrix);
479
+ // copy the translation row to the 3rd row of the matrix so that we don't need to update the shaders (which expects the translation to be on the 3rd row)
480
+ this._cachedTextureMatrix.setRowFromFloats(2, this._cachedTextureMatrix.m[12], this._cachedTextureMatrix.m[13], this._cachedTextureMatrix.m[14], 1);
481
+ }
482
+ else {
483
+ this._prepareRowForTextureGeneration(0, 0, 0, this._t0);
484
+ this._prepareRowForTextureGeneration(1.0, 0, 0, this._t1);
485
+ this._prepareRowForTextureGeneration(0, 1.0, 0, this._t2);
486
+ this._t1.subtractInPlace(this._t0);
487
+ this._t2.subtractInPlace(this._t0);
488
+ Matrix.FromValuesToRef(this._t1.x, this._t1.y, this._t1.z, 0.0, this._t2.x, this._t2.y, this._t2.z, 0.0, this._t0.x, this._t0.y, this._t0.z, 0.0, 0.0, 0.0, 0.0, 1.0, this._cachedTextureMatrix);
489
+ }
490
+ const scene = this.getScene();
491
+ if (!scene) {
492
+ return this._cachedTextureMatrix;
493
+ }
494
+ const previousIdentity3x2 = this._cachedIdentity3x2;
495
+ this._cachedIdentity3x2 = this._cachedTextureMatrix.isIdentityAs3x2();
496
+ if (this.optimizeUVAllocation && previousIdentity3x2 !== this._cachedIdentity3x2) {
497
+ // We flag the materials that are using this texture as "texture dirty" because depending on the fact that the matrix is the identity or not, some defines
498
+ // will get different values (see PrepareDefinesForMergedUV), meaning we should regenerate the effect accordingly
499
+ scene.markAllMaterialsAsDirty(1, (mat) => {
500
+ return mat.hasTexture(this);
501
+ });
502
+ }
503
+ return this._cachedTextureMatrix;
504
+ }
505
+ /**
506
+ * Get the current matrix used to apply reflection. This is useful to rotate an environment texture for instance.
507
+ * @returns The reflection texture transform
508
+ */
509
+ getReflectionTextureMatrix() {
510
+ const scene = this.getScene();
511
+ if (!scene) {
480
512
  return this._cachedReflectionTextureMatrix;
481
513
  }
482
- }
483
- else {
514
+ if (this.uOffset === this._cachedReflectionUOffset &&
515
+ this.vOffset === this._cachedReflectionVOffset &&
516
+ this.uScale === this._cachedReflectionUScale &&
517
+ this.vScale === this._cachedReflectionVScale &&
518
+ this.coordinatesMode === this._cachedReflectionCoordinatesMode) {
519
+ if (this.coordinatesMode === _a.PROJECTION_MODE) {
520
+ if (this._cachedReflectionProjectionMatrixId === scene.getProjectionMatrix().updateFlag) {
521
+ return this._cachedReflectionTextureMatrix;
522
+ }
523
+ }
524
+ else {
525
+ return this._cachedReflectionTextureMatrix;
526
+ }
527
+ }
528
+ if (!this._cachedReflectionTextureMatrix) {
529
+ this._cachedReflectionTextureMatrix = Matrix.Zero();
530
+ }
531
+ if (!this._projectionModeMatrix) {
532
+ this._projectionModeMatrix = Matrix.Zero();
533
+ }
534
+ const flagMaterialsAsTextureDirty = this._cachedReflectionCoordinatesMode !== this.coordinatesMode;
535
+ this._cachedReflectionUOffset = this.uOffset;
536
+ this._cachedReflectionVOffset = this.vOffset;
537
+ this._cachedReflectionUScale = this.uScale;
538
+ this._cachedReflectionVScale = this.vScale;
539
+ this._cachedReflectionCoordinatesMode = this.coordinatesMode;
540
+ switch (this.coordinatesMode) {
541
+ case _a.PLANAR_MODE: {
542
+ Matrix.IdentityToRef(this._cachedReflectionTextureMatrix);
543
+ this._cachedReflectionTextureMatrix[0] = this.uScale;
544
+ this._cachedReflectionTextureMatrix[5] = this.vScale;
545
+ this._cachedReflectionTextureMatrix[12] = this.uOffset;
546
+ this._cachedReflectionTextureMatrix[13] = this.vOffset;
547
+ break;
548
+ }
549
+ case _a.PROJECTION_MODE: {
550
+ Matrix.FromValuesToRef(0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 1.0, 1.0, this._projectionModeMatrix);
551
+ const projectionMatrix = scene.getProjectionMatrix();
552
+ this._cachedReflectionProjectionMatrixId = projectionMatrix.updateFlag;
553
+ projectionMatrix.multiplyToRef(this._projectionModeMatrix, this._cachedReflectionTextureMatrix);
554
+ break;
555
+ }
556
+ default:
557
+ Matrix.IdentityToRef(this._cachedReflectionTextureMatrix);
558
+ break;
559
+ }
560
+ if (flagMaterialsAsTextureDirty) {
561
+ // We flag the materials that are using this texture as "texture dirty" if the coordinatesMode has changed.
562
+ // Indeed, this property is used to set the value of some defines used to generate the effect (in material.isReadyForSubMesh), so we must make sure this code will be re-executed and the effect recreated if necessary
563
+ scene.markAllMaterialsAsDirty(1, (mat) => {
564
+ return mat.hasTexture(this);
565
+ });
566
+ }
484
567
  return this._cachedReflectionTextureMatrix;
485
568
  }
486
- }
487
- if (!this._cachedReflectionTextureMatrix) {
488
- this._cachedReflectionTextureMatrix = Matrix.Zero();
489
- }
490
- if (!this._projectionModeMatrix) {
491
- this._projectionModeMatrix = Matrix.Zero();
492
- }
493
- const flagMaterialsAsTextureDirty = this._cachedReflectionCoordinatesMode !== this.coordinatesMode;
494
- this._cachedReflectionUOffset = this.uOffset;
495
- this._cachedReflectionVOffset = this.vOffset;
496
- this._cachedReflectionUScale = this.uScale;
497
- this._cachedReflectionVScale = this.vScale;
498
- this._cachedReflectionCoordinatesMode = this.coordinatesMode;
499
- switch (this.coordinatesMode) {
500
- case Texture.PLANAR_MODE: {
501
- Matrix.IdentityToRef(this._cachedReflectionTextureMatrix);
502
- this._cachedReflectionTextureMatrix[0] = this.uScale;
503
- this._cachedReflectionTextureMatrix[5] = this.vScale;
504
- this._cachedReflectionTextureMatrix[12] = this.uOffset;
505
- this._cachedReflectionTextureMatrix[13] = this.vOffset;
506
- break;
507
- }
508
- case Texture.PROJECTION_MODE: {
509
- Matrix.FromValuesToRef(0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 1.0, 1.0, this._projectionModeMatrix);
510
- const projectionMatrix = scene.getProjectionMatrix();
511
- this._cachedReflectionProjectionMatrixId = projectionMatrix.updateFlag;
512
- projectionMatrix.multiplyToRef(this._projectionModeMatrix, this._cachedReflectionTextureMatrix);
513
- break;
514
- }
515
- default:
516
- Matrix.IdentityToRef(this._cachedReflectionTextureMatrix);
517
- break;
518
- }
519
- if (flagMaterialsAsTextureDirty) {
520
- // We flag the materials that are using this texture as "texture dirty" if the coordinatesMode has changed.
521
- // Indeed, this property is used to set the value of some defines used to generate the effect (in material.isReadyForSubMesh), so we must make sure this code will be re-executed and the effect recreated if necessary
522
- scene.markAllMaterialsAsDirty(1, (mat) => {
523
- return mat.hasTexture(this);
524
- });
525
- }
526
- return this._cachedReflectionTextureMatrix;
527
- }
528
- /**
529
- * Clones the texture.
530
- * @returns the cloned texture
531
- */
532
- clone() {
533
- const options = {
534
- noMipmap: this._noMipmap,
535
- invertY: this._invertY,
536
- samplingMode: this.samplingMode,
537
- onLoad: undefined,
538
- onError: undefined,
539
- buffer: this._texture ? this._texture._buffer : undefined,
540
- deleteBuffer: this._deleteBuffer,
541
- format: this.textureFormat,
542
- mimeType: this.mimeType,
543
- loaderOptions: this._loaderOptions,
544
- creationFlags: this._creationFlags,
545
- useSRGBBuffer: this._useSRGBBuffer,
546
- };
547
- return SerializationHelper.Clone(() => {
548
- return new Texture(this._texture ? this._texture.url : null, this.getScene(), options);
549
- }, this);
550
- }
551
- /**
552
- * Serialize the texture to a JSON representation we can easily use in the respective Parse function.
553
- * @returns The JSON representation of the texture
554
- */
555
- serialize() {
556
- const savedName = this.name;
557
- if (!Texture.SerializeBuffers) {
558
- if (this.name.startsWith("data:")) {
559
- this.name = "";
560
- }
561
- }
562
- if (this.name.startsWith("data:") && this.url === this.name) {
563
- this.url = "";
564
- }
565
- const serializationObject = super.serialize(Texture._SerializeInternalTextureUniqueId);
566
- if (!serializationObject) {
567
- return null;
568
- }
569
- if (Texture.SerializeBuffers || Texture.ForceSerializeBuffers) {
570
- if (typeof this._buffer === "string" && this._buffer.startsWith("data:")) {
571
- serializationObject.base64String = this._buffer;
572
- serializationObject.name = serializationObject.name.replace("data:", "");
573
- }
574
- else if (this.url && this.url.startsWith("data:") && this._buffer instanceof Uint8Array) {
575
- const mimeType = this.mimeType || "image/png";
576
- serializationObject.base64String = `data:${mimeType};base64,${EncodeArrayBufferToBase64(this._buffer)}`;
577
- }
578
- else if (Texture.ForceSerializeBuffers || (this.url && this.url.startsWith("blob:")) || this._forceSerialize) {
579
- serializationObject.base64String =
580
- !this._engine || this._engine._features.supportSyncTextureRead ? GenerateBase64StringFromTexture(this) : GenerateBase64StringFromTextureAsync(this);
581
- }
582
- }
583
- serializationObject.invertY = this._invertY;
584
- serializationObject.samplingMode = this.samplingMode;
585
- serializationObject._creationFlags = this._creationFlags;
586
- serializationObject._useSRGBBuffer = this._useSRGBBuffer;
587
- serializationObject._format = this._format;
588
- serializationObject._forcedExtension = this._forcedExtension;
589
- if (Texture._SerializeInternalTextureUniqueId) {
590
- serializationObject.internalTextureUniqueId = this._texture?.uniqueId;
591
- }
592
- serializationObject.internalTextureLabel = this._texture?.label;
593
- serializationObject.noMipmap = this._noMipmap;
594
- serializationObject.mimeType = this.mimeType;
595
- this.name = savedName;
596
- return serializationObject;
597
- }
598
- /**
599
- * Get the current class name of the texture useful for serialization or dynamic coding.
600
- * @returns "Texture"
601
- */
602
- getClassName() {
603
- return "Texture";
604
- }
605
- /**
606
- * Dispose the texture and release its associated resources.
607
- */
608
- dispose() {
609
- super.dispose();
610
- this.onLoadObservable.clear();
611
- this._delayedOnLoad = null;
612
- this._delayedOnError = null;
613
- this._buffer = null;
614
- }
615
- /**
616
- * Parse the JSON representation of a texture in order to recreate the texture in the given scene.
617
- * @param parsedTexture Define the JSON representation of the texture
618
- * @param scene Define the scene the parsed texture should be instantiated in
619
- * @param rootUrl Define the root url of the parsing sequence in the case of relative dependencies
620
- * @returns The parsed texture if successful
621
- */
622
- static Parse(parsedTexture, scene, rootUrl) {
623
- if (parsedTexture.customType) {
624
- const customTexture = InstantiationTools.Instantiate(parsedTexture.customType);
625
- // Update Sampling Mode
626
- const parsedCustomTexture = customTexture.Parse(parsedTexture, scene, rootUrl);
627
- if (parsedTexture.samplingMode && parsedCustomTexture.updateSamplingMode && parsedCustomTexture._samplingMode) {
628
- if (parsedCustomTexture._samplingMode !== parsedTexture.samplingMode) {
629
- parsedCustomTexture.updateSamplingMode(parsedTexture.samplingMode);
569
+ /**
570
+ * Clones the texture.
571
+ * @returns the cloned texture
572
+ */
573
+ clone() {
574
+ const options = {
575
+ noMipmap: this._noMipmap,
576
+ invertY: this._invertY,
577
+ samplingMode: this.samplingMode,
578
+ onLoad: undefined,
579
+ onError: undefined,
580
+ buffer: this._texture ? this._texture._buffer : undefined,
581
+ deleteBuffer: this._deleteBuffer,
582
+ format: this.textureFormat,
583
+ mimeType: this.mimeType,
584
+ loaderOptions: this._loaderOptions,
585
+ creationFlags: this._creationFlags,
586
+ useSRGBBuffer: this._useSRGBBuffer,
587
+ };
588
+ return SerializationHelper.Clone(() => {
589
+ return new _a(this._texture ? this._texture.url : null, this.getScene(), options);
590
+ }, this);
591
+ }
592
+ /**
593
+ * Serialize the texture to a JSON representation we can easily use in the respective Parse function.
594
+ * @returns The JSON representation of the texture
595
+ */
596
+ serialize() {
597
+ const savedName = this.name;
598
+ if (!_a.SerializeBuffers) {
599
+ if (this.name.startsWith("data:")) {
600
+ this.name = "";
601
+ }
630
602
  }
631
- }
632
- if (!parsedCustomTexture.metadata && parsedTexture.metadata) {
633
- parsedCustomTexture.metadata = parsedTexture.metadata;
634
- }
635
- return parsedCustomTexture;
636
- }
637
- if (parsedTexture.isCube && !parsedTexture.isRenderTarget) {
638
- return Texture._CubeTextureParser(parsedTexture, scene, rootUrl);
639
- }
640
- const hasInternalTextureUniqueId = parsedTexture.internalTextureUniqueId !== undefined;
641
- if (!parsedTexture.name && !parsedTexture.isRenderTarget && !hasInternalTextureUniqueId) {
642
- return null;
643
- }
644
- let internalTexture;
645
- if (hasInternalTextureUniqueId) {
646
- const cache = scene.getEngine().getLoadedTexturesCache();
647
- for (const texture of cache) {
648
- if (texture.uniqueId === parsedTexture.internalTextureUniqueId) {
649
- internalTexture = texture;
650
- break;
603
+ if (this.name.startsWith("data:") && this.url === this.name) {
604
+ this.url = "";
651
605
  }
652
- }
653
- }
654
- const onLoaded = (texture) => {
655
- // Clear cache
656
- if (texture && texture._texture) {
657
- texture._texture._cachedWrapU = null;
658
- texture._texture._cachedWrapV = null;
659
- texture._texture._cachedWrapR = null;
660
- }
661
- // Update Sampling Mode
662
- if (parsedTexture.samplingMode) {
663
- const sampling = parsedTexture.samplingMode;
664
- if (texture && texture.samplingMode !== sampling) {
665
- texture.updateSamplingMode(sampling);
606
+ const serializationObject = super.serialize(_a._SerializeInternalTextureUniqueId);
607
+ if (!serializationObject) {
608
+ return null;
666
609
  }
667
- }
668
- // Animations
669
- if (texture && parsedTexture.animations) {
670
- for (let animationIndex = 0; animationIndex < parsedTexture.animations.length; animationIndex++) {
671
- const parsedAnimation = parsedTexture.animations[animationIndex];
672
- const internalClass = GetClass("BABYLON.Animation");
673
- if (internalClass) {
674
- texture.animations.push(internalClass.Parse(parsedAnimation));
610
+ if (_a.SerializeBuffers || _a.ForceSerializeBuffers) {
611
+ if (typeof this._buffer === "string" && this._buffer.startsWith("data:")) {
612
+ serializationObject.base64String = this._buffer;
613
+ serializationObject.name = serializationObject.name.replace("data:", "");
614
+ }
615
+ else if (this.url && this.url.startsWith("data:") && this._buffer instanceof Uint8Array) {
616
+ const mimeType = this.mimeType || "image/png";
617
+ serializationObject.base64String = `data:${mimeType};base64,${EncodeArrayBufferToBase64(this._buffer)}`;
618
+ }
619
+ else if (_a.ForceSerializeBuffers || (this.url && this.url.startsWith("blob:")) || this._forceSerialize) {
620
+ serializationObject.base64String =
621
+ !this._engine || this._engine._features.supportSyncTextureRead ? GenerateBase64StringFromTexture(this) : GenerateBase64StringFromTextureAsync(this);
675
622
  }
676
623
  }
677
- }
678
- if (texture && texture._texture) {
679
- if (hasInternalTextureUniqueId && !internalTexture) {
680
- texture._texture._setUniqueId(parsedTexture.internalTextureUniqueId);
624
+ serializationObject.invertY = this._invertY;
625
+ serializationObject.samplingMode = this.samplingMode;
626
+ serializationObject._creationFlags = this._creationFlags;
627
+ serializationObject._useSRGBBuffer = this._useSRGBBuffer;
628
+ serializationObject._format = this._format;
629
+ serializationObject._forcedExtension = this._forcedExtension;
630
+ if (_a._SerializeInternalTextureUniqueId) {
631
+ serializationObject.internalTextureUniqueId = this._texture?.uniqueId;
681
632
  }
682
- texture._texture.label = parsedTexture.internalTextureLabel;
683
- }
684
- };
685
- const texture = SerializationHelper.Parse(() => {
686
- if (parsedTexture.isReflectionProbe) {
687
- return Texture._CreateReflectionProbeTexture(parsedTexture.name, parsedTexture.options, scene, parsedTexture.position, parsedTexture.attachedMesh);
688
- }
689
- let generateMipMaps = true;
690
- if (parsedTexture.noMipmap) {
691
- generateMipMaps = false;
692
- }
693
- if (parsedTexture.mirrorPlane) {
694
- const mirrorTexture = Texture._CreateMirror(parsedTexture.name, parsedTexture.renderTargetSize, scene, generateMipMaps);
695
- mirrorTexture._waitingRenderList = parsedTexture.renderList;
696
- mirrorTexture.mirrorPlane = Plane.FromArray(parsedTexture.mirrorPlane);
697
- onLoaded(mirrorTexture);
698
- return mirrorTexture;
633
+ serializationObject.internalTextureLabel = this._texture?.label;
634
+ serializationObject.noMipmap = this._noMipmap;
635
+ serializationObject.mimeType = this.mimeType;
636
+ this.name = savedName;
637
+ return serializationObject;
638
+ }
639
+ /**
640
+ * Get the current class name of the texture useful for serialization or dynamic coding.
641
+ * @returns "Texture"
642
+ */
643
+ getClassName() {
644
+ return "Texture";
645
+ }
646
+ /**
647
+ * Dispose the texture and release its associated resources.
648
+ */
649
+ dispose() {
650
+ super.dispose();
651
+ this.onLoadObservable.clear();
652
+ this._delayedOnLoad = null;
653
+ this._delayedOnError = null;
654
+ this._buffer = null;
699
655
  }
700
- else if (parsedTexture.isRenderTarget && !parsedTexture.base64String) {
701
- // if base64string is set it means the original RTT was baked
702
- let renderTargetTexture = null;
703
- if (parsedTexture.isCube) {
704
- // Search for an existing reflection probe (which contains a cube render target texture)
705
- if (scene.reflectionProbes) {
706
- for (let index = 0; index < scene.reflectionProbes.length; index++) {
707
- const probe = scene.reflectionProbes[index];
708
- if (probe.name === parsedTexture.name) {
709
- return probe.cubeTexture;
710
- }
656
+ /**
657
+ * Parse the JSON representation of a texture in order to recreate the texture in the given scene.
658
+ * @param parsedTexture Define the JSON representation of the texture
659
+ * @param scene Define the scene the parsed texture should be instantiated in
660
+ * @param rootUrl Define the root url of the parsing sequence in the case of relative dependencies
661
+ * @returns The parsed texture if successful
662
+ */
663
+ static Parse(parsedTexture, scene, rootUrl) {
664
+ if (parsedTexture.customType) {
665
+ const customTexture = InstantiationTools.Instantiate(parsedTexture.customType);
666
+ // Update Sampling Mode
667
+ const parsedCustomTexture = customTexture.Parse(parsedTexture, scene, rootUrl);
668
+ if (parsedTexture.samplingMode && parsedCustomTexture.updateSamplingMode && parsedCustomTexture._samplingMode) {
669
+ if (parsedCustomTexture._samplingMode !== parsedTexture.samplingMode) {
670
+ parsedCustomTexture.updateSamplingMode(parsedTexture.samplingMode);
711
671
  }
712
672
  }
673
+ if (!parsedCustomTexture.metadata && parsedTexture.metadata) {
674
+ parsedCustomTexture.metadata = parsedTexture.metadata;
675
+ }
676
+ return parsedCustomTexture;
713
677
  }
714
- else {
715
- renderTargetTexture = Texture._CreateRenderTargetTexture(parsedTexture.name, parsedTexture.renderTargetSize, scene, generateMipMaps, parsedTexture._creationFlags ?? 0);
716
- renderTargetTexture._waitingRenderList = parsedTexture.renderList;
678
+ if (parsedTexture.isCube && !parsedTexture.isRenderTarget) {
679
+ return _a._CubeTextureParser(parsedTexture, scene, rootUrl);
717
680
  }
718
- onLoaded(renderTargetTexture);
719
- return renderTargetTexture;
720
- }
721
- else if (parsedTexture.isVideo) {
722
- const texture = Texture._CreateVideoTexture(rootUrl + (parsedTexture.url || parsedTexture.name), rootUrl + (parsedTexture.src || parsedTexture.url), scene, generateMipMaps, parsedTexture.invertY, parsedTexture.samplingMode, parsedTexture.settings || {});
723
- onLoaded(texture);
724
- return texture;
725
- }
726
- else {
727
- let texture;
728
- if (parsedTexture.base64String && !internalTexture) {
729
- // name and url are the same to ensure caching happens from the actual base64 string
730
- texture = Texture.CreateFromBase64String(parsedTexture.base64String, parsedTexture.name, scene, {
731
- noMipmap: !generateMipMaps,
732
- useSRGBBuffer: parsedTexture._useSRGBBuffer,
733
- gammaSpace: parsedTexture.currentGammaSpace,
734
- invertY: parsedTexture.invertY,
735
- samplingMode: parsedTexture.samplingMode,
736
- buffer: parsedTexture.base64String,
737
- deleteBuffer: false,
738
- name: parsedTexture.name,
739
- mimeType: parsedTexture.mimeType,
740
- }, parsedTexture.invertY, parsedTexture.samplingMode, () => {
741
- onLoaded(texture);
742
- }, () => { }, parsedTexture._format, parsedTexture._creationFlags ?? 0, parsedTexture._forcedExtension);
743
- // prettier name to fit with the loaded data
744
- texture.name = parsedTexture.name;
681
+ const hasInternalTextureUniqueId = parsedTexture.internalTextureUniqueId !== undefined;
682
+ if (!parsedTexture.name && !parsedTexture.isRenderTarget && !hasInternalTextureUniqueId) {
683
+ return null;
745
684
  }
746
- else {
747
- let url;
748
- if (parsedTexture.name && (parsedTexture.name.indexOf("://") > 0 || parsedTexture.name.startsWith("data:"))) {
749
- url = parsedTexture.name;
685
+ let internalTexture;
686
+ if (hasInternalTextureUniqueId) {
687
+ const cache = scene.getEngine().getLoadedTexturesCache();
688
+ for (const texture of cache) {
689
+ if (texture.uniqueId === parsedTexture.internalTextureUniqueId) {
690
+ internalTexture = texture;
691
+ break;
692
+ }
750
693
  }
751
- else {
752
- url = rootUrl + parsedTexture.name;
753
- }
754
- if (parsedTexture.url && (parsedTexture.url.startsWith("data:") || Texture.UseSerializedUrlIfAny)) {
755
- url = parsedTexture.url;
756
- }
757
- const usedBuffer = (url || "").startsWith("data:") ? url : parsedTexture.buffer ? parsedTexture.buffer : null;
758
- if (usedBuffer) {
759
- url = "";
760
- }
761
- const options = {
762
- noMipmap: !generateMipMaps,
763
- invertY: parsedTexture.invertY,
764
- samplingMode: parsedTexture.samplingMode,
765
- useSRGBBuffer: parsedTexture._useSRGBBuffer,
766
- gammaSpace: parsedTexture.currentGammaSpace,
767
- buffer: usedBuffer,
768
- format: parsedTexture._format,
769
- deleteBuffer: usedBuffer ? false : undefined,
770
- creationFlags: parsedTexture._creationFlags ?? 0,
771
- onLoad: () => {
772
- onLoaded(texture);
773
- },
774
- internalTexture,
775
- name: parsedTexture.name,
776
- mimeType: parsedTexture.mimeType,
777
- };
778
- texture = new Texture(url, scene, options);
779
- texture.name = parsedTexture.name;
780
694
  }
695
+ const onLoaded = (texture) => {
696
+ // Clear cache
697
+ if (texture && texture._texture) {
698
+ texture._texture._cachedWrapU = null;
699
+ texture._texture._cachedWrapV = null;
700
+ texture._texture._cachedWrapR = null;
701
+ }
702
+ // Update Sampling Mode
703
+ if (parsedTexture.samplingMode) {
704
+ const sampling = parsedTexture.samplingMode;
705
+ if (texture && texture.samplingMode !== sampling) {
706
+ texture.updateSamplingMode(sampling);
707
+ }
708
+ }
709
+ // Animations
710
+ if (texture && parsedTexture.animations) {
711
+ for (let animationIndex = 0; animationIndex < parsedTexture.animations.length; animationIndex++) {
712
+ const parsedAnimation = parsedTexture.animations[animationIndex];
713
+ const internalClass = GetClass("BABYLON.Animation");
714
+ if (internalClass) {
715
+ texture.animations.push(internalClass.Parse(parsedAnimation));
716
+ }
717
+ }
718
+ }
719
+ if (texture && texture._texture) {
720
+ if (hasInternalTextureUniqueId && !internalTexture) {
721
+ texture._texture._setUniqueId(parsedTexture.internalTextureUniqueId);
722
+ }
723
+ texture._texture.label = parsedTexture.internalTextureLabel;
724
+ }
725
+ };
726
+ const texture = SerializationHelper.Parse(() => {
727
+ if (parsedTexture.isReflectionProbe) {
728
+ return _a._CreateReflectionProbeTexture(parsedTexture.name, parsedTexture.options, scene, parsedTexture.position, parsedTexture.attachedMesh);
729
+ }
730
+ let generateMipMaps = true;
731
+ if (parsedTexture.noMipmap) {
732
+ generateMipMaps = false;
733
+ }
734
+ if (parsedTexture.mirrorPlane) {
735
+ const mirrorTexture = _a._CreateMirror(parsedTexture.name, parsedTexture.renderTargetSize, scene, generateMipMaps);
736
+ mirrorTexture._waitingRenderList = parsedTexture.renderList;
737
+ mirrorTexture.mirrorPlane = Plane.FromArray(parsedTexture.mirrorPlane);
738
+ onLoaded(mirrorTexture);
739
+ return mirrorTexture;
740
+ }
741
+ else if (parsedTexture.isRenderTarget && !parsedTexture.base64String) {
742
+ // if base64string is set it means the original RTT was baked
743
+ let renderTargetTexture = null;
744
+ if (parsedTexture.isCube) {
745
+ // Search for an existing reflection probe (which contains a cube render target texture)
746
+ if (scene.reflectionProbes) {
747
+ for (let index = 0; index < scene.reflectionProbes.length; index++) {
748
+ const probe = scene.reflectionProbes[index];
749
+ if (probe.name === parsedTexture.name) {
750
+ return probe.cubeTexture;
751
+ }
752
+ }
753
+ }
754
+ }
755
+ else {
756
+ renderTargetTexture = _a._CreateRenderTargetTexture(parsedTexture.name, parsedTexture.renderTargetSize, scene, generateMipMaps, parsedTexture._creationFlags ?? 0);
757
+ renderTargetTexture._waitingRenderList = parsedTexture.renderList;
758
+ }
759
+ onLoaded(renderTargetTexture);
760
+ return renderTargetTexture;
761
+ }
762
+ else if (parsedTexture.isVideo) {
763
+ const texture = _a._CreateVideoTexture(rootUrl + (parsedTexture.url || parsedTexture.name), rootUrl + (parsedTexture.src || parsedTexture.url), scene, generateMipMaps, parsedTexture.invertY, parsedTexture.samplingMode, parsedTexture.settings || {});
764
+ onLoaded(texture);
765
+ return texture;
766
+ }
767
+ else {
768
+ let texture;
769
+ if (parsedTexture.base64String && !internalTexture) {
770
+ // name and url are the same to ensure caching happens from the actual base64 string
771
+ texture = _a.CreateFromBase64String(parsedTexture.base64String, parsedTexture.name, scene, {
772
+ noMipmap: !generateMipMaps,
773
+ useSRGBBuffer: parsedTexture._useSRGBBuffer,
774
+ gammaSpace: parsedTexture.currentGammaSpace,
775
+ invertY: parsedTexture.invertY,
776
+ samplingMode: parsedTexture.samplingMode,
777
+ buffer: parsedTexture.base64String,
778
+ deleteBuffer: false,
779
+ name: parsedTexture.name,
780
+ mimeType: parsedTexture.mimeType,
781
+ }, parsedTexture.invertY, parsedTexture.samplingMode, () => {
782
+ onLoaded(texture);
783
+ }, () => { }, parsedTexture._format, parsedTexture._creationFlags ?? 0, parsedTexture._forcedExtension);
784
+ // prettier name to fit with the loaded data
785
+ texture.name = parsedTexture.name;
786
+ }
787
+ else {
788
+ let url;
789
+ if (parsedTexture.name && (parsedTexture.name.indexOf("://") > 0 || parsedTexture.name.startsWith("data:"))) {
790
+ url = parsedTexture.name;
791
+ }
792
+ else {
793
+ url = rootUrl + parsedTexture.name;
794
+ }
795
+ if (parsedTexture.url && (parsedTexture.url.startsWith("data:") || _a.UseSerializedUrlIfAny)) {
796
+ url = parsedTexture.url;
797
+ }
798
+ const usedBuffer = (url || "").startsWith("data:") ? url : parsedTexture.buffer ? parsedTexture.buffer : null;
799
+ if (usedBuffer) {
800
+ url = "";
801
+ }
802
+ const options = {
803
+ noMipmap: !generateMipMaps,
804
+ invertY: parsedTexture.invertY,
805
+ samplingMode: parsedTexture.samplingMode,
806
+ useSRGBBuffer: parsedTexture._useSRGBBuffer,
807
+ gammaSpace: parsedTexture.currentGammaSpace,
808
+ buffer: usedBuffer,
809
+ format: parsedTexture._format,
810
+ deleteBuffer: usedBuffer ? false : undefined,
811
+ creationFlags: parsedTexture._creationFlags ?? 0,
812
+ onLoad: () => {
813
+ onLoaded(texture);
814
+ },
815
+ internalTexture,
816
+ name: parsedTexture.name,
817
+ mimeType: parsedTexture.mimeType,
818
+ };
819
+ texture = new _a(url, scene, options);
820
+ texture.name = parsedTexture.name;
821
+ }
822
+ return texture;
823
+ }
824
+ }, parsedTexture, scene);
781
825
  return texture;
782
826
  }
783
- }, parsedTexture, scene);
784
- return texture;
785
- }
786
- /**
787
- * Creates a texture from its base 64 representation.
788
- * @param data Define the base64 payload without the data: prefix
789
- * @param name Define the name of the texture in the scene useful fo caching purpose for instance
790
- * @param scene Define the scene the texture should belong to
791
- * @param noMipmapOrOptions defines if the texture will require mip maps or not or set of all options to create the texture
792
- * @param invertY define if the texture needs to be inverted on the y axis during loading
793
- * @param samplingMode define the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...)
794
- * @param onLoad define a callback triggered when the texture has been loaded
795
- * @param onError define a callback triggered when an error occurred during the loading session
796
- * @param format define the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)
797
- * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
798
- * @param forcedExtension defines the extension to use to pick the right loader
799
- * @returns the created texture
800
- */
801
- static CreateFromBase64String(data, name, scene, noMipmapOrOptions, invertY, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, onLoad = null, onError = null, format = 5, creationFlags, forcedExtension) {
802
- const texture = new Texture((data || "").startsWith("data:") ? data : "data:" + data, scene, noMipmapOrOptions, invertY, samplingMode, onLoad, onError, data, false, format, undefined, undefined, creationFlags, forcedExtension);
803
- texture.name = name;
804
- return texture;
805
- }
806
- /**
807
- * Creates a texture from its data: representation. (data: will be added in case only the payload has been passed in)
808
- * @param name Define the name of the texture in the scene useful fo caching purpose for instance
809
- * @param buffer define the buffer to load the texture from in case the texture is loaded from a buffer representation
810
- * @param scene Define the scene the texture should belong to
811
- * @param deleteBuffer define if the buffer we are loading the texture from should be deleted after load
812
- * @param noMipmapOrOptions defines if the texture will require mip maps or not or set of all options to create the texture
813
- * @param invertY define if the texture needs to be inverted on the y axis during loading
814
- * @param samplingMode define the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...)
815
- * @param onLoad define a callback triggered when the texture has been loaded
816
- * @param onError define a callback triggered when an error occurred during the loading session
817
- * @param format define the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)
818
- * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
819
- * @param forcedExtension defines the extension to use to pick the right loader
820
- * @returns the created texture
821
- */
822
- static LoadFromDataString(name, buffer, scene, deleteBuffer = false, noMipmapOrOptions, invertY = true, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, onLoad = null, onError = null, format = 5, creationFlags, forcedExtension) {
823
- if (name.substring(0, 5) !== "data:") {
824
- name = "data:" + name;
825
- }
826
- return new Texture(name, scene, noMipmapOrOptions, invertY, samplingMode, onLoad, onError, buffer, deleteBuffer, format, undefined, undefined, creationFlags, forcedExtension);
827
- }
828
- }
829
- /**
830
- * Gets or sets a general boolean used to indicate that textures containing direct data (buffers) must be saved as part of the serialization process
831
- */
832
- Texture.SerializeBuffers = true;
833
- /**
834
- * Gets or sets a general boolean used to indicate that texture buffers must be saved as part of the serialization process.
835
- * If no buffer exists, one will be created as base64 string from the internal webgl data.
836
- */
837
- Texture.ForceSerializeBuffers = false;
838
- /**
839
- * This observable will notify when any texture had a loading error
840
- */
841
- Texture.OnTextureLoadErrorObservable = new Observable();
842
- /** @internal */
843
- Texture._SerializeInternalTextureUniqueId = false;
844
- /**
845
- * @internal
846
- */
847
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
848
- Texture._CubeTextureParser = (jsonTexture, scene, rootUrl) => {
849
- throw _WarnImport("CubeTexture");
850
- };
851
- /**
852
- * @internal
853
- */
854
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
855
- Texture._CreateMirror = (name, renderTargetSize, scene, generateMipMaps) => {
856
- throw _WarnImport("MirrorTexture");
857
- };
858
- /**
859
- * @internal
860
- */
861
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
862
- Texture._CreateRenderTargetTexture = (name, renderTargetSize, scene, generateMipMaps, creationFlags) => {
863
- throw _WarnImport("RenderTargetTexture");
864
- };
865
- /**
866
- * @internal
867
- */
868
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
869
- Texture._CreateReflectionProbeTexture = (name, options, scene, position, attachedMesh) => {
870
- throw _WarnImport("ReflectionProbeTexture");
871
- };
872
- /** nearest is mag = nearest and min = nearest and no mip */
873
- Texture.NEAREST_SAMPLINGMODE = 1;
874
- /** nearest is mag = nearest and min = nearest and mip = linear */
875
- Texture.NEAREST_NEAREST_MIPLINEAR = 8; // nearest is mag = nearest and min = nearest and mip = linear
876
- /** Bilinear is mag = linear and min = linear and no mip */
877
- Texture.BILINEAR_SAMPLINGMODE = 2;
878
- /** Bilinear is mag = linear and min = linear and mip = nearest */
879
- Texture.LINEAR_LINEAR_MIPNEAREST = 11; // Bilinear is mag = linear and min = linear and mip = nearest
880
- /** Trilinear is mag = linear and min = linear and mip = linear */
881
- Texture.TRILINEAR_SAMPLINGMODE = 3;
882
- /** Trilinear is mag = linear and min = linear and mip = linear */
883
- Texture.LINEAR_LINEAR_MIPLINEAR = 3; // Trilinear is mag = linear and min = linear and mip = linear
884
- /** mag = nearest and min = nearest and mip = nearest */
885
- Texture.NEAREST_NEAREST_MIPNEAREST = 4;
886
- /** mag = nearest and min = linear and mip = nearest */
887
- Texture.NEAREST_LINEAR_MIPNEAREST = 5;
888
- /** mag = nearest and min = linear and mip = linear */
889
- Texture.NEAREST_LINEAR_MIPLINEAR = 6;
890
- /** mag = nearest and min = linear and mip = none */
891
- Texture.NEAREST_LINEAR = 7;
892
- /** mag = nearest and min = nearest and mip = none */
893
- Texture.NEAREST_NEAREST = 1;
894
- /** mag = linear and min = nearest and mip = nearest */
895
- Texture.LINEAR_NEAREST_MIPNEAREST = 9;
896
- /** mag = linear and min = nearest and mip = linear */
897
- Texture.LINEAR_NEAREST_MIPLINEAR = 10;
898
- /** mag = linear and min = linear and mip = none */
899
- Texture.LINEAR_LINEAR = 2;
900
- /** mag = linear and min = nearest and mip = none */
901
- Texture.LINEAR_NEAREST = 12;
902
- /** Explicit coordinates mode */
903
- Texture.EXPLICIT_MODE = 0;
904
- /** Spherical coordinates mode */
905
- Texture.SPHERICAL_MODE = 1;
906
- /** Planar coordinates mode */
907
- Texture.PLANAR_MODE = 2;
908
- /** Cubic coordinates mode */
909
- Texture.CUBIC_MODE = 3;
910
- /** Projection coordinates mode */
911
- Texture.PROJECTION_MODE = 4;
912
- /** Inverse Cubic coordinates mode */
913
- Texture.SKYBOX_MODE = 5;
914
- /** Inverse Cubic coordinates mode */
915
- Texture.INVCUBIC_MODE = 6;
916
- /** Equirectangular coordinates mode */
917
- Texture.EQUIRECTANGULAR_MODE = 7;
918
- /** Equirectangular Fixed coordinates mode */
919
- Texture.FIXED_EQUIRECTANGULAR_MODE = 8;
920
- /** Equirectangular Fixed Mirrored coordinates mode */
921
- Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9;
922
- /** Texture is not repeating outside of 0..1 UVs */
923
- Texture.CLAMP_ADDRESSMODE = 0;
924
- /** Texture is repeating outside of 0..1 UVs */
925
- Texture.WRAP_ADDRESSMODE = 1;
926
- /** Texture is repeating and mirrored */
927
- Texture.MIRROR_ADDRESSMODE = 2;
928
- /**
929
- * Gets or sets a boolean which defines if the texture url must be build from the serialized URL instead of just using the name and loading them side by side with the scene file
930
- */
931
- Texture.UseSerializedUrlIfAny = false;
932
- __decorate([
933
- serialize()
934
- ], Texture.prototype, "url", void 0);
935
- __decorate([
936
- serialize()
937
- ], Texture.prototype, "uOffset", void 0);
938
- __decorate([
939
- serialize()
940
- ], Texture.prototype, "vOffset", void 0);
941
- __decorate([
942
- serialize()
943
- ], Texture.prototype, "uScale", void 0);
944
- __decorate([
945
- serialize()
946
- ], Texture.prototype, "vScale", void 0);
947
- __decorate([
948
- serialize()
949
- ], Texture.prototype, "uAng", void 0);
950
- __decorate([
951
- serialize()
952
- ], Texture.prototype, "vAng", void 0);
953
- __decorate([
954
- serialize()
955
- ], Texture.prototype, "wAng", void 0);
956
- __decorate([
957
- serialize()
958
- ], Texture.prototype, "uRotationCenter", void 0);
959
- __decorate([
960
- serialize()
961
- ], Texture.prototype, "vRotationCenter", void 0);
962
- __decorate([
963
- serialize()
964
- ], Texture.prototype, "wRotationCenter", void 0);
965
- __decorate([
966
- serialize()
967
- ], Texture.prototype, "homogeneousRotationInUVTransform", void 0);
968
- __decorate([
969
- serialize()
970
- ], Texture.prototype, "isBlocking", null);
827
+ /**
828
+ * Creates a texture from its base 64 representation.
829
+ * @param data Define the base64 payload without the data: prefix
830
+ * @param name Define the name of the texture in the scene useful fo caching purpose for instance
831
+ * @param scene Define the scene the texture should belong to
832
+ * @param noMipmapOrOptions defines if the texture will require mip maps or not or set of all options to create the texture
833
+ * @param invertY define if the texture needs to be inverted on the y axis during loading
834
+ * @param samplingMode define the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...)
835
+ * @param onLoad define a callback triggered when the texture has been loaded
836
+ * @param onError define a callback triggered when an error occurred during the loading session
837
+ * @param format define the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)
838
+ * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
839
+ * @param forcedExtension defines the extension to use to pick the right loader
840
+ * @returns the created texture
841
+ */
842
+ static CreateFromBase64String(data, name, scene, noMipmapOrOptions, invertY, samplingMode = _a.TRILINEAR_SAMPLINGMODE, onLoad = null, onError = null, format = 5, creationFlags, forcedExtension) {
843
+ const texture = new _a((data || "").startsWith("data:") ? data : "data:" + data, scene, noMipmapOrOptions, invertY, samplingMode, onLoad, onError, data, false, format, undefined, undefined, creationFlags, forcedExtension);
844
+ texture.name = name;
845
+ return texture;
846
+ }
847
+ /**
848
+ * Creates a texture from its data: representation. (data: will be added in case only the payload has been passed in)
849
+ * @param name Define the name of the texture in the scene useful fo caching purpose for instance
850
+ * @param buffer define the buffer to load the texture from in case the texture is loaded from a buffer representation
851
+ * @param scene Define the scene the texture should belong to
852
+ * @param deleteBuffer define if the buffer we are loading the texture from should be deleted after load
853
+ * @param noMipmapOrOptions defines if the texture will require mip maps or not or set of all options to create the texture
854
+ * @param invertY define if the texture needs to be inverted on the y axis during loading
855
+ * @param samplingMode define the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...)
856
+ * @param onLoad define a callback triggered when the texture has been loaded
857
+ * @param onError define a callback triggered when an error occurred during the loading session
858
+ * @param format define the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)
859
+ * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
860
+ * @param forcedExtension defines the extension to use to pick the right loader
861
+ * @returns the created texture
862
+ */
863
+ static LoadFromDataString(name, buffer, scene, deleteBuffer = false, noMipmapOrOptions, invertY = true, samplingMode = _a.TRILINEAR_SAMPLINGMODE, onLoad = null, onError = null, format = 5, creationFlags, forcedExtension) {
864
+ if (name.substring(0, 5) !== "data:") {
865
+ name = "data:" + name;
866
+ }
867
+ return new _a(name, scene, noMipmapOrOptions, invertY, samplingMode, onLoad, onError, buffer, deleteBuffer, format, undefined, undefined, creationFlags, forcedExtension);
868
+ }
869
+ },
870
+ (() => {
871
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
872
+ _url_decorators = [serialize()];
873
+ _uOffset_decorators = [serialize()];
874
+ _vOffset_decorators = [serialize()];
875
+ _uScale_decorators = [serialize()];
876
+ _vScale_decorators = [serialize()];
877
+ _uAng_decorators = [serialize()];
878
+ _vAng_decorators = [serialize()];
879
+ _wAng_decorators = [serialize()];
880
+ _uRotationCenter_decorators = [serialize()];
881
+ _vRotationCenter_decorators = [serialize()];
882
+ _wRotationCenter_decorators = [serialize()];
883
+ _homogeneousRotationInUVTransform_decorators = [serialize()];
884
+ _get_isBlocking_decorators = [serialize()];
885
+ __esDecorate(_a, null, _get_isBlocking_decorators, { kind: "getter", name: "isBlocking", static: false, private: false, access: { has: obj => "isBlocking" in obj, get: obj => obj.isBlocking }, metadata: _metadata }, null, _instanceExtraInitializers);
886
+ __esDecorate(null, null, _url_decorators, { kind: "field", name: "url", static: false, private: false, access: { has: obj => "url" in obj, get: obj => obj.url, set: (obj, value) => { obj.url = value; } }, metadata: _metadata }, _url_initializers, _url_extraInitializers);
887
+ __esDecorate(null, null, _uOffset_decorators, { kind: "field", name: "uOffset", static: false, private: false, access: { has: obj => "uOffset" in obj, get: obj => obj.uOffset, set: (obj, value) => { obj.uOffset = value; } }, metadata: _metadata }, _uOffset_initializers, _uOffset_extraInitializers);
888
+ __esDecorate(null, null, _vOffset_decorators, { kind: "field", name: "vOffset", static: false, private: false, access: { has: obj => "vOffset" in obj, get: obj => obj.vOffset, set: (obj, value) => { obj.vOffset = value; } }, metadata: _metadata }, _vOffset_initializers, _vOffset_extraInitializers);
889
+ __esDecorate(null, null, _uScale_decorators, { kind: "field", name: "uScale", static: false, private: false, access: { has: obj => "uScale" in obj, get: obj => obj.uScale, set: (obj, value) => { obj.uScale = value; } }, metadata: _metadata }, _uScale_initializers, _uScale_extraInitializers);
890
+ __esDecorate(null, null, _vScale_decorators, { kind: "field", name: "vScale", static: false, private: false, access: { has: obj => "vScale" in obj, get: obj => obj.vScale, set: (obj, value) => { obj.vScale = value; } }, metadata: _metadata }, _vScale_initializers, _vScale_extraInitializers);
891
+ __esDecorate(null, null, _uAng_decorators, { kind: "field", name: "uAng", static: false, private: false, access: { has: obj => "uAng" in obj, get: obj => obj.uAng, set: (obj, value) => { obj.uAng = value; } }, metadata: _metadata }, _uAng_initializers, _uAng_extraInitializers);
892
+ __esDecorate(null, null, _vAng_decorators, { kind: "field", name: "vAng", static: false, private: false, access: { has: obj => "vAng" in obj, get: obj => obj.vAng, set: (obj, value) => { obj.vAng = value; } }, metadata: _metadata }, _vAng_initializers, _vAng_extraInitializers);
893
+ __esDecorate(null, null, _wAng_decorators, { kind: "field", name: "wAng", static: false, private: false, access: { has: obj => "wAng" in obj, get: obj => obj.wAng, set: (obj, value) => { obj.wAng = value; } }, metadata: _metadata }, _wAng_initializers, _wAng_extraInitializers);
894
+ __esDecorate(null, null, _uRotationCenter_decorators, { kind: "field", name: "uRotationCenter", static: false, private: false, access: { has: obj => "uRotationCenter" in obj, get: obj => obj.uRotationCenter, set: (obj, value) => { obj.uRotationCenter = value; } }, metadata: _metadata }, _uRotationCenter_initializers, _uRotationCenter_extraInitializers);
895
+ __esDecorate(null, null, _vRotationCenter_decorators, { kind: "field", name: "vRotationCenter", static: false, private: false, access: { has: obj => "vRotationCenter" in obj, get: obj => obj.vRotationCenter, set: (obj, value) => { obj.vRotationCenter = value; } }, metadata: _metadata }, _vRotationCenter_initializers, _vRotationCenter_extraInitializers);
896
+ __esDecorate(null, null, _wRotationCenter_decorators, { kind: "field", name: "wRotationCenter", static: false, private: false, access: { has: obj => "wRotationCenter" in obj, get: obj => obj.wRotationCenter, set: (obj, value) => { obj.wRotationCenter = value; } }, metadata: _metadata }, _wRotationCenter_initializers, _wRotationCenter_extraInitializers);
897
+ __esDecorate(null, null, _homogeneousRotationInUVTransform_decorators, { kind: "field", name: "homogeneousRotationInUVTransform", static: false, private: false, access: { has: obj => "homogeneousRotationInUVTransform" in obj, get: obj => obj.homogeneousRotationInUVTransform, set: (obj, value) => { obj.homogeneousRotationInUVTransform = value; } }, metadata: _metadata }, _homogeneousRotationInUVTransform_initializers, _homogeneousRotationInUVTransform_extraInitializers);
898
+ if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
899
+ })(),
900
+ /**
901
+ * Gets or sets a general boolean used to indicate that textures containing direct data (buffers) must be saved as part of the serialization process
902
+ */
903
+ _a.SerializeBuffers = true,
904
+ /**
905
+ * Gets or sets a general boolean used to indicate that texture buffers must be saved as part of the serialization process.
906
+ * If no buffer exists, one will be created as base64 string from the internal webgl data.
907
+ */
908
+ _a.ForceSerializeBuffers = false,
909
+ /**
910
+ * This observable will notify when any texture had a loading error
911
+ */
912
+ _a.OnTextureLoadErrorObservable = new Observable(),
913
+ /** @internal */
914
+ _a._SerializeInternalTextureUniqueId = false,
915
+ /**
916
+ * @internal
917
+ */
918
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
919
+ _a._CubeTextureParser = (jsonTexture, scene, rootUrl) => {
920
+ throw _WarnImport("CubeTexture");
921
+ },
922
+ /**
923
+ * @internal
924
+ */
925
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
926
+ _a._CreateMirror = (name, renderTargetSize, scene, generateMipMaps) => {
927
+ throw _WarnImport("MirrorTexture");
928
+ },
929
+ /**
930
+ * @internal
931
+ */
932
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
933
+ _a._CreateRenderTargetTexture = (name, renderTargetSize, scene, generateMipMaps, creationFlags) => {
934
+ throw _WarnImport("RenderTargetTexture");
935
+ },
936
+ /**
937
+ * @internal
938
+ */
939
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
940
+ _a._CreateReflectionProbeTexture = (name, options, scene, position, attachedMesh) => {
941
+ throw _WarnImport("ReflectionProbeTexture");
942
+ },
943
+ /** nearest is mag = nearest and min = nearest and no mip */
944
+ _a.NEAREST_SAMPLINGMODE = 1,
945
+ /** nearest is mag = nearest and min = nearest and mip = linear */
946
+ _a.NEAREST_NEAREST_MIPLINEAR = 8 // nearest is mag = nearest and min = nearest and mip = linear
947
+ ,
948
+ /** Bilinear is mag = linear and min = linear and no mip */
949
+ _a.BILINEAR_SAMPLINGMODE = 2,
950
+ /** Bilinear is mag = linear and min = linear and mip = nearest */
951
+ _a.LINEAR_LINEAR_MIPNEAREST = 11 // Bilinear is mag = linear and min = linear and mip = nearest
952
+ ,
953
+ /** Trilinear is mag = linear and min = linear and mip = linear */
954
+ _a.TRILINEAR_SAMPLINGMODE = 3,
955
+ /** Trilinear is mag = linear and min = linear and mip = linear */
956
+ _a.LINEAR_LINEAR_MIPLINEAR = 3 // Trilinear is mag = linear and min = linear and mip = linear
957
+ ,
958
+ /** mag = nearest and min = nearest and mip = nearest */
959
+ _a.NEAREST_NEAREST_MIPNEAREST = 4,
960
+ /** mag = nearest and min = linear and mip = nearest */
961
+ _a.NEAREST_LINEAR_MIPNEAREST = 5,
962
+ /** mag = nearest and min = linear and mip = linear */
963
+ _a.NEAREST_LINEAR_MIPLINEAR = 6,
964
+ /** mag = nearest and min = linear and mip = none */
965
+ _a.NEAREST_LINEAR = 7,
966
+ /** mag = nearest and min = nearest and mip = none */
967
+ _a.NEAREST_NEAREST = 1,
968
+ /** mag = linear and min = nearest and mip = nearest */
969
+ _a.LINEAR_NEAREST_MIPNEAREST = 9,
970
+ /** mag = linear and min = nearest and mip = linear */
971
+ _a.LINEAR_NEAREST_MIPLINEAR = 10,
972
+ /** mag = linear and min = linear and mip = none */
973
+ _a.LINEAR_LINEAR = 2,
974
+ /** mag = linear and min = nearest and mip = none */
975
+ _a.LINEAR_NEAREST = 12,
976
+ /** Explicit coordinates mode */
977
+ _a.EXPLICIT_MODE = 0,
978
+ /** Spherical coordinates mode */
979
+ _a.SPHERICAL_MODE = 1,
980
+ /** Planar coordinates mode */
981
+ _a.PLANAR_MODE = 2,
982
+ /** Cubic coordinates mode */
983
+ _a.CUBIC_MODE = 3,
984
+ /** Projection coordinates mode */
985
+ _a.PROJECTION_MODE = 4,
986
+ /** Inverse Cubic coordinates mode */
987
+ _a.SKYBOX_MODE = 5,
988
+ /** Inverse Cubic coordinates mode */
989
+ _a.INVCUBIC_MODE = 6,
990
+ /** Equirectangular coordinates mode */
991
+ _a.EQUIRECTANGULAR_MODE = 7,
992
+ /** Equirectangular Fixed coordinates mode */
993
+ _a.FIXED_EQUIRECTANGULAR_MODE = 8,
994
+ /** Equirectangular Fixed Mirrored coordinates mode */
995
+ _a.FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9,
996
+ /** Texture is not repeating outside of 0..1 UVs */
997
+ _a.CLAMP_ADDRESSMODE = 0,
998
+ /** Texture is repeating outside of 0..1 UVs */
999
+ _a.WRAP_ADDRESSMODE = 1,
1000
+ /** Texture is repeating and mirrored */
1001
+ _a.MIRROR_ADDRESSMODE = 2,
1002
+ /**
1003
+ * Gets or sets a boolean which defines if the texture url must be build from the serialized URL instead of just using the name and loading them side by side with the scene file
1004
+ */
1005
+ _a.UseSerializedUrlIfAny = false,
1006
+ _a;
1007
+ })();
1008
+ export { Texture };
971
1009
  let _Registered = false;
972
1010
  /**
973
1011
  * Register side effects for texture.