@onerjs/core 8.53.5 → 8.53.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (841) hide show
  1. package/Animations/animationGroup.d.ts +0 -1
  2. package/Animations/animationGroup.js +0 -1
  3. package/Animations/animationGroup.js.map +1 -1
  4. package/Animations/animationGroup.pure.js +2 -0
  5. package/Animations/animationGroup.pure.js.map +1 -1
  6. package/Animations/runtimeAnimation.js +11 -0
  7. package/Animations/runtimeAnimation.js.map +1 -1
  8. package/Audio/audioSceneComponent.pure.js +1 -1
  9. package/AudioV2/abstractAudio/abstractSound.d.ts +2 -1
  10. package/AudioV2/abstractAudio/abstractSound.js +7 -2
  11. package/AudioV2/abstractAudio/abstractSound.js.map +1 -1
  12. package/AudioV2/abstractAudio/abstractSoundInstance.d.ts +3 -1
  13. package/AudioV2/abstractAudio/abstractSoundInstance.js.map +1 -1
  14. package/AudioV2/abstractAudio/staticSound.d.ts +6 -0
  15. package/AudioV2/abstractAudio/staticSound.js +17 -1
  16. package/AudioV2/abstractAudio/staticSound.js.map +1 -1
  17. package/AudioV2/abstractAudio/staticSoundInstance.d.ts +4 -2
  18. package/AudioV2/abstractAudio/staticSoundInstance.js.map +1 -1
  19. package/AudioV2/abstractAudio/streamingSound.d.ts +6 -0
  20. package/AudioV2/abstractAudio/streamingSound.js +9 -1
  21. package/AudioV2/abstractAudio/streamingSound.js.map +1 -1
  22. package/AudioV2/webAudio/webAudioStaticSound.d.ts +7 -1
  23. package/AudioV2/webAudio/webAudioStaticSound.js +56 -8
  24. package/AudioV2/webAudio/webAudioStaticSound.js.map +1 -1
  25. package/AudioV2/webAudio/webAudioStreamingSound.d.ts +3 -1
  26. package/AudioV2/webAudio/webAudioStreamingSound.js +16 -4
  27. package/AudioV2/webAudio/webAudioStreamingSound.js.map +1 -1
  28. package/BakedVertexAnimation/bakedVertexAnimationManager.d.ts +2 -2
  29. package/BakedVertexAnimation/bakedVertexAnimationManager.js +151 -121
  30. package/BakedVertexAnimation/bakedVertexAnimationManager.js.map +1 -1
  31. package/Behaviors/Cameras/interpolatingBehavior.d.ts +17 -2
  32. package/Behaviors/Cameras/interpolatingBehavior.js +53 -23
  33. package/Behaviors/Cameras/interpolatingBehavior.js.map +1 -1
  34. package/Bones/bone.pure.js +3 -3
  35. package/Buffers/buffer.pure.js +0 -12
  36. package/Buffers/buffer.pure.js.map +1 -1
  37. package/Cameras/Inputs/BaseCameraMouseWheelInput.js +141 -126
  38. package/Cameras/Inputs/BaseCameraMouseWheelInput.js.map +1 -1
  39. package/Cameras/Inputs/BaseCameraPointersInput.d.ts +2 -1
  40. package/Cameras/Inputs/BaseCameraPointersInput.js +290 -277
  41. package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
  42. package/Cameras/Inputs/arcRotateCameraGamepadInput.js +115 -102
  43. package/Cameras/Inputs/arcRotateCameraGamepadInput.js.map +1 -1
  44. package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.d.ts +3 -0
  45. package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js +334 -273
  46. package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js.map +1 -1
  47. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +273 -258
  48. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
  49. package/Cameras/Inputs/arcRotateCameraPointersInput.js +237 -213
  50. package/Cameras/Inputs/arcRotateCameraPointersInput.js.map +1 -1
  51. package/Cameras/Inputs/flyCameraKeyboardInput.js +199 -168
  52. package/Cameras/Inputs/flyCameraKeyboardInput.js.map +1 -1
  53. package/Cameras/Inputs/flyCameraMouseInput.js +243 -229
  54. package/Cameras/Inputs/flyCameraMouseInput.js.map +1 -1
  55. package/Cameras/Inputs/followCameraKeyboardMoveInput.js +311 -266
  56. package/Cameras/Inputs/followCameraKeyboardMoveInput.js.map +1 -1
  57. package/Cameras/Inputs/followCameraMouseWheelInput.js +139 -119
  58. package/Cameras/Inputs/followCameraMouseWheelInput.js.map +1 -1
  59. package/Cameras/Inputs/followCameraPointersInput.js +239 -203
  60. package/Cameras/Inputs/followCameraPointersInput.js.map +1 -1
  61. package/Cameras/Inputs/freeCameraGamepadInput.js +127 -114
  62. package/Cameras/Inputs/freeCameraGamepadInput.js.map +1 -1
  63. package/Cameras/Inputs/freeCameraKeyboardMoveInput.js +278 -244
  64. package/Cameras/Inputs/freeCameraKeyboardMoveInput.js.map +1 -1
  65. package/Cameras/Inputs/freeCameraMouseInput.js +216 -202
  66. package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
  67. package/Cameras/Inputs/freeCameraMouseWheelInput.js +368 -353
  68. package/Cameras/Inputs/freeCameraMouseWheelInput.js.map +1 -1
  69. package/Cameras/Inputs/freeCameraTouchInput.js +185 -172
  70. package/Cameras/Inputs/freeCameraTouchInput.js.map +1 -1
  71. package/Cameras/Inputs/geospatialCameraKeyboardInput.d.ts +2 -0
  72. package/Cameras/Inputs/geospatialCameraKeyboardInput.js +291 -246
  73. package/Cameras/Inputs/geospatialCameraKeyboardInput.js.map +1 -1
  74. package/Cameras/Inputs/geospatialCameraPointersInput.d.ts +11 -1
  75. package/Cameras/Inputs/geospatialCameraPointersInput.js +18 -2
  76. package/Cameras/Inputs/geospatialCameraPointersInput.js.map +1 -1
  77. package/Cameras/Inputs/orbitCameraPointersInput.js +112 -96
  78. package/Cameras/Inputs/orbitCameraPointersInput.js.map +1 -1
  79. package/Cameras/VR/vrExperienceHelper.d.ts +0 -2
  80. package/Cameras/VR/vrExperienceHelper.js +0 -2
  81. package/Cameras/VR/vrExperienceHelper.js.map +1 -1
  82. package/Cameras/VR/vrExperienceHelper.pure.js +5 -0
  83. package/Cameras/VR/vrExperienceHelper.pure.js.map +1 -1
  84. package/Cameras/arcRotateCamera.pure.js +1559 -1479
  85. package/Cameras/arcRotateCamera.pure.js.map +1 -1
  86. package/Cameras/camera.pure.js +1225 -1178
  87. package/Cameras/camera.pure.js.map +1 -1
  88. package/Cameras/flyCamera.pure.js +369 -351
  89. package/Cameras/flyCamera.pure.js.map +1 -1
  90. package/Cameras/followCamera.pure.js +229 -192
  91. package/Cameras/followCamera.pure.js.map +1 -1
  92. package/Cameras/freeCamera.pure.js +373 -351
  93. package/Cameras/freeCamera.pure.js.map +1 -1
  94. package/Cameras/geospatialCamera.pure.d.ts +30 -7
  95. package/Cameras/geospatialCamera.pure.js +502 -457
  96. package/Cameras/geospatialCamera.pure.js.map +1 -1
  97. package/Cameras/geospatialCameraMovement.js +2 -2
  98. package/Cameras/geospatialCameraMovement.js.map +1 -1
  99. package/Cameras/targetCamera.pure.d.ts +7 -0
  100. package/Cameras/targetCamera.pure.js +550 -509
  101. package/Cameras/targetCamera.pure.js.map +1 -1
  102. package/Cameras/universalCamera.pure.js +98 -85
  103. package/Cameras/universalCamera.pure.js.map +1 -1
  104. package/Collisions/gpuPicker.d.ts +111 -4
  105. package/Collisions/gpuPicker.js +696 -119
  106. package/Collisions/gpuPicker.js.map +1 -1
  107. package/Compute/computeShader.pure.js +372 -355
  108. package/Compute/computeShader.pure.js.map +1 -1
  109. package/Culling/Helper/transformFeedbackBoundingHelper.pure.js +2 -2
  110. package/Decorators/nodeDecorator.d.ts +11 -1
  111. package/Decorators/nodeDecorator.js +43 -6
  112. package/Decorators/nodeDecorator.js.map +1 -1
  113. package/Engines/AbstractEngine/abstractEngine.loadFile.pure.js +8 -0
  114. package/Engines/AbstractEngine/abstractEngine.loadFile.pure.js.map +1 -1
  115. package/Engines/Native/nativeHelpers.js +15 -0
  116. package/Engines/Native/nativeHelpers.js.map +1 -1
  117. package/Engines/Native/nativeInterfaces.d.ts +7 -2
  118. package/Engines/Native/nativeInterfaces.js.map +1 -1
  119. package/Engines/Native/nativeRenderTargetWrapper.d.ts +5 -0
  120. package/Engines/Native/nativeRenderTargetWrapper.js +35 -1
  121. package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
  122. package/Engines/Processors/shaderProcessor.js +5 -3
  123. package/Engines/Processors/shaderProcessor.js.map +1 -1
  124. package/Engines/WebGPU/Extensions/engine.videoTexture.pure.js +16 -3
  125. package/Engines/WebGPU/Extensions/engine.videoTexture.pure.js.map +1 -1
  126. package/Engines/WebGPU/webgpuClearQuad.pure.js +7 -1
  127. package/Engines/WebGPU/webgpuClearQuad.pure.js.map +1 -1
  128. package/Engines/abstractEngine.functions.d.ts +8 -2
  129. package/Engines/abstractEngine.functions.js +12 -4
  130. package/Engines/abstractEngine.functions.js.map +1 -1
  131. package/Engines/abstractEngine.pure.d.ts +20 -1
  132. package/Engines/abstractEngine.pure.js +21 -134
  133. package/Engines/abstractEngine.pure.js.map +1 -1
  134. package/Engines/engine.d.ts +208 -0
  135. package/Engines/engine.pure.js +0 -15
  136. package/Engines/engine.pure.js.map +1 -1
  137. package/Engines/nullEngine.pure.d.ts +66 -0
  138. package/Engines/nullEngine.pure.js +97 -0
  139. package/Engines/nullEngine.pure.js.map +1 -1
  140. package/Engines/thinEngine.pure.d.ts +0 -13
  141. package/Engines/thinEngine.pure.js +4 -23
  142. package/Engines/thinEngine.pure.js.map +1 -1
  143. package/Engines/thinNativeEngine.d.ts +0 -1
  144. package/Engines/thinNativeEngine.js +0 -1
  145. package/Engines/thinNativeEngine.js.map +1 -1
  146. package/Engines/thinNativeEngine.pure.d.ts +27 -0
  147. package/Engines/thinNativeEngine.pure.js +383 -17
  148. package/Engines/thinNativeEngine.pure.js.map +1 -1
  149. package/Engines/webgpuEngine.d.ts +1 -0
  150. package/Engines/webgpuEngine.js +1 -0
  151. package/Engines/webgpuEngine.js.map +1 -1
  152. package/Engines/webgpuEngine.pure.d.ts +9 -0
  153. package/Engines/webgpuEngine.pure.js +7 -0
  154. package/Engines/webgpuEngine.pure.js.map +1 -1
  155. package/FlowGraph/flowGraph.js +9 -0
  156. package/FlowGraph/flowGraph.js.map +1 -1
  157. package/FlowGraph/flowGraphContext.js +597 -584
  158. package/FlowGraph/flowGraphContext.js.map +1 -1
  159. package/FlowGraph/flowGraphDataConnection.pure.d.ts +14 -0
  160. package/FlowGraph/flowGraphDataConnection.pure.js +38 -1
  161. package/FlowGraph/flowGraphDataConnection.pure.js.map +1 -1
  162. package/FlowGraph/serialization.d.ts +11 -0
  163. package/FlowGraph/serialization.js +11 -1
  164. package/FlowGraph/serialization.js.map +1 -1
  165. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.pure.js +182 -170
  166. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.pure.js.map +1 -1
  167. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.pure.js +196 -184
  168. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.pure.js.map +1 -1
  169. package/FrameGraph/Node/Blocks/Layers/selectionOutlineLayerBlock.pure.js +222 -210
  170. package/FrameGraph/Node/Blocks/Layers/selectionOutlineLayerBlock.pure.js.map +1 -1
  171. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js +123 -111
  172. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js.map +1 -1
  173. package/FrameGraph/Node/Blocks/PostProcesses/baseWithPropertiesPostProcessBlock.js +158 -146
  174. package/FrameGraph/Node/Blocks/PostProcesses/baseWithPropertiesPostProcessBlock.js.map +1 -1
  175. package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.pure.js +63 -51
  176. package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.pure.js.map +1 -1
  177. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.pure.js +122 -110
  178. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.pure.js.map +1 -1
  179. package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.pure.js +76 -64
  180. package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.pure.js.map +1 -1
  181. package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.pure.js +89 -77
  182. package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.pure.js.map +1 -1
  183. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.pure.js +134 -122
  184. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.pure.js.map +1 -1
  185. package/FrameGraph/Node/Blocks/PostProcesses/colorCorrectionPostProcessBlock.pure.js +58 -46
  186. package/FrameGraph/Node/Blocks/PostProcesses/colorCorrectionPostProcessBlock.pure.js.map +1 -1
  187. package/FrameGraph/Node/Blocks/PostProcesses/convolutionPostProcessBlock.pure.js +107 -95
  188. package/FrameGraph/Node/Blocks/PostProcesses/convolutionPostProcessBlock.pure.js.map +1 -1
  189. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.pure.js +181 -169
  190. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.pure.js.map +1 -1
  191. package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.pure.js +63 -51
  192. package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.pure.js.map +1 -1
  193. package/FrameGraph/Node/Blocks/PostProcesses/filterPostProcessBlock.pure.js +63 -51
  194. package/FrameGraph/Node/Blocks/PostProcesses/filterPostProcessBlock.pure.js.map +1 -1
  195. package/FrameGraph/Node/Blocks/PostProcesses/grainPostProcessBlock.pure.js +76 -64
  196. package/FrameGraph/Node/Blocks/PostProcesses/grainPostProcessBlock.pure.js.map +1 -1
  197. package/FrameGraph/Node/Blocks/PostProcesses/imageProcessingPostProcessBlock.pure.js +246 -234
  198. package/FrameGraph/Node/Blocks/PostProcesses/imageProcessingPostProcessBlock.pure.js.map +1 -1
  199. package/FrameGraph/Node/Blocks/PostProcesses/motionBlurPostProcessBlock.pure.js +108 -96
  200. package/FrameGraph/Node/Blocks/PostProcesses/motionBlurPostProcessBlock.pure.js.map +1 -1
  201. package/FrameGraph/Node/Blocks/PostProcesses/screenSpaceCurvaturePostProcessBlock.pure.js +87 -75
  202. package/FrameGraph/Node/Blocks/PostProcesses/screenSpaceCurvaturePostProcessBlock.pure.js.map +1 -1
  203. package/FrameGraph/Node/Blocks/PostProcesses/sharpenPostProcessBlock.pure.js +76 -64
  204. package/FrameGraph/Node/Blocks/PostProcesses/sharpenPostProcessBlock.pure.js.map +1 -1
  205. package/FrameGraph/Node/Blocks/PostProcesses/ssao2PostProcessBlock.pure.js +313 -301
  206. package/FrameGraph/Node/Blocks/PostProcesses/ssao2PostProcessBlock.pure.js.map +1 -1
  207. package/FrameGraph/Node/Blocks/PostProcesses/ssrPostProcessBlock.pure.js +502 -490
  208. package/FrameGraph/Node/Blocks/PostProcesses/ssrPostProcessBlock.pure.js.map +1 -1
  209. package/FrameGraph/Node/Blocks/PostProcesses/taaPostProcessBlock.pure.js +147 -135
  210. package/FrameGraph/Node/Blocks/PostProcesses/taaPostProcessBlock.pure.js.map +1 -1
  211. package/FrameGraph/Node/Blocks/PostProcesses/tonemapPostProcessBlock.pure.js +90 -78
  212. package/FrameGraph/Node/Blocks/PostProcesses/tonemapPostProcessBlock.pure.js.map +1 -1
  213. package/FrameGraph/Node/Blocks/PostProcesses/volumetricLightingBlock.pure.js +179 -167
  214. package/FrameGraph/Node/Blocks/PostProcesses/volumetricLightingBlock.pure.js.map +1 -1
  215. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +462 -451
  216. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
  217. package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js +265 -253
  218. package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js.map +1 -1
  219. package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.pure.js +204 -192
  220. package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.pure.js.map +1 -1
  221. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js +611 -550
  222. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js.map +1 -1
  223. package/FrameGraph/Node/Blocks/Rendering/iblShadowsRendererBlock.pure.js +320 -308
  224. package/FrameGraph/Node/Blocks/Rendering/iblShadowsRendererBlock.pure.js.map +1 -1
  225. package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.pure.js +87 -75
  226. package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.pure.js.map +1 -1
  227. package/FrameGraph/Node/Blocks/Textures/clearBlock.pure.js +154 -142
  228. package/FrameGraph/Node/Blocks/Textures/clearBlock.pure.js.map +1 -1
  229. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.pure.js +150 -138
  230. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.pure.js.map +1 -1
  231. package/FrameGraph/Node/Blocks/inputBlock.pure.js +270 -256
  232. package/FrameGraph/Node/Blocks/inputBlock.pure.js.map +1 -1
  233. package/FrameGraph/Node/Blocks/lightingVolumeBlock.pure.js +95 -83
  234. package/FrameGraph/Node/Blocks/lightingVolumeBlock.pure.js.map +1 -1
  235. package/FrameGraph/Node/nodeRenderGraph.js +715 -693
  236. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  237. package/FrameGraph/Node/nodeRenderGraphBlock.js +548 -533
  238. package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -1
  239. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsAccumulationTask.d.ts +2 -2
  240. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsAccumulationTask.js +43 -51
  241. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsAccumulationTask.js.map +1 -1
  242. package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.d.ts +0 -1
  243. package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.js +0 -1
  244. package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.js.map +1 -1
  245. package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.pure.d.ts +0 -1
  246. package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.pure.js +66 -35
  247. package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.pure.js.map +1 -1
  248. package/Helpers/environmentHelper.js +2 -2
  249. package/Helpers/environmentHelper.js.map +1 -1
  250. package/Layers/effectLayer.js +529 -519
  251. package/Layers/effectLayer.js.map +1 -1
  252. package/Layers/glowLayer.pure.js +428 -413
  253. package/Layers/glowLayer.pure.js.map +1 -1
  254. package/Layers/highlightLayer.pure.js +473 -458
  255. package/Layers/highlightLayer.pure.js.map +1 -1
  256. package/Layers/selectionOutlineLayer.pure.js +360 -345
  257. package/Layers/selectionOutlineLayer.pure.js.map +1 -1
  258. package/Lights/Clustered/clusteredLightContainer.pure.d.ts +1 -1
  259. package/Lights/Clustered/clusteredLightContainer.pure.js +583 -558
  260. package/Lights/Clustered/clusteredLightContainer.pure.js.map +1 -1
  261. package/Lights/Shadows/shadowGenerator.js +6 -1
  262. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  263. package/Lights/areaLight.pure.js +61 -39
  264. package/Lights/areaLight.pure.js.map +1 -1
  265. package/Lights/directionalLight.pure.js +308 -284
  266. package/Lights/directionalLight.pure.js.map +1 -1
  267. package/Lights/hemisphericLight.pure.js +123 -104
  268. package/Lights/hemisphericLight.pure.js.map +1 -1
  269. package/Lights/light.d.ts +5 -3
  270. package/Lights/light.js +869 -827
  271. package/Lights/light.js.map +1 -1
  272. package/Lights/pointLight.pure.js +185 -174
  273. package/Lights/pointLight.pure.js.map +1 -1
  274. package/Lights/rectAreaLight.pure.d.ts +17 -0
  275. package/Lights/rectAreaLight.pure.js +238 -159
  276. package/Lights/rectAreaLight.pure.js.map +1 -1
  277. package/Lights/shadowLight.js +280 -268
  278. package/Lights/shadowLight.js.map +1 -1
  279. package/Lights/spotLight.pure.js +460 -427
  280. package/Lights/spotLight.pure.js.map +1 -1
  281. package/Loading/Plugins/babylonFileLoader.pure.js +17 -5
  282. package/Loading/Plugins/babylonFileLoader.pure.js.map +1 -1
  283. package/Loading/sceneLoader.d.ts +5 -1
  284. package/Loading/sceneLoader.js +299 -402
  285. package/Loading/sceneLoader.js.map +1 -1
  286. package/Materials/Background/backgroundMaterial.pure.d.ts +18 -18
  287. package/Materials/Background/backgroundMaterial.pure.js +949 -794
  288. package/Materials/Background/backgroundMaterial.pure.js.map +1 -1
  289. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.d.ts +15 -0
  290. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js +34 -1
  291. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js.map +1 -1
  292. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.d.ts +9 -0
  293. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +26 -2
  294. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
  295. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.d.ts +2 -1
  296. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js +169 -149
  297. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js.map +1 -1
  298. package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.js +1 -1
  299. package/Materials/Node/Blocks/Dual/lightBlock.pure.js +442 -429
  300. package/Materials/Node/Blocks/Dual/lightBlock.pure.js.map +1 -1
  301. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.pure.js +396 -383
  302. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.pure.js.map +1 -1
  303. package/Materials/Node/Blocks/Dual/sceneDepthBlock.pure.js +237 -220
  304. package/Materials/Node/Blocks/Dual/sceneDepthBlock.pure.js.map +1 -1
  305. package/Materials/Node/Blocks/Dual/textureBlock.pure.js +1 -1
  306. package/Materials/Node/Blocks/Fragment/ambientOcclusionBlock.pure.js +150 -133
  307. package/Materials/Node/Blocks/Fragment/ambientOcclusionBlock.pure.js.map +1 -1
  308. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js +265 -250
  309. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js.map +1 -1
  310. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.pure.js +159 -142
  311. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.pure.js.map +1 -1
  312. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.pure.js +214 -201
  313. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.pure.js.map +1 -1
  314. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.pure.js +419 -400
  315. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.pure.js.map +1 -1
  316. package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js +3 -1
  317. package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js.map +1 -1
  318. package/Materials/Node/Blocks/PBR/clearCoatBlock.pure.js +302 -289
  319. package/Materials/Node/Blocks/PBR/clearCoatBlock.pure.js.map +1 -1
  320. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.js +1327 -1272
  321. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.js.map +1 -1
  322. package/Materials/Node/Blocks/PBR/reflectionBlock.pure.js +352 -337
  323. package/Materials/Node/Blocks/PBR/reflectionBlock.pure.js.map +1 -1
  324. package/Materials/Node/Blocks/PBR/refractionBlock.pure.js +297 -277
  325. package/Materials/Node/Blocks/PBR/refractionBlock.pure.js.map +1 -1
  326. package/Materials/Node/Blocks/PBR/sheenBlock.pure.js +146 -131
  327. package/Materials/Node/Blocks/PBR/sheenBlock.pure.js.map +1 -1
  328. package/Materials/Node/Blocks/PBR/subSurfaceBlock.pure.js +158 -145
  329. package/Materials/Node/Blocks/PBR/subSurfaceBlock.pure.js.map +1 -1
  330. package/Materials/Node/Blocks/clampBlock.pure.js +92 -77
  331. package/Materials/Node/Blocks/clampBlock.pure.js.map +1 -1
  332. package/Materials/Node/Blocks/cloudBlock.pure.js +145 -132
  333. package/Materials/Node/Blocks/cloudBlock.pure.js.map +1 -1
  334. package/Materials/Node/Blocks/conditionalBlock.pure.js +182 -169
  335. package/Materials/Node/Blocks/conditionalBlock.pure.js.map +1 -1
  336. package/Materials/Node/Blocks/curveBlock.pure.js +259 -246
  337. package/Materials/Node/Blocks/curveBlock.pure.js.map +1 -1
  338. package/Materials/Node/Blocks/debugBlock.pure.js +119 -106
  339. package/Materials/Node/Blocks/debugBlock.pure.js.map +1 -1
  340. package/Materials/Node/Blocks/loopBlock.pure.js +123 -110
  341. package/Materials/Node/Blocks/loopBlock.pure.js.map +1 -1
  342. package/Materials/Node/Blocks/meshAttributeExistsBlock.pure.js +185 -172
  343. package/Materials/Node/Blocks/meshAttributeExistsBlock.pure.js.map +1 -1
  344. package/Materials/Node/Blocks/remapBlock.pure.js +127 -112
  345. package/Materials/Node/Blocks/remapBlock.pure.js.map +1 -1
  346. package/Materials/Node/Blocks/transformBlock.pure.js +196 -185
  347. package/Materials/Node/Blocks/transformBlock.pure.js.map +1 -1
  348. package/Materials/Node/Blocks/triPlanarBlock.pure.js +451 -438
  349. package/Materials/Node/Blocks/triPlanarBlock.pure.js.map +1 -1
  350. package/Materials/Node/Blocks/trigonometryBlock.pure.js +184 -171
  351. package/Materials/Node/Blocks/trigonometryBlock.pure.js.map +1 -1
  352. package/Materials/Node/Blocks/waveBlock.pure.js +97 -84
  353. package/Materials/Node/Blocks/waveBlock.pure.js.map +1 -1
  354. package/Materials/Node/Blocks/worleyNoise3DBlock.pure.js +276 -263
  355. package/Materials/Node/Blocks/worleyNoise3DBlock.pure.js.map +1 -1
  356. package/Materials/Node/nodeMaterial.pure.js +1765 -1737
  357. package/Materials/Node/nodeMaterial.pure.js.map +1 -1
  358. package/Materials/Node/nodeMaterialBuildState.d.ts +3 -3
  359. package/Materials/PBR/openpbrMaterial.pure.d.ts +102 -102
  360. package/Materials/PBR/openpbrMaterial.pure.js +3115 -2243
  361. package/Materials/PBR/openpbrMaterial.pure.js.map +1 -1
  362. package/Materials/PBR/pbrAnisotropicConfiguration.d.ts +3 -3
  363. package/Materials/PBR/pbrAnisotropicConfiguration.js +255 -227
  364. package/Materials/PBR/pbrAnisotropicConfiguration.js.map +1 -1
  365. package/Materials/PBR/pbrBRDFConfiguration.d.ts +9 -9
  366. package/Materials/PBR/pbrBRDFConfiguration.js +203 -155
  367. package/Materials/PBR/pbrBRDFConfiguration.js.map +1 -1
  368. package/Materials/PBR/pbrBaseMaterial.pure.d.ts +1 -1
  369. package/Materials/PBR/pbrBaseMaterial.pure.js +1751 -1736
  370. package/Materials/PBR/pbrBaseMaterial.pure.js.map +1 -1
  371. package/Materials/PBR/pbrBaseSimpleMaterial.d.ts +13 -13
  372. package/Materials/PBR/pbrBaseSimpleMaterial.js +205 -117
  373. package/Materials/PBR/pbrBaseSimpleMaterial.js.map +1 -1
  374. package/Materials/PBR/pbrClearCoatConfiguration.d.ts +9 -9
  375. package/Materials/PBR/pbrClearCoatConfiguration.js +464 -406
  376. package/Materials/PBR/pbrClearCoatConfiguration.js.map +1 -1
  377. package/Materials/PBR/pbrIridescenceConfiguration.d.ts +3 -3
  378. package/Materials/PBR/pbrIridescenceConfiguration.js +271 -239
  379. package/Materials/PBR/pbrIridescenceConfiguration.js.map +1 -1
  380. package/Materials/PBR/pbrMaterial.pure.d.ts +66 -66
  381. package/Materials/PBR/pbrMaterial.pure.js +1041 -685
  382. package/Materials/PBR/pbrMaterial.pure.js.map +1 -1
  383. package/Materials/PBR/pbrMetallicRoughnessMaterial.pure.d.ts +5 -5
  384. package/Materials/PBR/pbrMetallicRoughnessMaterial.pure.js +176 -115
  385. package/Materials/PBR/pbrMetallicRoughnessMaterial.pure.js.map +1 -1
  386. package/Materials/PBR/pbrSheenConfiguration.d.ts +7 -7
  387. package/Materials/PBR/pbrSheenConfiguration.js +314 -270
  388. package/Materials/PBR/pbrSheenConfiguration.js.map +1 -1
  389. package/Materials/PBR/pbrSpecularGlossinessMaterial.pure.d.ts +5 -5
  390. package/Materials/PBR/pbrSpecularGlossinessMaterial.pure.js +172 -117
  391. package/Materials/PBR/pbrSpecularGlossinessMaterial.pure.js.map +1 -1
  392. package/Materials/PBR/pbrSubSurfaceConfiguration.d.ts +16 -16
  393. package/Materials/PBR/pbrSubSurfaceConfiguration.js +864 -764
  394. package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
  395. package/Materials/Textures/HTML/htmlInCanvasPolyfill.d.ts +43 -0
  396. package/Materials/Textures/HTML/htmlInCanvasPolyfill.js +64 -0
  397. package/Materials/Textures/HTML/htmlInCanvasPolyfill.js.map +1 -0
  398. package/Materials/Textures/HTML/htmlInteractionManager.d.ts +69 -0
  399. package/Materials/Textures/HTML/htmlInteractionManager.js +130 -0
  400. package/Materials/Textures/HTML/htmlInteractionManager.js.map +1 -0
  401. package/Materials/Textures/HTML/htmlRaycastInteractionManager.d.ts +84 -0
  402. package/Materials/Textures/HTML/htmlRaycastInteractionManager.js +246 -0
  403. package/Materials/Textures/HTML/htmlRaycastInteractionManager.js.map +1 -0
  404. package/Materials/Textures/HTML/htmlTexture.d.ts +148 -0
  405. package/Materials/Textures/HTML/htmlTexture.js +455 -0
  406. package/Materials/Textures/HTML/htmlTexture.js.map +1 -0
  407. package/Materials/Textures/HTML/index.d.ts +4 -0
  408. package/Materials/Textures/HTML/index.js +5 -0
  409. package/Materials/Textures/HTML/index.js.map +1 -0
  410. package/Materials/Textures/HTML/pure.d.ts +5 -0
  411. package/Materials/Textures/HTML/pure.js +6 -0
  412. package/Materials/Textures/HTML/pure.js.map +1 -0
  413. package/Materials/Textures/Procedurals/proceduralTexture.pure.js +671 -643
  414. package/Materials/Textures/Procedurals/proceduralTexture.pure.js.map +1 -1
  415. package/Materials/Textures/baseTexture.pure.js +880 -825
  416. package/Materials/Textures/baseTexture.pure.js.map +1 -1
  417. package/Materials/Textures/cubeTexture.d.ts +0 -1
  418. package/Materials/Textures/cubeTexture.js +0 -1
  419. package/Materials/Textures/cubeTexture.js.map +1 -1
  420. package/Materials/Textures/cubeTexture.pure.js +368 -333
  421. package/Materials/Textures/cubeTexture.pure.js.map +1 -1
  422. package/Materials/Textures/dynamicTexture.d.ts +0 -1
  423. package/Materials/Textures/dynamicTexture.js +0 -1
  424. package/Materials/Textures/dynamicTexture.js.map +1 -1
  425. package/Materials/Textures/dynamicTexture.pure.js +2 -0
  426. package/Materials/Textures/dynamicTexture.pure.js.map +1 -1
  427. package/Materials/Textures/htmlElementTexture.d.ts +0 -2
  428. package/Materials/Textures/htmlElementTexture.js +0 -2
  429. package/Materials/Textures/htmlElementTexture.js.map +1 -1
  430. package/Materials/Textures/htmlElementTexture.pure.js +4 -0
  431. package/Materials/Textures/htmlElementTexture.pure.js.map +1 -1
  432. package/Materials/Textures/index.d.ts +1 -0
  433. package/Materials/Textures/index.js +1 -1
  434. package/Materials/Textures/index.js.map +1 -1
  435. package/Materials/Textures/multiRenderTarget.d.ts +0 -1
  436. package/Materials/Textures/multiRenderTarget.js +0 -1
  437. package/Materials/Textures/multiRenderTarget.js.map +1 -1
  438. package/Materials/Textures/multiRenderTarget.pure.js +2 -0
  439. package/Materials/Textures/multiRenderTarget.pure.js.map +1 -1
  440. package/Materials/Textures/pure.d.ts +1 -0
  441. package/Materials/Textures/pure.js +1 -0
  442. package/Materials/Textures/pure.js.map +1 -1
  443. package/Materials/Textures/texture.pure.js +961 -923
  444. package/Materials/Textures/texture.pure.js.map +1 -1
  445. package/Materials/Textures/videoTexture.pure.d.ts +3 -0
  446. package/Materials/Textures/videoTexture.pure.js +450 -401
  447. package/Materials/Textures/videoTexture.pure.js.map +1 -1
  448. package/Materials/colorCurves.pure.js +510 -477
  449. package/Materials/colorCurves.pure.js.map +1 -1
  450. package/Materials/effect.pure.js +0 -7
  451. package/Materials/effect.pure.js.map +1 -1
  452. package/Materials/imageProcessing.js +12 -4
  453. package/Materials/imageProcessing.js.map +1 -1
  454. package/Materials/imageProcessingConfiguration.pure.js +647 -587
  455. package/Materials/imageProcessingConfiguration.pure.js.map +1 -1
  456. package/Materials/material.decalMapConfiguration.pure.d.ts +2 -2
  457. package/Materials/material.decalMapConfiguration.pure.js +149 -130
  458. package/Materials/material.decalMapConfiguration.pure.js.map +1 -1
  459. package/Materials/material.detailMapConfiguration.d.ts +3 -3
  460. package/Materials/material.detailMapConfiguration.js +213 -175
  461. package/Materials/material.detailMapConfiguration.js.map +1 -1
  462. package/Materials/material.pure.js +1815 -1721
  463. package/Materials/material.pure.js.map +1 -1
  464. package/Materials/materialPluginBase.pure.js +270 -249
  465. package/Materials/materialPluginBase.pure.js.map +1 -1
  466. package/Materials/materialPluginManager.pure.js +18 -8
  467. package/Materials/materialPluginManager.pure.js.map +1 -1
  468. package/Materials/materialStencilState.js +211 -200
  469. package/Materials/materialStencilState.js.map +1 -1
  470. package/Materials/meshDebugPluginMaterial.pure.d.ts +2 -2
  471. package/Materials/meshDebugPluginMaterial.pure.js +397 -275
  472. package/Materials/meshDebugPluginMaterial.pure.js.map +1 -1
  473. package/Materials/standardMaterial.pure.d.ts +32 -32
  474. package/Materials/standardMaterial.pure.js +1804 -1394
  475. package/Materials/standardMaterial.pure.js.map +1 -1
  476. package/Maths/math.color.pure.js +5 -5
  477. package/Maths/math.functions.js +38 -30
  478. package/Maths/math.functions.js.map +1 -1
  479. package/Maths/math.vector.pure.js +25 -25
  480. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +18 -8
  481. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
  482. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +86 -1
  483. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +255 -104
  484. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
  485. package/Meshes/GaussianSplatting/gaussianSplattingSortWorker.d.ts +39 -0
  486. package/Meshes/GaussianSplatting/gaussianSplattingSortWorker.js +322 -0
  487. package/Meshes/GaussianSplatting/gaussianSplattingSortWorker.js.map +1 -0
  488. package/Meshes/GreasedLine/greasedLineMesh.pure.js +4 -4
  489. package/Meshes/GreasedLine/greasedLineRibbonMesh.pure.js +3 -3
  490. package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js +107 -94
  491. package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js.map +1 -1
  492. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.pure.js +276 -263
  493. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.pure.js.map +1 -1
  494. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.pure.js +247 -232
  495. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.pure.js.map +1 -1
  496. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.pure.js +299 -284
  497. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.pure.js.map +1 -1
  498. package/Meshes/Node/Blocks/Set/aggregatorBlock.pure.js +196 -181
  499. package/Meshes/Node/Blocks/Set/aggregatorBlock.pure.js.map +1 -1
  500. package/Meshes/Node/Blocks/Set/latticeBlock.pure.js +198 -179
  501. package/Meshes/Node/Blocks/Set/latticeBlock.pure.js.map +1 -1
  502. package/Meshes/Node/Blocks/Set/setColorsBlock.pure.js +151 -138
  503. package/Meshes/Node/Blocks/Set/setColorsBlock.pure.js.map +1 -1
  504. package/Meshes/Node/Blocks/Set/setMaterialIDBlock.pure.js +107 -94
  505. package/Meshes/Node/Blocks/Set/setMaterialIDBlock.pure.js.map +1 -1
  506. package/Meshes/Node/Blocks/Set/setNormalsBlock.pure.js +138 -125
  507. package/Meshes/Node/Blocks/Set/setNormalsBlock.pure.js.map +1 -1
  508. package/Meshes/Node/Blocks/Set/setPositionsBlock.pure.js +213 -200
  509. package/Meshes/Node/Blocks/Set/setPositionsBlock.pure.js.map +1 -1
  510. package/Meshes/Node/Blocks/Set/setTangentsBlock.pure.js +138 -125
  511. package/Meshes/Node/Blocks/Set/setTangentsBlock.pure.js.map +1 -1
  512. package/Meshes/Node/Blocks/Set/setUVsBlock.pure.js +179 -164
  513. package/Meshes/Node/Blocks/Set/setUVsBlock.pure.js.map +1 -1
  514. package/Meshes/Node/Blocks/Sources/boxBlock.pure.js +183 -170
  515. package/Meshes/Node/Blocks/Sources/boxBlock.pure.js.map +1 -1
  516. package/Meshes/Node/Blocks/Sources/capsuleBlock.pure.js +125 -112
  517. package/Meshes/Node/Blocks/Sources/capsuleBlock.pure.js.map +1 -1
  518. package/Meshes/Node/Blocks/Sources/cylinderBlock.pure.js +153 -140
  519. package/Meshes/Node/Blocks/Sources/cylinderBlock.pure.js.map +1 -1
  520. package/Meshes/Node/Blocks/Sources/discBlock.pure.js +112 -99
  521. package/Meshes/Node/Blocks/Sources/discBlock.pure.js.map +1 -1
  522. package/Meshes/Node/Blocks/Sources/gridBlock.pure.js +133 -120
  523. package/Meshes/Node/Blocks/Sources/gridBlock.pure.js.map +1 -1
  524. package/Meshes/Node/Blocks/Sources/icoSphereBlock.pure.js +128 -115
  525. package/Meshes/Node/Blocks/Sources/icoSphereBlock.pure.js.map +1 -1
  526. package/Meshes/Node/Blocks/Sources/meshBlock.pure.js +116 -103
  527. package/Meshes/Node/Blocks/Sources/meshBlock.pure.js.map +1 -1
  528. package/Meshes/Node/Blocks/Sources/planeBlock.pure.js +160 -147
  529. package/Meshes/Node/Blocks/Sources/planeBlock.pure.js.map +1 -1
  530. package/Meshes/Node/Blocks/Sources/sphereBlock.pure.js +144 -131
  531. package/Meshes/Node/Blocks/Sources/sphereBlock.pure.js.map +1 -1
  532. package/Meshes/Node/Blocks/Sources/torusBlock.pure.js +112 -99
  533. package/Meshes/Node/Blocks/Sources/torusBlock.pure.js.map +1 -1
  534. package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.pure.js +200 -185
  535. package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.pure.js.map +1 -1
  536. package/Meshes/Node/Blocks/bevelBlock.pure.js +111 -98
  537. package/Meshes/Node/Blocks/bevelBlock.pure.js.map +1 -1
  538. package/Meshes/Node/Blocks/booleanGeometryBlock.pure.js +182 -165
  539. package/Meshes/Node/Blocks/booleanGeometryBlock.pure.js.map +1 -1
  540. package/Meshes/Node/Blocks/cleanGeometryBlock.pure.js +89 -76
  541. package/Meshes/Node/Blocks/cleanGeometryBlock.pure.js.map +1 -1
  542. package/Meshes/Node/Blocks/conditionBlock.pure.js +184 -169
  543. package/Meshes/Node/Blocks/conditionBlock.pure.js.map +1 -1
  544. package/Meshes/Node/Blocks/extrudeGeometryBlock.pure.js +270 -255
  545. package/Meshes/Node/Blocks/extrudeGeometryBlock.pure.js.map +1 -1
  546. package/Meshes/Node/Blocks/geometryCollectionBlock.pure.js +172 -159
  547. package/Meshes/Node/Blocks/geometryCollectionBlock.pure.js.map +1 -1
  548. package/Meshes/Node/Blocks/geometryCurveBlock.pure.js +230 -217
  549. package/Meshes/Node/Blocks/geometryCurveBlock.pure.js.map +1 -1
  550. package/Meshes/Node/Blocks/geometryEaseBlock.pure.js +256 -245
  551. package/Meshes/Node/Blocks/geometryEaseBlock.pure.js.map +1 -1
  552. package/Meshes/Node/Blocks/geometryOptimizeBlock.pure.js +206 -189
  553. package/Meshes/Node/Blocks/geometryOptimizeBlock.pure.js.map +1 -1
  554. package/Meshes/Node/Blocks/geometryTransformBlock.pure.js +166 -153
  555. package/Meshes/Node/Blocks/geometryTransformBlock.pure.js.map +1 -1
  556. package/Meshes/Node/Blocks/geometryTrigonometryBlock.pure.js +221 -208
  557. package/Meshes/Node/Blocks/geometryTrigonometryBlock.pure.js.map +1 -1
  558. package/Meshes/Node/Blocks/mappingBlock.pure.js +150 -137
  559. package/Meshes/Node/Blocks/mappingBlock.pure.js.map +1 -1
  560. package/Meshes/Node/Blocks/mathBlock.pure.js +269 -256
  561. package/Meshes/Node/Blocks/mathBlock.pure.js.map +1 -1
  562. package/Meshes/Node/Blocks/mergeGeometryBlock.pure.js +141 -128
  563. package/Meshes/Node/Blocks/mergeGeometryBlock.pure.js.map +1 -1
  564. package/Meshes/Node/Blocks/randomBlock.pure.js +161 -148
  565. package/Meshes/Node/Blocks/randomBlock.pure.js.map +1 -1
  566. package/Meshes/Node/Blocks/subdivideBlock.pure.js +102 -87
  567. package/Meshes/Node/Blocks/subdivideBlock.pure.js.map +1 -1
  568. package/Meshes/Node/nodeGeometry.js +560 -538
  569. package/Meshes/Node/nodeGeometry.js.map +1 -1
  570. package/Meshes/Node/nodeGeometryBlock.js +473 -458
  571. package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
  572. package/Meshes/abstractMesh.pure.js +2218 -2207
  573. package/Meshes/abstractMesh.pure.js.map +1 -1
  574. package/Meshes/geometry.js +30 -15
  575. package/Meshes/geometry.js.map +1 -1
  576. package/Meshes/mesh.pure.js +26 -14
  577. package/Meshes/mesh.pure.js.map +1 -1
  578. package/Meshes/mesh.vertexData.js +1665 -1655
  579. package/Meshes/mesh.vertexData.js.map +1 -1
  580. package/Meshes/transformNode.pure.js +1400 -1372
  581. package/Meshes/transformNode.pure.js.map +1 -1
  582. package/Misc/decorators.d.ts +34 -19
  583. package/Misc/decorators.functions.d.ts +33 -2
  584. package/Misc/decorators.functions.js +114 -35
  585. package/Misc/decorators.functions.js.map +1 -1
  586. package/Misc/decorators.js +96 -68
  587. package/Misc/decorators.js.map +1 -1
  588. package/Misc/decorators.serialization.js +47 -40
  589. package/Misc/decorators.serialization.js.map +1 -1
  590. package/Misc/decorators.serializationUtilities.d.ts +24 -0
  591. package/Misc/decorators.serializationUtilities.js +20 -0
  592. package/Misc/decorators.serializationUtilities.js.map +1 -0
  593. package/Misc/dumpTools.pure.js +43 -33
  594. package/Misc/dumpTools.pure.js.map +1 -1
  595. package/Misc/fileTools.pure.js +8 -0
  596. package/Misc/fileTools.pure.js.map +1 -1
  597. package/Misc/observable.pure.js +0 -7
  598. package/Misc/observable.pure.js.map +1 -1
  599. package/Misc/snapshotRenderingHelper.d.ts +4 -1
  600. package/Misc/snapshotRenderingHelper.js.map +1 -1
  601. package/Misc/symbolMetadataPolyfill.d.ts +11 -0
  602. package/Misc/symbolMetadataPolyfill.js +22 -0
  603. package/Misc/symbolMetadataPolyfill.js.map +1 -0
  604. package/Misc/tools.pure.js +2 -2
  605. package/Misc/tools.pure.js.map +1 -1
  606. package/Morph/morphTarget.js +382 -365
  607. package/Morph/morphTarget.js.map +1 -1
  608. package/Particles/Node/Blocks/Conditions/particleConditionBlock.pure.js +160 -145
  609. package/Particles/Node/Blocks/Conditions/particleConditionBlock.pure.js.map +1 -1
  610. package/Particles/Node/Blocks/Emitters/coneShapeBlock.pure.js +187 -174
  611. package/Particles/Node/Blocks/Emitters/coneShapeBlock.pure.js.map +1 -1
  612. package/Particles/Node/Blocks/Emitters/meshShapeBlock.pure.js +238 -219
  613. package/Particles/Node/Blocks/Emitters/meshShapeBlock.pure.js.map +1 -1
  614. package/Particles/Node/Blocks/Emitters/setupSpriteSheetBlock.pure.js +140 -115
  615. package/Particles/Node/Blocks/Emitters/setupSpriteSheetBlock.pure.js.map +1 -1
  616. package/Particles/Node/Blocks/Emitters/sphereShapeBlock.pure.js +157 -144
  617. package/Particles/Node/Blocks/Emitters/sphereShapeBlock.pure.js.map +1 -1
  618. package/Particles/Node/Blocks/Triggers/particleTriggerBlock.pure.js +133 -119
  619. package/Particles/Node/Blocks/Triggers/particleTriggerBlock.pure.js.map +1 -1
  620. package/Particles/Node/Blocks/Update/alignAngleBlock.pure.js +93 -80
  621. package/Particles/Node/Blocks/Update/alignAngleBlock.pure.js.map +1 -1
  622. package/Particles/Node/Blocks/particleDebugBlock.pure.js +117 -105
  623. package/Particles/Node/Blocks/particleDebugBlock.pure.js.map +1 -1
  624. package/Particles/Node/Blocks/particleFloatToIntBlock.pure.js +105 -92
  625. package/Particles/Node/Blocks/particleFloatToIntBlock.pure.js.map +1 -1
  626. package/Particles/Node/Blocks/particleGradientValueBlock.pure.js +82 -69
  627. package/Particles/Node/Blocks/particleGradientValueBlock.pure.js.map +1 -1
  628. package/Particles/Node/Blocks/particleLocalVariableBlock.pure.js +113 -101
  629. package/Particles/Node/Blocks/particleLocalVariableBlock.pure.js.map +1 -1
  630. package/Particles/Node/Blocks/particleMathBlock.pure.js +278 -265
  631. package/Particles/Node/Blocks/particleMathBlock.pure.js.map +1 -1
  632. package/Particles/Node/Blocks/particleNumberMathBlock.pure.js +155 -142
  633. package/Particles/Node/Blocks/particleNumberMathBlock.pure.js.map +1 -1
  634. package/Particles/Node/Blocks/particleRandomBlock.pure.js +156 -143
  635. package/Particles/Node/Blocks/particleRandomBlock.pure.js.map +1 -1
  636. package/Particles/Node/Blocks/particleTrigonometryBlock.pure.js +217 -204
  637. package/Particles/Node/Blocks/particleTrigonometryBlock.pure.js.map +1 -1
  638. package/Particles/Node/Blocks/particleVectorMathBlock.pure.js +106 -93
  639. package/Particles/Node/Blocks/particleVectorMathBlock.pure.js.map +1 -1
  640. package/Particles/Node/Blocks/systemBlock.pure.js +366 -330
  641. package/Particles/Node/Blocks/systemBlock.pure.js.map +1 -1
  642. package/Particles/Node/nodeParticleBlock.js +339 -324
  643. package/Particles/Node/nodeParticleBlock.js.map +1 -1
  644. package/Particles/Node/nodeParticleSystemSet.js +494 -473
  645. package/Particles/Node/nodeParticleSystemSet.js.map +1 -1
  646. package/Particles/gpuParticleSystem.d.ts +0 -1
  647. package/Particles/gpuParticleSystem.js +0 -1
  648. package/Particles/gpuParticleSystem.js.map +1 -1
  649. package/Particles/gpuParticleSystem.pure.d.ts +4 -3
  650. package/Particles/gpuParticleSystem.pure.js +27 -16
  651. package/Particles/gpuParticleSystem.pure.js.map +1 -1
  652. package/Particles/particleSystem.pure.js +57 -2
  653. package/Particles/particleSystem.pure.js.map +1 -1
  654. package/Particles/thinParticleSystem.d.ts +0 -1
  655. package/Particles/thinParticleSystem.js +0 -1
  656. package/Particles/thinParticleSystem.js.map +1 -1
  657. package/Particles/thinParticleSystem.pure.js +2 -0
  658. package/Particles/thinParticleSystem.pure.js.map +1 -1
  659. package/Particles/webgl2ParticleSystem.pure.js +2 -0
  660. package/Particles/webgl2ParticleSystem.pure.js.map +1 -1
  661. package/Physics/v1/physicsImpostor.pure.js +4 -4
  662. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.pure.js +675 -656
  663. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.pure.js.map +1 -1
  664. package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.d.ts +0 -1
  665. package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.js +0 -1
  666. package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.js.map +1 -1
  667. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.pure.js +521 -486
  668. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.pure.js.map +1 -1
  669. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.d.ts +0 -1
  670. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js +0 -1
  671. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js.map +1 -1
  672. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.pure.js +241 -220
  673. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.pure.js.map +1 -1
  674. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.pure.js +852 -835
  675. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.pure.js.map +1 -1
  676. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.pure.js +1135 -1073
  677. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.pure.js.map +1 -1
  678. package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.pure.js +319 -303
  679. package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.pure.js.map +1 -1
  680. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js +212 -199
  681. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
  682. package/PostProcesses/blackAndWhitePostProcess.pure.js +67 -55
  683. package/PostProcesses/blackAndWhitePostProcess.pure.js.map +1 -1
  684. package/PostProcesses/bloomMergePostProcess.pure.js +74 -62
  685. package/PostProcesses/bloomMergePostProcess.pure.js.map +1 -1
  686. package/PostProcesses/blurPostProcess.pure.js +127 -115
  687. package/PostProcesses/blurPostProcess.pure.js.map +1 -1
  688. package/PostProcesses/chromaticAberrationPostProcess.pure.js +130 -118
  689. package/PostProcesses/chromaticAberrationPostProcess.pure.js.map +1 -1
  690. package/PostProcesses/circleOfConfusionPostProcess.pure.js +115 -104
  691. package/PostProcesses/circleOfConfusionPostProcess.pure.js.map +1 -1
  692. package/PostProcesses/colorCorrectionPostProcess.pure.js +55 -43
  693. package/PostProcesses/colorCorrectionPostProcess.pure.js.map +1 -1
  694. package/PostProcesses/convolutionPostProcess.pure.js +96 -84
  695. package/PostProcesses/convolutionPostProcess.pure.js.map +1 -1
  696. package/PostProcesses/extractHighlightsPostProcess.pure.js +68 -57
  697. package/PostProcesses/extractHighlightsPostProcess.pure.js.map +1 -1
  698. package/PostProcesses/filterPostProcess.pure.js +66 -54
  699. package/PostProcesses/filterPostProcess.pure.js.map +1 -1
  700. package/PostProcesses/fxaaPostProcess.pure.js.map +1 -1
  701. package/PostProcesses/grainPostProcess.pure.js +82 -70
  702. package/PostProcesses/grainPostProcess.pure.js.map +1 -1
  703. package/PostProcesses/imageProcessingPostProcess.js +334 -322
  704. package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
  705. package/PostProcesses/motionBlurPostProcess.pure.js +246 -235
  706. package/PostProcesses/motionBlurPostProcess.pure.js.map +1 -1
  707. package/PostProcesses/passPostProcess.pure.js +75 -63
  708. package/PostProcesses/passPostProcess.pure.js.map +1 -1
  709. package/PostProcesses/postProcess.pure.js +899 -835
  710. package/PostProcesses/postProcess.pure.js.map +1 -1
  711. package/PostProcesses/refractionPostProcess.pure.js +114 -87
  712. package/PostProcesses/refractionPostProcess.pure.js.map +1 -1
  713. package/PostProcesses/screenSpaceCurvaturePostProcess.pure.js +108 -96
  714. package/PostProcesses/screenSpaceCurvaturePostProcess.pure.js.map +1 -1
  715. package/PostProcesses/screenSpaceReflectionPostProcess.pure.js +241 -220
  716. package/PostProcesses/screenSpaceReflectionPostProcess.pure.js.map +1 -1
  717. package/PostProcesses/sharpenPostProcess.pure.js +86 -74
  718. package/PostProcesses/sharpenPostProcess.pure.js.map +1 -1
  719. package/PostProcesses/tonemapPostProcess.pure.js +82 -70
  720. package/PostProcesses/tonemapPostProcess.pure.js.map +1 -1
  721. package/PostProcesses/volumetricLightScatteringPostProcess.pure.js +500 -465
  722. package/PostProcesses/volumetricLightScatteringPostProcess.pure.js.map +1 -1
  723. package/PostProcesses/vrMultiviewToSingleviewPostProcess.d.ts +0 -1
  724. package/PostProcesses/vrMultiviewToSingleviewPostProcess.js +0 -1
  725. package/PostProcesses/vrMultiviewToSingleviewPostProcess.js.map +1 -1
  726. package/PostProcesses/vrMultiviewToSingleviewPostProcess.pure.js +2 -0
  727. package/PostProcesses/vrMultiviewToSingleviewPostProcess.pure.js.map +1 -1
  728. package/Probes/reflectionProbe.pure.js +238 -224
  729. package/Probes/reflectionProbe.pure.js.map +1 -1
  730. package/Rendering/GlobalIllumination/giRSMManager.pure.d.ts +1 -1
  731. package/Rendering/GlobalIllumination/giRSMManager.pure.js +138 -105
  732. package/Rendering/GlobalIllumination/giRSMManager.pure.js.map +1 -1
  733. package/Rendering/IBLShadows/iblShadowsPluginMaterial.pure.d.ts +1 -1
  734. package/Rendering/IBLShadows/iblShadowsPluginMaterial.pure.js +155 -138
  735. package/Rendering/IBLShadows/iblShadowsPluginMaterial.pure.js.map +1 -1
  736. package/Rendering/IBLShadows/iblShadowsRenderPipeline.d.ts +0 -2
  737. package/Rendering/IBLShadows/iblShadowsRenderPipeline.js +0 -2
  738. package/Rendering/IBLShadows/iblShadowsRenderPipeline.js.map +1 -1
  739. package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js +5 -0
  740. package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js.map +1 -1
  741. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.d.ts +0 -1
  742. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js +0 -1
  743. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js.map +1 -1
  744. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.d.ts +1 -0
  745. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js +34 -0
  746. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js.map +1 -1
  747. package/Rendering/edgesRenderer.pure.js.map +1 -1
  748. package/Rendering/prePassRenderer.d.ts +0 -2
  749. package/Rendering/prePassRenderer.js +0 -2
  750. package/Rendering/prePassRenderer.js.map +1 -1
  751. package/Rendering/prePassRenderer.pure.js +2 -0
  752. package/Rendering/prePassRenderer.pure.js.map +1 -1
  753. package/Rendering/reflectiveShadowMap.pure.d.ts +1 -1
  754. package/Rendering/reflectiveShadowMap.pure.js +151 -130
  755. package/Rendering/reflectiveShadowMap.pure.js.map +1 -1
  756. package/Rendering/thinDepthPeelingRenderer.d.ts +0 -1
  757. package/Rendering/thinDepthPeelingRenderer.js +0 -1
  758. package/Rendering/thinDepthPeelingRenderer.js.map +1 -1
  759. package/Shaders/ShadersInclude/gaussianSplatting.js +1 -0
  760. package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
  761. package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js +35 -5
  762. package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
  763. package/Shaders/gaussianSplatting.fragment.js +17 -1
  764. package/Shaders/gaussianSplatting.fragment.js.map +1 -1
  765. package/Shaders/gaussianSplatting.vertex.js +1 -1
  766. package/Shaders/gaussianSplatting.vertex.js.map +1 -1
  767. package/Shaders/gaussianSplattingDepth.vertex.js +1 -1
  768. package/Shaders/gaussianSplattingDepth.vertex.js.map +1 -1
  769. package/Shaders/picking.fragment.js +39 -3
  770. package/Shaders/picking.fragment.js.map +1 -1
  771. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +3 -1
  772. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
  773. package/ShadersWGSL/ShadersInclude/helperFunctions.js +2 -2
  774. package/ShadersWGSL/ShadersInclude/helperFunctions.js.map +1 -1
  775. package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js +39 -7
  776. package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
  777. package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js +4 -3
  778. package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js.map +1 -1
  779. package/ShadersWGSL/gaussianSplatting.fragment.js +14 -1
  780. package/ShadersWGSL/gaussianSplatting.fragment.js.map +1 -1
  781. package/ShadersWGSL/gaussianSplatting.vertex.js +2 -2
  782. package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
  783. package/ShadersWGSL/gaussianSplattingDepth.vertex.js +2 -2
  784. package/ShadersWGSL/gaussianSplattingDepth.vertex.js.map +1 -1
  785. package/ShadersWGSL/lightingVolume.compute.js +2 -2
  786. package/ShadersWGSL/lightingVolume.compute.js.map +1 -1
  787. package/ShadersWGSL/picking.fragment.js +22 -1
  788. package/ShadersWGSL/picking.fragment.js.map +1 -1
  789. package/XR/features/Layers/WebXRCompositionLayer.d.ts +3 -2
  790. package/XR/features/Layers/WebXRCompositionLayer.js +2 -2
  791. package/XR/features/Layers/WebXRCompositionLayer.js.map +1 -1
  792. package/XR/features/Layers/WebXRWebGPUCompositionLayer.d.ts +59 -0
  793. package/XR/features/Layers/WebXRWebGPUCompositionLayer.js +120 -0
  794. package/XR/features/Layers/WebXRWebGPUCompositionLayer.js.map +1 -0
  795. package/XR/features/Layers/WebXRWebGPUProjectionLayer.d.ts +25 -0
  796. package/XR/features/Layers/WebXRWebGPUProjectionLayer.js +69 -0
  797. package/XR/features/Layers/WebXRWebGPUProjectionLayer.js.map +1 -0
  798. package/XR/features/WebXRLayers.pure.d.ts +8 -0
  799. package/XR/features/WebXRLayers.pure.js +43 -6
  800. package/XR/features/WebXRLayers.pure.js.map +1 -1
  801. package/XR/native/nativeXRRenderTarget.d.ts +2 -2
  802. package/XR/native/nativeXRRenderTarget.js +2 -2
  803. package/XR/native/nativeXRRenderTarget.js.map +1 -1
  804. package/XR/webXRExperienceHelper.js +10 -1
  805. package/XR/webXRExperienceHelper.js.map +1 -1
  806. package/XR/webXRGraphicsBinding.d.ts +90 -0
  807. package/XR/webXRGraphicsBinding.js +85 -0
  808. package/XR/webXRGraphicsBinding.js.map +1 -0
  809. package/XR/webXRLayerRenderTargetTexture.d.ts +24 -0
  810. package/XR/webXRLayerRenderTargetTexture.js +30 -0
  811. package/XR/webXRLayerRenderTargetTexture.js.map +1 -0
  812. package/XR/webXRManagedOutputCanvas.d.ts +14 -0
  813. package/XR/webXRManagedOutputCanvas.js +24 -5
  814. package/XR/webXRManagedOutputCanvas.js.map +1 -1
  815. package/XR/webXRRenderTargetTextureProvider.d.ts +25 -4
  816. package/XR/webXRRenderTargetTextureProvider.js +33 -35
  817. package/XR/webXRRenderTargetTextureProvider.js.map +1 -1
  818. package/XR/webXRSessionManager.d.ts +11 -0
  819. package/XR/webXRSessionManager.js +37 -0
  820. package/XR/webXRSessionManager.js.map +1 -1
  821. package/XR/webXRTypes.d.ts +9 -6
  822. package/XR/webXRTypes.js.map +1 -1
  823. package/XR/webXRWebGLLayer.d.ts +2 -2
  824. package/XR/webXRWebGLLayer.js +2 -2
  825. package/XR/webXRWebGLLayer.js.map +1 -1
  826. package/XR/webXRWebGLRenderTargetTextureProvider.d.ts +12 -0
  827. package/XR/webXRWebGLRenderTargetTextureProvider.js +58 -0
  828. package/XR/webXRWebGLRenderTargetTextureProvider.js.map +1 -0
  829. package/XR/webXRWebGPURenderTargetTextureProvider.d.ts +69 -0
  830. package/XR/webXRWebGPURenderTargetTextureProvider.js +148 -0
  831. package/XR/webXRWebGPURenderTargetTextureProvider.js.map +1 -0
  832. package/index.d.ts +1 -0
  833. package/index.js +1 -0
  834. package/index.js.map +1 -1
  835. package/node.js +878 -845
  836. package/node.js.map +1 -1
  837. package/package.json +8 -14
  838. package/scene.pure.d.ts +12 -0
  839. package/scene.pure.js +36 -0
  840. package/scene.pure.js.map +1 -1
  841. package/tslib.es6.js +304 -150
@@ -1,5 +1,5 @@
1
1
  /** This file must only contain pure code and pure imports */
2
- import { __decorate } from "../../tslib.es6.js";
2
+ import { __classPrivateFieldGet, __classPrivateFieldSet, __esDecorate, __runInitializers } from "../../tslib.es6.js";
3
3
  /* eslint-disable @typescript-eslint/naming-convention */
4
4
  import { serialize, serializeAsColor3, expandToProperty, serializeAsTexture, serializeAsVector3 } from "../../Misc/decorators.js";
5
5
  import { SmartArray } from "../../Misc/smartArray.js";
@@ -9,7 +9,7 @@ import { VertexBuffer } from "../../Buffers/buffer.pure.js";
9
9
  import { MaterialDefines } from "../../Materials/materialDefines.js";
10
10
  import { PushMaterial } from "../../Materials/pushMaterial.js";
11
11
  import { ImageProcessingDefinesMixin } from "../../Materials/imageProcessingConfiguration.defines.js";
12
- import { ImageProcessingConfiguration } from "../../Materials/imageProcessingConfiguration.pure.js";
12
+ import { ImageProcessingConfiguration, RegisterImageProcessingConfiguration } from "../../Materials/imageProcessingConfiguration.pure.js";
13
13
 
14
14
  import { MaterialFlags } from "../materialFlags.js";
15
15
  import { Color3 } from "../../Maths/math.color.pure.js";
@@ -180,837 +180,990 @@ class BackgroundMaterialBase extends ImageProcessingMixin(PushMaterial) {
180
180
  * Background material used to create an efficient environment around your scene.
181
181
  * #157MGZ: simple test
182
182
  */
183
- export class BackgroundMaterial extends BackgroundMaterialBase {
184
- /**
185
- * Experimental Internal Use Only.
186
- *
187
- * Key light Color in "perceptual value" meaning the color you would like to see on screen.
188
- * This acts as a helper to set the primary color to a more "human friendly" value.
189
- * Conversion to linear space as well as exposure and tone mapping correction will be applied to keep the
190
- * output color as close as possible from the chosen value.
191
- * (This does not account for contrast color grading and color curves as they are considered post effect and not directly
192
- * part of lighting setup.)
193
- */
194
- get _perceptualColor() {
195
- return this.__perceptualColor;
196
- }
197
- set _perceptualColor(value) {
198
- this.__perceptualColor = value;
199
- this._computePrimaryColorFromPerceptualColor();
200
- this._markAllSubMeshesAsLightsDirty();
201
- }
202
- /**
203
- * Defines the level of the shadows (dark area of the reflection map) in order to help scaling the colors.
204
- * The color opposite to the primary color is used at the level chosen to define what the black area would look.
205
- */
206
- get primaryColorShadowLevel() {
207
- return this._primaryColorShadowLevel;
208
- }
209
- set primaryColorShadowLevel(value) {
210
- this._primaryColorShadowLevel = value;
211
- this._computePrimaryColors();
212
- this._markAllSubMeshesAsLightsDirty();
213
- }
214
- /**
215
- * Defines the level of the highlights (highlight area of the reflection map) in order to help scaling the colors.
216
- * The primary color is used at the level chosen to define what the white area would look.
217
- */
218
- get primaryColorHighlightLevel() {
219
- return this._primaryColorHighlightLevel;
220
- }
221
- set primaryColorHighlightLevel(value) {
222
- this._primaryColorHighlightLevel = value;
223
- this._computePrimaryColors();
224
- this._markAllSubMeshesAsLightsDirty();
225
- }
226
- /**
227
- * Sets the reflection reflectance fresnel values according to the default standard
228
- * empirically know to work well :-)
229
- */
230
- set reflectionStandardFresnelWeight(value) {
231
- let reflectionWeight = value;
232
- if (reflectionWeight < 0.5) {
233
- reflectionWeight = reflectionWeight * 2.0;
234
- this.reflectionReflectance0 = BackgroundMaterial.StandardReflectance0 * reflectionWeight;
235
- this.reflectionReflectance90 = BackgroundMaterial.StandardReflectance90 * reflectionWeight;
236
- }
237
- else {
238
- reflectionWeight = reflectionWeight * 2.0 - 1.0;
239
- this.reflectionReflectance0 = BackgroundMaterial.StandardReflectance0 + (1.0 - BackgroundMaterial.StandardReflectance0) * reflectionWeight;
240
- this.reflectionReflectance90 = BackgroundMaterial.StandardReflectance90 + (1.0 - BackgroundMaterial.StandardReflectance90) * reflectionWeight;
241
- }
242
- }
243
- /**
244
- * The current fov(field of view) multiplier, 0.0 - 2.0. Defaults to 1.0. Lower values "zoom in" and higher values "zoom out".
245
- * Best used when trying to implement visual zoom effects like fish-eye or binoculars while not adjusting camera fov.
246
- * Recommended to be keep at 1.0 except for special cases.
247
- */
248
- get fovMultiplier() {
249
- return this._fovMultiplier;
250
- }
251
- set fovMultiplier(value) {
252
- if (isNaN(value)) {
253
- value = 1.0;
254
- }
255
- this._fovMultiplier = Math.max(0.0, Math.min(2.0, value));
256
- }
257
- /**
258
- * Instantiates a Background Material in the given scene
259
- * @param name The friendly name of the material
260
- * @param scene The scene to add the material to
261
- * @param forceGLSL Use the GLSL code generation for the shader (even on WebGPU). Default is false
262
- */
263
- constructor(name, scene, forceGLSL = false) {
264
- super(name, scene, undefined, forceGLSL);
265
- /**
266
- * Key light Color (multiply against the environment texture)
267
- */
268
- this.primaryColor = Color3.White();
269
- this._primaryColorShadowLevel = 0;
270
- this._primaryColorHighlightLevel = 0;
271
- /**
272
- * Reflection Texture used in the material.
273
- * Should be author in a specific way for the best result (refer to the documentation).
274
- */
275
- this.reflectionTexture = null;
276
- /**
277
- * Reflection Texture level of blur.
278
- *
279
- * Can be use to reuse an existing HDR Texture and target a specific LOD to prevent authoring the
280
- * texture twice.
281
- */
282
- this.reflectionBlur = 0;
283
- /**
284
- * Diffuse Texture used in the material.
285
- * Should be author in a specific way for the best result (refer to the documentation).
286
- */
287
- this.diffuseTexture = null;
288
- this._shadowLights = null;
289
- /**
290
- * Specify the list of lights casting shadow on the material.
291
- * All scene shadow lights will be included if null.
292
- */
293
- this.shadowLights = null;
294
- /**
295
- * Helps adjusting the shadow to a softer level if required.
296
- * 0 means black shadows and 1 means no shadows.
297
- */
298
- this.shadowLevel = 0;
299
- /**
300
- * In case of opacity Fresnel or reflection falloff, this is use as a scene center.
301
- * It is usually zero but might be interesting to modify according to your setup.
302
- */
303
- this.sceneCenter = Vector3.Zero();
304
- /**
305
- * This helps specifying that the material is falling off to the sky box at grazing angle.
306
- * This helps ensuring a nice transition when the camera goes under the ground.
307
- */
308
- this.opacityFresnel = true;
309
- /**
310
- * This helps specifying that the material is falling off from diffuse to the reflection texture at grazing angle.
311
- * This helps adding a mirror texture on the ground.
312
- */
313
- this.reflectionFresnel = false;
314
- /**
315
- * This helps specifying the falloff radius off the reflection texture from the sceneCenter.
316
- * This helps adding a nice falloff effect to the reflection if used as a mirror for instance.
317
- */
318
- this.reflectionFalloffDistance = 0.0;
319
- /**
320
- * This specifies the weight of the reflection against the background in case of reflection Fresnel.
321
- */
322
- this.reflectionAmount = 1.0;
323
- /**
324
- * This specifies the weight of the reflection at grazing angle.
325
- */
326
- this.reflectionReflectance0 = 0.05;
327
- /**
328
- * This specifies the weight of the reflection at a perpendicular point of view.
329
- */
330
- this.reflectionReflectance90 = 0.5;
331
- /**
332
- * Helps to directly use the maps channels instead of their level.
333
- */
334
- this.useRGBColor = true;
335
- /**
336
- * This helps reducing the banding effect that could occur on the background.
337
- */
338
- this.enableNoise = false;
339
- this._fovMultiplier = 1.0;
340
- /**
341
- * Enable the FOV adjustment feature controlled by fovMultiplier.
342
- */
343
- this.useEquirectangularFOV = false;
344
- this._maxSimultaneousLights = 4;
345
- /**
346
- * Number of Simultaneous lights allowed on the material.
347
- */
348
- this.maxSimultaneousLights = 4;
349
- this._shadowOnly = false;
350
- /**
351
- * Make the material only render shadows
352
- */
353
- this.shadowOnly = false;
354
- /**
355
- * Due to a bug in iOS10, video tags (which are using the background material) are in BGR and not RGB.
356
- * Setting this flag to true (not done automatically!) will convert it back to RGB.
357
- */
358
- this.switchToBGR = false;
359
- this._enableGroundProjection = false;
360
- /**
361
- * Enables the ground projection mode on the material.
362
- * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/skybox#ground-projection
363
- */
364
- this.enableGroundProjection = false;
365
- /**
366
- * Defines the radius of the projected ground if enableGroundProjection is true.
367
- * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/skybox#ground-projection
368
- */
369
- this.projectedGroundRadius = 1000;
370
- /**
371
- * Defines the height of the projected ground if enableGroundProjection is true.
372
- * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/skybox#ground-projection
373
- */
374
- this.projectedGroundHeight = 10;
375
- // Temp values kept as cache in the material.
376
- this._renderTargets = new SmartArray(16);
377
- this._reflectionControls = Vector4.Zero();
378
- this._white = Color3.White();
379
- this._primaryShadowColor = Color3.Black();
380
- this._primaryHighlightColor = Color3.Black();
381
- this._shadersLoaded = false;
382
- // Setup the default processing configuration to the scene.
383
- this._attachImageProcessingConfiguration(null);
384
- this.getRenderTargetTextures = () => {
385
- this._renderTargets.reset();
386
- if (this._diffuseTexture && this._diffuseTexture.isRenderTarget) {
387
- this._renderTargets.push(this._diffuseTexture);
183
+ let BackgroundMaterial = (() => {
184
+ var _a, _BackgroundMaterial_primaryColor_accessor_storage, _BackgroundMaterial_reflectionTexture_accessor_storage, _BackgroundMaterial_reflectionBlur_accessor_storage, _BackgroundMaterial_diffuseTexture_accessor_storage, _BackgroundMaterial_shadowLights_accessor_storage, _BackgroundMaterial_shadowLevel_accessor_storage, _BackgroundMaterial_sceneCenter_accessor_storage, _BackgroundMaterial_opacityFresnel_accessor_storage, _BackgroundMaterial_reflectionFresnel_accessor_storage, _BackgroundMaterial_reflectionFalloffDistance_accessor_storage, _BackgroundMaterial_reflectionAmount_accessor_storage, _BackgroundMaterial_reflectionReflectance0_accessor_storage, _BackgroundMaterial_reflectionReflectance90_accessor_storage, _BackgroundMaterial_useRGBColor_accessor_storage, _BackgroundMaterial_enableNoise_accessor_storage, _BackgroundMaterial_maxSimultaneousLights_accessor_storage, _BackgroundMaterial_shadowOnly_accessor_storage, _BackgroundMaterial_enableGroundProjection_accessor_storage;
185
+ let _classSuper = BackgroundMaterialBase;
186
+ let __primaryColor_decorators;
187
+ let __primaryColor_initializers = [];
188
+ let __primaryColor_extraInitializers = [];
189
+ let _primaryColor_decorators;
190
+ let _primaryColor_initializers = [];
191
+ let _primaryColor_extraInitializers = [];
192
+ let ___perceptualColor_decorators;
193
+ let ___perceptualColor_initializers = [];
194
+ let ___perceptualColor_extraInitializers = [];
195
+ let __primaryColorShadowLevel_decorators;
196
+ let __primaryColorShadowLevel_initializers = [];
197
+ let __primaryColorShadowLevel_extraInitializers = [];
198
+ let __primaryColorHighlightLevel_decorators;
199
+ let __primaryColorHighlightLevel_initializers = [];
200
+ let __primaryColorHighlightLevel_extraInitializers = [];
201
+ let __reflectionTexture_decorators;
202
+ let __reflectionTexture_initializers = [];
203
+ let __reflectionTexture_extraInitializers = [];
204
+ let _reflectionTexture_decorators;
205
+ let _reflectionTexture_initializers = [];
206
+ let _reflectionTexture_extraInitializers = [];
207
+ let __reflectionBlur_decorators;
208
+ let __reflectionBlur_initializers = [];
209
+ let __reflectionBlur_extraInitializers = [];
210
+ let _reflectionBlur_decorators;
211
+ let _reflectionBlur_initializers = [];
212
+ let _reflectionBlur_extraInitializers = [];
213
+ let __diffuseTexture_decorators;
214
+ let __diffuseTexture_initializers = [];
215
+ let __diffuseTexture_extraInitializers = [];
216
+ let _diffuseTexture_decorators;
217
+ let _diffuseTexture_initializers = [];
218
+ let _diffuseTexture_extraInitializers = [];
219
+ let _shadowLights_decorators;
220
+ let _shadowLights_initializers = [];
221
+ let _shadowLights_extraInitializers = [];
222
+ let __shadowLevel_decorators;
223
+ let __shadowLevel_initializers = [];
224
+ let __shadowLevel_extraInitializers = [];
225
+ let _shadowLevel_decorators;
226
+ let _shadowLevel_initializers = [];
227
+ let _shadowLevel_extraInitializers = [];
228
+ let __sceneCenter_decorators;
229
+ let __sceneCenter_initializers = [];
230
+ let __sceneCenter_extraInitializers = [];
231
+ let _sceneCenter_decorators;
232
+ let _sceneCenter_initializers = [];
233
+ let _sceneCenter_extraInitializers = [];
234
+ let __opacityFresnel_decorators;
235
+ let __opacityFresnel_initializers = [];
236
+ let __opacityFresnel_extraInitializers = [];
237
+ let _opacityFresnel_decorators;
238
+ let _opacityFresnel_initializers = [];
239
+ let _opacityFresnel_extraInitializers = [];
240
+ let __reflectionFresnel_decorators;
241
+ let __reflectionFresnel_initializers = [];
242
+ let __reflectionFresnel_extraInitializers = [];
243
+ let _reflectionFresnel_decorators;
244
+ let _reflectionFresnel_initializers = [];
245
+ let _reflectionFresnel_extraInitializers = [];
246
+ let __reflectionFalloffDistance_decorators;
247
+ let __reflectionFalloffDistance_initializers = [];
248
+ let __reflectionFalloffDistance_extraInitializers = [];
249
+ let _reflectionFalloffDistance_decorators;
250
+ let _reflectionFalloffDistance_initializers = [];
251
+ let _reflectionFalloffDistance_extraInitializers = [];
252
+ let __reflectionAmount_decorators;
253
+ let __reflectionAmount_initializers = [];
254
+ let __reflectionAmount_extraInitializers = [];
255
+ let _reflectionAmount_decorators;
256
+ let _reflectionAmount_initializers = [];
257
+ let _reflectionAmount_extraInitializers = [];
258
+ let __reflectionReflectance0_decorators;
259
+ let __reflectionReflectance0_initializers = [];
260
+ let __reflectionReflectance0_extraInitializers = [];
261
+ let _reflectionReflectance0_decorators;
262
+ let _reflectionReflectance0_initializers = [];
263
+ let _reflectionReflectance0_extraInitializers = [];
264
+ let __reflectionReflectance90_decorators;
265
+ let __reflectionReflectance90_initializers = [];
266
+ let __reflectionReflectance90_extraInitializers = [];
267
+ let _reflectionReflectance90_decorators;
268
+ let _reflectionReflectance90_initializers = [];
269
+ let _reflectionReflectance90_extraInitializers = [];
270
+ let __useRGBColor_decorators;
271
+ let __useRGBColor_initializers = [];
272
+ let __useRGBColor_extraInitializers = [];
273
+ let _useRGBColor_decorators;
274
+ let _useRGBColor_initializers = [];
275
+ let _useRGBColor_extraInitializers = [];
276
+ let __enableNoise_decorators;
277
+ let __enableNoise_initializers = [];
278
+ let __enableNoise_extraInitializers = [];
279
+ let _enableNoise_decorators;
280
+ let _enableNoise_initializers = [];
281
+ let _enableNoise_extraInitializers = [];
282
+ let __maxSimultaneousLights_decorators;
283
+ let __maxSimultaneousLights_initializers = [];
284
+ let __maxSimultaneousLights_extraInitializers = [];
285
+ let _maxSimultaneousLights_decorators;
286
+ let _maxSimultaneousLights_initializers = [];
287
+ let _maxSimultaneousLights_extraInitializers = [];
288
+ let __shadowOnly_decorators;
289
+ let __shadowOnly_initializers = [];
290
+ let __shadowOnly_extraInitializers = [];
291
+ let _shadowOnly_decorators;
292
+ let _shadowOnly_initializers = [];
293
+ let _shadowOnly_extraInitializers = [];
294
+ let _enableGroundProjection_decorators;
295
+ let _enableGroundProjection_initializers = [];
296
+ let _enableGroundProjection_extraInitializers = [];
297
+ let _projectedGroundRadius_decorators;
298
+ let _projectedGroundRadius_initializers = [];
299
+ let _projectedGroundRadius_extraInitializers = [];
300
+ let _projectedGroundHeight_decorators;
301
+ let _projectedGroundHeight_initializers = [];
302
+ let _projectedGroundHeight_extraInitializers = [];
303
+ return _a = class BackgroundMaterial extends _classSuper {
304
+ /**
305
+ * Key light Color (multiply against the environment texture)
306
+ */
307
+ get primaryColor() { return __classPrivateFieldGet(this, _BackgroundMaterial_primaryColor_accessor_storage, "f"); }
308
+ set primaryColor(value) { __classPrivateFieldSet(this, _BackgroundMaterial_primaryColor_accessor_storage, value, "f"); }
309
+ /**
310
+ * Experimental Internal Use Only.
311
+ *
312
+ * Key light Color in "perceptual value" meaning the color you would like to see on screen.
313
+ * This acts as a helper to set the primary color to a more "human friendly" value.
314
+ * Conversion to linear space as well as exposure and tone mapping correction will be applied to keep the
315
+ * output color as close as possible from the chosen value.
316
+ * (This does not account for contrast color grading and color curves as they are considered post effect and not directly
317
+ * part of lighting setup.)
318
+ */
319
+ get _perceptualColor() {
320
+ return this.__perceptualColor;
388
321
  }
389
- if (this._reflectionTexture && this._reflectionTexture.isRenderTarget) {
390
- this._renderTargets.push(this._reflectionTexture);
322
+ set _perceptualColor(value) {
323
+ this.__perceptualColor = value;
324
+ this._computePrimaryColorFromPerceptualColor();
325
+ this._markAllSubMeshesAsLightsDirty();
391
326
  }
392
- return this._renderTargets;
393
- };
394
- }
395
- /**
396
- * Gets a boolean indicating that current material needs to register RTT
397
- */
398
- get hasRenderTargetTextures() {
399
- if (this._diffuseTexture && this._diffuseTexture.isRenderTarget) {
400
- return true;
401
- }
402
- if (this._reflectionTexture && this._reflectionTexture.isRenderTarget) {
403
- return true;
404
- }
405
- return false;
406
- }
407
- /**
408
- * The entire material has been created in order to prevent overdraw.
409
- * @returns false
410
- */
411
- needAlphaTesting() {
412
- return true;
413
- }
414
- /**
415
- * The entire material has been created in order to prevent overdraw.
416
- * @returns true if blending is enable
417
- */
418
- needAlphaBlending() {
419
- return this.alpha < 1 || (this._diffuseTexture != null && this._diffuseTexture.hasAlpha) || this._shadowOnly;
420
- }
421
- /**
422
- * Checks whether the material is ready to be rendered for a given mesh.
423
- * @param mesh The mesh to render
424
- * @param subMesh The submesh to check against
425
- * @param useInstances Specify wether or not the material is used with instances
426
- * @returns true if all the dependencies are ready (Textures, Effects...)
427
- */
428
- isReadyForSubMesh(mesh, subMesh, useInstances = false) {
429
- const drawWrapper = subMesh._drawWrapper;
430
- if (drawWrapper.effect && this.isFrozen) {
431
- if (drawWrapper._wasPreviouslyReady && drawWrapper._wasPreviouslyUsingInstances === useInstances) {
327
+ /**
328
+ * Defines the level of the shadows (dark area of the reflection map) in order to help scaling the colors.
329
+ * The color opposite to the primary color is used at the level chosen to define what the black area would look.
330
+ */
331
+ get primaryColorShadowLevel() {
332
+ return this._primaryColorShadowLevel;
333
+ }
334
+ set primaryColorShadowLevel(value) {
335
+ this._primaryColorShadowLevel = value;
336
+ this._computePrimaryColors();
337
+ this._markAllSubMeshesAsLightsDirty();
338
+ }
339
+ /**
340
+ * Defines the level of the highlights (highlight area of the reflection map) in order to help scaling the colors.
341
+ * The primary color is used at the level chosen to define what the white area would look.
342
+ */
343
+ get primaryColorHighlightLevel() {
344
+ return this._primaryColorHighlightLevel;
345
+ }
346
+ set primaryColorHighlightLevel(value) {
347
+ this._primaryColorHighlightLevel = value;
348
+ this._computePrimaryColors();
349
+ this._markAllSubMeshesAsLightsDirty();
350
+ }
351
+ /**
352
+ * Reflection Texture used in the material.
353
+ * Should be author in a specific way for the best result (refer to the documentation).
354
+ */
355
+ get reflectionTexture() { return __classPrivateFieldGet(this, _BackgroundMaterial_reflectionTexture_accessor_storage, "f"); }
356
+ set reflectionTexture(value) { __classPrivateFieldSet(this, _BackgroundMaterial_reflectionTexture_accessor_storage, value, "f"); }
357
+ /**
358
+ * Reflection Texture level of blur.
359
+ *
360
+ * Can be use to reuse an existing HDR Texture and target a specific LOD to prevent authoring the
361
+ * texture twice.
362
+ */
363
+ get reflectionBlur() { return __classPrivateFieldGet(this, _BackgroundMaterial_reflectionBlur_accessor_storage, "f"); }
364
+ set reflectionBlur(value) { __classPrivateFieldSet(this, _BackgroundMaterial_reflectionBlur_accessor_storage, value, "f"); }
365
+ /**
366
+ * Diffuse Texture used in the material.
367
+ * Should be author in a specific way for the best result (refer to the documentation).
368
+ */
369
+ get diffuseTexture() { return __classPrivateFieldGet(this, _BackgroundMaterial_diffuseTexture_accessor_storage, "f"); }
370
+ set diffuseTexture(value) { __classPrivateFieldSet(this, _BackgroundMaterial_diffuseTexture_accessor_storage, value, "f"); }
371
+ /**
372
+ * Specify the list of lights casting shadow on the material.
373
+ * All scene shadow lights will be included if null.
374
+ */
375
+ get shadowLights() { return __classPrivateFieldGet(this, _BackgroundMaterial_shadowLights_accessor_storage, "f"); }
376
+ set shadowLights(value) { __classPrivateFieldSet(this, _BackgroundMaterial_shadowLights_accessor_storage, value, "f"); }
377
+ /**
378
+ * Helps adjusting the shadow to a softer level if required.
379
+ * 0 means black shadows and 1 means no shadows.
380
+ */
381
+ get shadowLevel() { return __classPrivateFieldGet(this, _BackgroundMaterial_shadowLevel_accessor_storage, "f"); }
382
+ set shadowLevel(value) { __classPrivateFieldSet(this, _BackgroundMaterial_shadowLevel_accessor_storage, value, "f"); }
383
+ /**
384
+ * In case of opacity Fresnel or reflection falloff, this is use as a scene center.
385
+ * It is usually zero but might be interesting to modify according to your setup.
386
+ */
387
+ get sceneCenter() { return __classPrivateFieldGet(this, _BackgroundMaterial_sceneCenter_accessor_storage, "f"); }
388
+ set sceneCenter(value) { __classPrivateFieldSet(this, _BackgroundMaterial_sceneCenter_accessor_storage, value, "f"); }
389
+ /**
390
+ * This helps specifying that the material is falling off to the sky box at grazing angle.
391
+ * This helps ensuring a nice transition when the camera goes under the ground.
392
+ */
393
+ get opacityFresnel() { return __classPrivateFieldGet(this, _BackgroundMaterial_opacityFresnel_accessor_storage, "f"); }
394
+ set opacityFresnel(value) { __classPrivateFieldSet(this, _BackgroundMaterial_opacityFresnel_accessor_storage, value, "f"); }
395
+ /**
396
+ * This helps specifying that the material is falling off from diffuse to the reflection texture at grazing angle.
397
+ * This helps adding a mirror texture on the ground.
398
+ */
399
+ get reflectionFresnel() { return __classPrivateFieldGet(this, _BackgroundMaterial_reflectionFresnel_accessor_storage, "f"); }
400
+ set reflectionFresnel(value) { __classPrivateFieldSet(this, _BackgroundMaterial_reflectionFresnel_accessor_storage, value, "f"); }
401
+ /**
402
+ * This helps specifying the falloff radius off the reflection texture from the sceneCenter.
403
+ * This helps adding a nice falloff effect to the reflection if used as a mirror for instance.
404
+ */
405
+ get reflectionFalloffDistance() { return __classPrivateFieldGet(this, _BackgroundMaterial_reflectionFalloffDistance_accessor_storage, "f"); }
406
+ set reflectionFalloffDistance(value) { __classPrivateFieldSet(this, _BackgroundMaterial_reflectionFalloffDistance_accessor_storage, value, "f"); }
407
+ /**
408
+ * This specifies the weight of the reflection against the background in case of reflection Fresnel.
409
+ */
410
+ get reflectionAmount() { return __classPrivateFieldGet(this, _BackgroundMaterial_reflectionAmount_accessor_storage, "f"); }
411
+ set reflectionAmount(value) { __classPrivateFieldSet(this, _BackgroundMaterial_reflectionAmount_accessor_storage, value, "f"); }
412
+ /**
413
+ * This specifies the weight of the reflection at grazing angle.
414
+ */
415
+ get reflectionReflectance0() { return __classPrivateFieldGet(this, _BackgroundMaterial_reflectionReflectance0_accessor_storage, "f"); }
416
+ set reflectionReflectance0(value) { __classPrivateFieldSet(this, _BackgroundMaterial_reflectionReflectance0_accessor_storage, value, "f"); }
417
+ /**
418
+ * This specifies the weight of the reflection at a perpendicular point of view.
419
+ */
420
+ get reflectionReflectance90() { return __classPrivateFieldGet(this, _BackgroundMaterial_reflectionReflectance90_accessor_storage, "f"); }
421
+ set reflectionReflectance90(value) { __classPrivateFieldSet(this, _BackgroundMaterial_reflectionReflectance90_accessor_storage, value, "f"); }
422
+ /**
423
+ * Sets the reflection reflectance fresnel values according to the default standard
424
+ * empirically know to work well :-)
425
+ */
426
+ set reflectionStandardFresnelWeight(value) {
427
+ let reflectionWeight = value;
428
+ if (reflectionWeight < 0.5) {
429
+ reflectionWeight = reflectionWeight * 2.0;
430
+ this.reflectionReflectance0 = _a.StandardReflectance0 * reflectionWeight;
431
+ this.reflectionReflectance90 = _a.StandardReflectance90 * reflectionWeight;
432
+ }
433
+ else {
434
+ reflectionWeight = reflectionWeight * 2.0 - 1.0;
435
+ this.reflectionReflectance0 = _a.StandardReflectance0 + (1.0 - _a.StandardReflectance0) * reflectionWeight;
436
+ this.reflectionReflectance90 = _a.StandardReflectance90 + (1.0 - _a.StandardReflectance90) * reflectionWeight;
437
+ }
438
+ }
439
+ /**
440
+ * Helps to directly use the maps channels instead of their level.
441
+ */
442
+ get useRGBColor() { return __classPrivateFieldGet(this, _BackgroundMaterial_useRGBColor_accessor_storage, "f"); }
443
+ set useRGBColor(value) { __classPrivateFieldSet(this, _BackgroundMaterial_useRGBColor_accessor_storage, value, "f"); }
444
+ /**
445
+ * This helps reducing the banding effect that could occur on the background.
446
+ */
447
+ get enableNoise() { return __classPrivateFieldGet(this, _BackgroundMaterial_enableNoise_accessor_storage, "f"); }
448
+ set enableNoise(value) { __classPrivateFieldSet(this, _BackgroundMaterial_enableNoise_accessor_storage, value, "f"); }
449
+ /**
450
+ * The current fov(field of view) multiplier, 0.0 - 2.0. Defaults to 1.0. Lower values "zoom in" and higher values "zoom out".
451
+ * Best used when trying to implement visual zoom effects like fish-eye or binoculars while not adjusting camera fov.
452
+ * Recommended to be keep at 1.0 except for special cases.
453
+ */
454
+ get fovMultiplier() {
455
+ return this._fovMultiplier;
456
+ }
457
+ set fovMultiplier(value) {
458
+ if (isNaN(value)) {
459
+ value = 1.0;
460
+ }
461
+ this._fovMultiplier = Math.max(0.0, Math.min(2.0, value));
462
+ }
463
+ /**
464
+ * Number of Simultaneous lights allowed on the material.
465
+ */
466
+ get maxSimultaneousLights() { return __classPrivateFieldGet(this, _BackgroundMaterial_maxSimultaneousLights_accessor_storage, "f"); }
467
+ set maxSimultaneousLights(value) { __classPrivateFieldSet(this, _BackgroundMaterial_maxSimultaneousLights_accessor_storage, value, "f"); }
468
+ /**
469
+ * Make the material only render shadows
470
+ */
471
+ get shadowOnly() { return __classPrivateFieldGet(this, _BackgroundMaterial_shadowOnly_accessor_storage, "f"); }
472
+ set shadowOnly(value) { __classPrivateFieldSet(this, _BackgroundMaterial_shadowOnly_accessor_storage, value, "f"); }
473
+ /**
474
+ * Enables the ground projection mode on the material.
475
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/skybox#ground-projection
476
+ */
477
+ get enableGroundProjection() { return __classPrivateFieldGet(this, _BackgroundMaterial_enableGroundProjection_accessor_storage, "f"); }
478
+ set enableGroundProjection(value) { __classPrivateFieldSet(this, _BackgroundMaterial_enableGroundProjection_accessor_storage, value, "f"); }
479
+ /**
480
+ * Instantiates a Background Material in the given scene
481
+ * @param name The friendly name of the material
482
+ * @param scene The scene to add the material to
483
+ * @param forceGLSL Use the GLSL code generation for the shader (even on WebGPU). Default is false
484
+ */
485
+ constructor(name, scene, forceGLSL = false) {
486
+ super(name, scene, undefined, forceGLSL);
487
+ this._primaryColor = __runInitializers(this, __primaryColor_initializers, void 0);
488
+ _BackgroundMaterial_primaryColor_accessor_storage.set(this, (__runInitializers(this, __primaryColor_extraInitializers), __runInitializers(this, _primaryColor_initializers, Color3.White())));
489
+ this.__perceptualColor = (__runInitializers(this, _primaryColor_extraInitializers), __runInitializers(this, ___perceptualColor_initializers, void 0));
490
+ this._primaryColorShadowLevel = (__runInitializers(this, ___perceptualColor_extraInitializers), __runInitializers(this, __primaryColorShadowLevel_initializers, 0));
491
+ this._primaryColorHighlightLevel = (__runInitializers(this, __primaryColorShadowLevel_extraInitializers), __runInitializers(this, __primaryColorHighlightLevel_initializers, 0));
492
+ this._reflectionTexture = (__runInitializers(this, __primaryColorHighlightLevel_extraInitializers), __runInitializers(this, __reflectionTexture_initializers, void 0));
493
+ _BackgroundMaterial_reflectionTexture_accessor_storage.set(this, (__runInitializers(this, __reflectionTexture_extraInitializers), __runInitializers(this, _reflectionTexture_initializers, null)));
494
+ this._reflectionBlur = (__runInitializers(this, _reflectionTexture_extraInitializers), __runInitializers(this, __reflectionBlur_initializers, void 0));
495
+ _BackgroundMaterial_reflectionBlur_accessor_storage.set(this, (__runInitializers(this, __reflectionBlur_extraInitializers), __runInitializers(this, _reflectionBlur_initializers, 0)));
496
+ this._diffuseTexture = (__runInitializers(this, _reflectionBlur_extraInitializers), __runInitializers(this, __diffuseTexture_initializers, void 0));
497
+ _BackgroundMaterial_diffuseTexture_accessor_storage.set(this, (__runInitializers(this, __diffuseTexture_extraInitializers), __runInitializers(this, _diffuseTexture_initializers, null)));
498
+ this._shadowLights = (__runInitializers(this, _diffuseTexture_extraInitializers), null);
499
+ _BackgroundMaterial_shadowLights_accessor_storage.set(this, __runInitializers(this, _shadowLights_initializers, null));
500
+ this._shadowLevel = (__runInitializers(this, _shadowLights_extraInitializers), __runInitializers(this, __shadowLevel_initializers, void 0));
501
+ _BackgroundMaterial_shadowLevel_accessor_storage.set(this, (__runInitializers(this, __shadowLevel_extraInitializers), __runInitializers(this, _shadowLevel_initializers, 0)));
502
+ this._sceneCenter = (__runInitializers(this, _shadowLevel_extraInitializers), __runInitializers(this, __sceneCenter_initializers, void 0));
503
+ _BackgroundMaterial_sceneCenter_accessor_storage.set(this, (__runInitializers(this, __sceneCenter_extraInitializers), __runInitializers(this, _sceneCenter_initializers, Vector3.Zero())));
504
+ this._opacityFresnel = (__runInitializers(this, _sceneCenter_extraInitializers), __runInitializers(this, __opacityFresnel_initializers, void 0));
505
+ _BackgroundMaterial_opacityFresnel_accessor_storage.set(this, (__runInitializers(this, __opacityFresnel_extraInitializers), __runInitializers(this, _opacityFresnel_initializers, true)));
506
+ this._reflectionFresnel = (__runInitializers(this, _opacityFresnel_extraInitializers), __runInitializers(this, __reflectionFresnel_initializers, void 0));
507
+ _BackgroundMaterial_reflectionFresnel_accessor_storage.set(this, (__runInitializers(this, __reflectionFresnel_extraInitializers), __runInitializers(this, _reflectionFresnel_initializers, false)));
508
+ this._reflectionFalloffDistance = (__runInitializers(this, _reflectionFresnel_extraInitializers), __runInitializers(this, __reflectionFalloffDistance_initializers, void 0));
509
+ _BackgroundMaterial_reflectionFalloffDistance_accessor_storage.set(this, (__runInitializers(this, __reflectionFalloffDistance_extraInitializers), __runInitializers(this, _reflectionFalloffDistance_initializers, 0.0)));
510
+ this._reflectionAmount = (__runInitializers(this, _reflectionFalloffDistance_extraInitializers), __runInitializers(this, __reflectionAmount_initializers, void 0));
511
+ _BackgroundMaterial_reflectionAmount_accessor_storage.set(this, (__runInitializers(this, __reflectionAmount_extraInitializers), __runInitializers(this, _reflectionAmount_initializers, 1.0)));
512
+ this._reflectionReflectance0 = (__runInitializers(this, _reflectionAmount_extraInitializers), __runInitializers(this, __reflectionReflectance0_initializers, void 0));
513
+ _BackgroundMaterial_reflectionReflectance0_accessor_storage.set(this, (__runInitializers(this, __reflectionReflectance0_extraInitializers), __runInitializers(this, _reflectionReflectance0_initializers, 0.05)));
514
+ this._reflectionReflectance90 = (__runInitializers(this, _reflectionReflectance0_extraInitializers), __runInitializers(this, __reflectionReflectance90_initializers, void 0));
515
+ _BackgroundMaterial_reflectionReflectance90_accessor_storage.set(this, (__runInitializers(this, __reflectionReflectance90_extraInitializers), __runInitializers(this, _reflectionReflectance90_initializers, 0.5)));
516
+ this._useRGBColor = (__runInitializers(this, _reflectionReflectance90_extraInitializers), __runInitializers(this, __useRGBColor_initializers, void 0));
517
+ _BackgroundMaterial_useRGBColor_accessor_storage.set(this, (__runInitializers(this, __useRGBColor_extraInitializers), __runInitializers(this, _useRGBColor_initializers, true)));
518
+ this._enableNoise = (__runInitializers(this, _useRGBColor_extraInitializers), __runInitializers(this, __enableNoise_initializers, void 0));
519
+ _BackgroundMaterial_enableNoise_accessor_storage.set(this, (__runInitializers(this, __enableNoise_extraInitializers), __runInitializers(this, _enableNoise_initializers, false)));
520
+ this._fovMultiplier = (__runInitializers(this, _enableNoise_extraInitializers), 1.0);
521
+ /**
522
+ * Enable the FOV adjustment feature controlled by fovMultiplier.
523
+ */
524
+ this.useEquirectangularFOV = false;
525
+ this._maxSimultaneousLights = __runInitializers(this, __maxSimultaneousLights_initializers, 4);
526
+ _BackgroundMaterial_maxSimultaneousLights_accessor_storage.set(this, (__runInitializers(this, __maxSimultaneousLights_extraInitializers), __runInitializers(this, _maxSimultaneousLights_initializers, 4)));
527
+ this._shadowOnly = (__runInitializers(this, _maxSimultaneousLights_extraInitializers), __runInitializers(this, __shadowOnly_initializers, false));
528
+ _BackgroundMaterial_shadowOnly_accessor_storage.set(this, (__runInitializers(this, __shadowOnly_extraInitializers), __runInitializers(this, _shadowOnly_initializers, false)));
529
+ /**
530
+ * Due to a bug in iOS10, video tags (which are using the background material) are in BGR and not RGB.
531
+ * Setting this flag to true (not done automatically!) will convert it back to RGB.
532
+ */
533
+ this.switchToBGR = (__runInitializers(this, _shadowOnly_extraInitializers), false);
534
+ this._enableGroundProjection = false;
535
+ _BackgroundMaterial_enableGroundProjection_accessor_storage.set(this, __runInitializers(this, _enableGroundProjection_initializers, false));
536
+ /**
537
+ * Defines the radius of the projected ground if enableGroundProjection is true.
538
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/skybox#ground-projection
539
+ */
540
+ this.projectedGroundRadius = (__runInitializers(this, _enableGroundProjection_extraInitializers), __runInitializers(this, _projectedGroundRadius_initializers, 1000));
541
+ /**
542
+ * Defines the height of the projected ground if enableGroundProjection is true.
543
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/skybox#ground-projection
544
+ */
545
+ this.projectedGroundHeight = (__runInitializers(this, _projectedGroundRadius_extraInitializers), __runInitializers(this, _projectedGroundHeight_initializers, 10));
546
+ // Temp values kept as cache in the material.
547
+ this._renderTargets = (__runInitializers(this, _projectedGroundHeight_extraInitializers), new SmartArray(16));
548
+ this._reflectionControls = Vector4.Zero();
549
+ this._white = Color3.White();
550
+ this._primaryShadowColor = Color3.Black();
551
+ this._primaryHighlightColor = Color3.Black();
552
+ this._shadersLoaded = false;
553
+ // Setup the default processing configuration to the scene.
554
+ this._attachImageProcessingConfiguration(null);
555
+ this.getRenderTargetTextures = () => {
556
+ this._renderTargets.reset();
557
+ if (this._diffuseTexture && this._diffuseTexture.isRenderTarget) {
558
+ this._renderTargets.push(this._diffuseTexture);
559
+ }
560
+ if (this._reflectionTexture && this._reflectionTexture.isRenderTarget) {
561
+ this._renderTargets.push(this._reflectionTexture);
562
+ }
563
+ return this._renderTargets;
564
+ };
565
+ }
566
+ /**
567
+ * Gets a boolean indicating that current material needs to register RTT
568
+ */
569
+ get hasRenderTargetTextures() {
570
+ if (this._diffuseTexture && this._diffuseTexture.isRenderTarget) {
571
+ return true;
572
+ }
573
+ if (this._reflectionTexture && this._reflectionTexture.isRenderTarget) {
574
+ return true;
575
+ }
576
+ return false;
577
+ }
578
+ /**
579
+ * The entire material has been created in order to prevent overdraw.
580
+ * @returns false
581
+ */
582
+ needAlphaTesting() {
432
583
  return true;
433
584
  }
434
- }
435
- if (!subMesh.materialDefines) {
436
- subMesh.materialDefines = new BackgroundMaterialDefines();
437
- }
438
- const scene = this.getScene();
439
- const defines = subMesh.materialDefines;
440
- if (this._isReadyForSubMesh(subMesh)) {
441
- return true;
442
- }
443
- const engine = scene.getEngine();
444
- // Lights
445
- PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights);
446
- defines._needNormals = true;
447
- if (!AreLightsTexturesReady(scene, mesh, this._maxSimultaneousLights)) {
448
- return false;
449
- }
450
- // Multiview
451
- PrepareDefinesForMultiview(scene, defines);
452
- // Textures
453
- if (defines._areTexturesDirty) {
454
- defines._needUVs = false;
455
- if (scene.texturesEnabled) {
456
- if (scene.getEngine().getCaps().textureLOD) {
457
- defines.TEXTURELODSUPPORT = true;
585
+ /**
586
+ * The entire material has been created in order to prevent overdraw.
587
+ * @returns true if blending is enable
588
+ */
589
+ needAlphaBlending() {
590
+ return this.alpha < 1 || (this._diffuseTexture != null && this._diffuseTexture.hasAlpha) || this._shadowOnly;
591
+ }
592
+ /**
593
+ * Checks whether the material is ready to be rendered for a given mesh.
594
+ * @param mesh The mesh to render
595
+ * @param subMesh The submesh to check against
596
+ * @param useInstances Specify wether or not the material is used with instances
597
+ * @returns true if all the dependencies are ready (Textures, Effects...)
598
+ */
599
+ isReadyForSubMesh(mesh, subMesh, useInstances = false) {
600
+ const drawWrapper = subMesh._drawWrapper;
601
+ if (drawWrapper.effect && this.isFrozen) {
602
+ if (drawWrapper._wasPreviouslyReady && drawWrapper._wasPreviouslyUsingInstances === useInstances) {
603
+ return true;
604
+ }
458
605
  }
459
- if (this._diffuseTexture && MaterialFlags.DiffuseTextureEnabled) {
460
- if (!this._diffuseTexture.isReadyOrNotBlocking()) {
461
- return false;
606
+ if (!subMesh.materialDefines) {
607
+ subMesh.materialDefines = new BackgroundMaterialDefines();
608
+ }
609
+ const scene = this.getScene();
610
+ const defines = subMesh.materialDefines;
611
+ if (this._isReadyForSubMesh(subMesh)) {
612
+ return true;
613
+ }
614
+ const engine = scene.getEngine();
615
+ // Lights
616
+ PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights);
617
+ defines._needNormals = true;
618
+ if (!AreLightsTexturesReady(scene, mesh, this._maxSimultaneousLights)) {
619
+ return false;
620
+ }
621
+ // Multiview
622
+ PrepareDefinesForMultiview(scene, defines);
623
+ // Textures
624
+ if (defines._areTexturesDirty) {
625
+ defines._needUVs = false;
626
+ if (scene.texturesEnabled) {
627
+ if (scene.getEngine().getCaps().textureLOD) {
628
+ defines.TEXTURELODSUPPORT = true;
629
+ }
630
+ if (this._diffuseTexture && MaterialFlags.DiffuseTextureEnabled) {
631
+ if (!this._diffuseTexture.isReadyOrNotBlocking()) {
632
+ return false;
633
+ }
634
+ PrepareDefinesForMergedUV(this._diffuseTexture, defines, "DIFFUSE");
635
+ defines.DIFFUSEHASALPHA = this._diffuseTexture.hasAlpha;
636
+ defines.GAMMADIFFUSE = this._diffuseTexture.gammaSpace;
637
+ defines.OPACITYFRESNEL = this._opacityFresnel;
638
+ }
639
+ else {
640
+ defines.DIFFUSE = false;
641
+ defines.DIFFUSEDIRECTUV = 0;
642
+ defines.DIFFUSEHASALPHA = false;
643
+ defines.GAMMADIFFUSE = false;
644
+ defines.OPACITYFRESNEL = false;
645
+ }
646
+ const reflectionTexture = this._reflectionTexture;
647
+ PrepareDefinesForIBL(scene, reflectionTexture, defines);
648
+ if (reflectionTexture && MaterialFlags.ReflectionTextureEnabled) {
649
+ if (!reflectionTexture.isReadyOrNotBlocking()) {
650
+ return false;
651
+ }
652
+ defines.EQUIRECTANGULAR_RELFECTION_FOV = this.useEquirectangularFOV;
653
+ defines.REFLECTIONBGR = this.switchToBGR;
654
+ defines.REFLECTIONBLUR = this._reflectionBlur > 0;
655
+ if (this.reflectionFresnel) {
656
+ defines.REFLECTIONFRESNEL = true;
657
+ defines.REFLECTIONFALLOFF = this.reflectionFalloffDistance > 0;
658
+ this._reflectionControls.x = this.reflectionAmount;
659
+ this._reflectionControls.y = this.reflectionReflectance0;
660
+ this._reflectionControls.z = this.reflectionReflectance90;
661
+ this._reflectionControls.w = 1 / this.reflectionFalloffDistance;
662
+ }
663
+ else {
664
+ defines.REFLECTIONFRESNEL = false;
665
+ defines.REFLECTIONFALLOFF = false;
666
+ }
667
+ }
668
+ else {
669
+ defines.REFLECTIONFRESNEL = false;
670
+ defines.REFLECTIONFALLOFF = false;
671
+ defines.REFLECTIONBLUR = false;
672
+ }
462
673
  }
463
- PrepareDefinesForMergedUV(this._diffuseTexture, defines, "DIFFUSE");
464
- defines.DIFFUSEHASALPHA = this._diffuseTexture.hasAlpha;
465
- defines.GAMMADIFFUSE = this._diffuseTexture.gammaSpace;
466
- defines.OPACITYFRESNEL = this._opacityFresnel;
674
+ defines.PREMULTIPLYALPHA = this.alphaMode === 7 || this.alphaMode === 8;
675
+ defines.USERGBCOLOR = this._useRGBColor;
676
+ defines.NOISE = this._enableNoise;
467
677
  }
468
- else {
469
- defines.DIFFUSE = false;
470
- defines.DIFFUSEDIRECTUV = 0;
471
- defines.DIFFUSEHASALPHA = false;
472
- defines.GAMMADIFFUSE = false;
473
- defines.OPACITYFRESNEL = false;
678
+ if (defines._areLightsDirty) {
679
+ defines.USEHIGHLIGHTANDSHADOWCOLORS = !this._useRGBColor && (this._primaryColorShadowLevel !== 0 || this._primaryColorHighlightLevel !== 0);
680
+ defines.BACKMAT_SHADOWONLY = this._shadowOnly;
474
681
  }
475
- const reflectionTexture = this._reflectionTexture;
476
- PrepareDefinesForIBL(scene, reflectionTexture, defines);
477
- if (reflectionTexture && MaterialFlags.ReflectionTextureEnabled) {
478
- if (!reflectionTexture.isReadyOrNotBlocking()) {
682
+ if (defines._areImageProcessingDirty && this._imageProcessingConfiguration) {
683
+ if (!this._imageProcessingConfiguration.isReady()) {
479
684
  return false;
480
685
  }
481
- defines.EQUIRECTANGULAR_RELFECTION_FOV = this.useEquirectangularFOV;
482
- defines.REFLECTIONBGR = this.switchToBGR;
483
- defines.REFLECTIONBLUR = this._reflectionBlur > 0;
484
- if (this.reflectionFresnel) {
485
- defines.REFLECTIONFRESNEL = true;
486
- defines.REFLECTIONFALLOFF = this.reflectionFalloffDistance > 0;
487
- this._reflectionControls.x = this.reflectionAmount;
488
- this._reflectionControls.y = this.reflectionReflectance0;
489
- this._reflectionControls.z = this.reflectionReflectance90;
490
- this._reflectionControls.w = 1 / this.reflectionFalloffDistance;
686
+ this._imageProcessingConfiguration.prepareDefines(defines);
687
+ }
688
+ if (defines._areMiscDirty) {
689
+ if (defines.REFLECTIONMAP_3D && this._enableGroundProjection) {
690
+ defines.PROJECTED_GROUND = true;
691
+ defines.REFLECTIONMAP_SKYBOX = true;
491
692
  }
492
693
  else {
493
- defines.REFLECTIONFRESNEL = false;
494
- defines.REFLECTIONFALLOFF = false;
694
+ defines.PROJECTED_GROUND = false;
495
695
  }
496
696
  }
497
- else {
498
- defines.REFLECTIONFRESNEL = false;
499
- defines.REFLECTIONFALLOFF = false;
500
- defines.REFLECTIONBLUR = false;
697
+ // Misc.
698
+ PrepareDefinesForMisc(mesh, scene, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this.needAlphaTestingForMesh(mesh), defines, undefined, undefined, undefined, this._isVertexOutputInvariant);
699
+ // Values that need to be evaluated on every frame
700
+ PrepareDefinesForFrameBoundValues(scene, engine, this, defines, useInstances, null, subMesh.getRenderingMesh().hasThinInstances);
701
+ // Attribs
702
+ if (PrepareDefinesForAttributes(mesh, defines, false, true, false)) {
703
+ if (mesh) {
704
+ if (!scene.getEngine().getCaps().standardDerivatives && !mesh.isVerticesDataPresent(VertexBuffer.NormalKind)) {
705
+ mesh.createNormals(true);
706
+ Logger.Warn("BackgroundMaterial: Normals have been created for the mesh: " + mesh.name);
707
+ }
708
+ }
501
709
  }
502
- }
503
- defines.PREMULTIPLYALPHA = this.alphaMode === 7 || this.alphaMode === 8;
504
- defines.USERGBCOLOR = this._useRGBColor;
505
- defines.NOISE = this._enableNoise;
506
- }
507
- if (defines._areLightsDirty) {
508
- defines.USEHIGHLIGHTANDSHADOWCOLORS = !this._useRGBColor && (this._primaryColorShadowLevel !== 0 || this._primaryColorHighlightLevel !== 0);
509
- defines.BACKMAT_SHADOWONLY = this._shadowOnly;
510
- }
511
- if (defines._areImageProcessingDirty && this._imageProcessingConfiguration) {
512
- if (!this._imageProcessingConfiguration.isReady()) {
513
- return false;
514
- }
515
- this._imageProcessingConfiguration.prepareDefines(defines);
516
- }
517
- if (defines._areMiscDirty) {
518
- if (defines.REFLECTIONMAP_3D && this._enableGroundProjection) {
519
- defines.PROJECTED_GROUND = true;
520
- defines.REFLECTIONMAP_SKYBOX = true;
521
- }
522
- else {
523
- defines.PROJECTED_GROUND = false;
524
- }
525
- }
526
- // Misc.
527
- PrepareDefinesForMisc(mesh, scene, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this.needAlphaTestingForMesh(mesh), defines, undefined, undefined, undefined, this._isVertexOutputInvariant);
528
- // Values that need to be evaluated on every frame
529
- PrepareDefinesForFrameBoundValues(scene, engine, this, defines, useInstances, null, subMesh.getRenderingMesh().hasThinInstances);
530
- // Attribs
531
- if (PrepareDefinesForAttributes(mesh, defines, false, true, false)) {
532
- if (mesh) {
533
- if (!scene.getEngine().getCaps().standardDerivatives && !mesh.isVerticesDataPresent(VertexBuffer.NormalKind)) {
534
- mesh.createNormals(true);
535
- Logger.Warn("BackgroundMaterial: Normals have been created for the mesh: " + mesh.name);
710
+ // Get correct effect
711
+ if (defines.isDirty) {
712
+ defines.markAsProcessed();
713
+ scene.resetCachedMaterial();
714
+ // Fallbacks
715
+ const fallbacks = new EffectFallbacks();
716
+ if (defines.FOG) {
717
+ fallbacks.addFallback(0, "FOG");
718
+ }
719
+ if (defines.POINTSIZE) {
720
+ fallbacks.addFallback(1, "POINTSIZE");
721
+ }
722
+ if (defines.MULTIVIEW) {
723
+ fallbacks.addFallback(0, "MULTIVIEW");
724
+ }
725
+ HandleFallbacksForShadows(defines, fallbacks, this._maxSimultaneousLights);
726
+ //Attributes
727
+ const attribs = [VertexBuffer.PositionKind];
728
+ if (defines.NORMAL) {
729
+ attribs.push(VertexBuffer.NormalKind);
730
+ }
731
+ if (defines.UV1) {
732
+ attribs.push(VertexBuffer.UVKind);
733
+ }
734
+ if (defines.UV2) {
735
+ attribs.push(VertexBuffer.UV2Kind);
736
+ }
737
+ PrepareAttributesForBones(attribs, mesh, defines, fallbacks);
738
+ PrepareAttributesForInstances(attribs, defines);
739
+ const uniforms = [
740
+ "world",
741
+ "view",
742
+ "viewProjection",
743
+ "vEyePosition",
744
+ "vLightsType",
745
+ "vFogInfos",
746
+ "vFogColor",
747
+ "pointSize",
748
+ "mBones",
749
+ "vPrimaryColor",
750
+ "vPrimaryColorShadow",
751
+ "fFovMultiplier",
752
+ "shadowLevel",
753
+ "alpha",
754
+ "vBackgroundCenter",
755
+ "vReflectionControl",
756
+ "vDiffuseInfos",
757
+ "diffuseMatrix",
758
+ "projectedGroundInfos",
759
+ "logarithmicDepthConstant",
760
+ ];
761
+ AddClipPlaneUniforms(uniforms);
762
+ const samplers = ["diffuseSampler"];
763
+ PrepareUniformsAndSamplersForIBL(uniforms, samplers, false);
764
+ const uniformBuffers = ["Material", "Scene"];
765
+ if (ImageProcessingConfiguration) {
766
+ ImageProcessingConfiguration.PrepareUniforms(uniforms, defines);
767
+ ImageProcessingConfiguration.PrepareSamplers(samplers, defines);
768
+ }
769
+ PrepareUniformsAndSamplersList({
770
+ uniformsNames: uniforms,
771
+ uniformBuffersNames: uniformBuffers,
772
+ samplers: samplers,
773
+ defines: defines,
774
+ maxSimultaneousLights: this._maxSimultaneousLights,
775
+ shaderLanguage: this._shaderLanguage,
776
+ });
777
+ const join = defines.toString();
778
+ const effect = scene.getEngine().createEffect("background", {
779
+ attributes: attribs,
780
+ uniformsNames: uniforms,
781
+ uniformBuffersNames: uniformBuffers,
782
+ samplers: samplers,
783
+ defines: join,
784
+ fallbacks: fallbacks,
785
+ onCompiled: this.onCompiled,
786
+ onError: this.onError,
787
+ indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights },
788
+ shaderLanguage: this._shaderLanguage,
789
+ extraInitializationsAsync: this._shadersLoaded
790
+ ? undefined
791
+ : async () => {
792
+ if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
793
+ await Promise.all([import("../../ShadersWGSL/background.vertex.js"), import("../../ShadersWGSL/background.fragment.js")]);
794
+ }
795
+ else {
796
+ await Promise.all([import("../../Shaders/background.vertex.js"), import("../../Shaders/background.fragment.js")]);
797
+ }
798
+ this._shadersLoaded = true;
799
+ },
800
+ }, engine);
801
+ subMesh.setEffect(effect, defines, this._materialContext);
802
+ this.buildUniformLayout();
536
803
  }
804
+ if (!subMesh.effect || !subMesh.effect.isReady()) {
805
+ return false;
806
+ }
807
+ defines._renderId = scene.getRenderId();
808
+ drawWrapper._wasPreviouslyReady = true;
809
+ drawWrapper._wasPreviouslyUsingInstances = useInstances;
810
+ this._checkScenePerformancePriority();
811
+ return true;
537
812
  }
538
- }
539
- // Get correct effect
540
- if (defines.isDirty) {
541
- defines.markAsProcessed();
542
- scene.resetCachedMaterial();
543
- // Fallbacks
544
- const fallbacks = new EffectFallbacks();
545
- if (defines.FOG) {
546
- fallbacks.addFallback(0, "FOG");
547
- }
548
- if (defines.POINTSIZE) {
549
- fallbacks.addFallback(1, "POINTSIZE");
550
- }
551
- if (defines.MULTIVIEW) {
552
- fallbacks.addFallback(0, "MULTIVIEW");
813
+ /**
814
+ * Compute the primary color according to the chosen perceptual color.
815
+ */
816
+ _computePrimaryColorFromPerceptualColor() {
817
+ if (!this.__perceptualColor) {
818
+ return;
819
+ }
820
+ this._primaryColor.copyFrom(this.__perceptualColor);
821
+ // Revert gamma space.
822
+ this._primaryColor.toLinearSpaceToRef(this._primaryColor, this.getScene().getEngine().useExactSrgbConversions);
823
+ // Revert image processing configuration.
824
+ if (this._imageProcessingConfiguration) {
825
+ // Revert Exposure.
826
+ this._primaryColor.scaleToRef(1 / this._imageProcessingConfiguration.exposure, this._primaryColor);
827
+ }
828
+ this._computePrimaryColors();
553
829
  }
554
- HandleFallbacksForShadows(defines, fallbacks, this._maxSimultaneousLights);
555
- //Attributes
556
- const attribs = [VertexBuffer.PositionKind];
557
- if (defines.NORMAL) {
558
- attribs.push(VertexBuffer.NormalKind);
830
+ /**
831
+ * Compute the highlights and shadow colors according to their chosen levels.
832
+ */
833
+ _computePrimaryColors() {
834
+ if (this._primaryColorShadowLevel === 0 && this._primaryColorHighlightLevel === 0) {
835
+ return;
836
+ }
837
+ // Find the highlight color based on the configuration.
838
+ this._primaryColor.scaleToRef(this._primaryColorShadowLevel, this._primaryShadowColor);
839
+ this._primaryColor.subtractToRef(this._primaryShadowColor, this._primaryShadowColor);
840
+ // Find the shadow color based on the configuration.
841
+ this._white.subtractToRef(this._primaryColor, this._primaryHighlightColor);
842
+ this._primaryHighlightColor.scaleToRef(this._primaryColorHighlightLevel, this._primaryHighlightColor);
843
+ this._primaryColor.addToRef(this._primaryHighlightColor, this._primaryHighlightColor);
559
844
  }
560
- if (defines.UV1) {
561
- attribs.push(VertexBuffer.UVKind);
845
+ /**
846
+ * Build the uniform buffer used in the material.
847
+ */
848
+ buildUniformLayout() {
849
+ // Order is important !
850
+ this._uniformBuffer.addUniform("vPrimaryColor", 4);
851
+ this._uniformBuffer.addUniform("vPrimaryColorShadow", 4);
852
+ this._uniformBuffer.addUniform("vDiffuseInfos", 2);
853
+ this._uniformBuffer.addUniform("diffuseMatrix", 16);
854
+ this._uniformBuffer.addUniform("fFovMultiplier", 1);
855
+ this._uniformBuffer.addUniform("pointSize", 1);
856
+ this._uniformBuffer.addUniform("shadowLevel", 1);
857
+ this._uniformBuffer.addUniform("alpha", 1);
858
+ this._uniformBuffer.addUniform("vBackgroundCenter", 3);
859
+ this._uniformBuffer.addUniform("vReflectionControl", 4);
860
+ this._uniformBuffer.addUniform("projectedGroundInfos", 2);
861
+ PrepareUniformLayoutForIBL(this._uniformBuffer, true, false, false);
862
+ this._uniformBuffer.create();
562
863
  }
563
- if (defines.UV2) {
564
- attribs.push(VertexBuffer.UV2Kind);
864
+ /**
865
+ * Unbind the material.
866
+ */
867
+ unbind() {
868
+ if (this._diffuseTexture && this._diffuseTexture.isRenderTarget) {
869
+ this._uniformBuffer.setTexture("diffuseSampler", null);
870
+ }
871
+ if (this._reflectionTexture && this._reflectionTexture.isRenderTarget) {
872
+ this._uniformBuffer.setTexture("reflectionSampler", null);
873
+ }
874
+ super.unbind();
565
875
  }
566
- PrepareAttributesForBones(attribs, mesh, defines, fallbacks);
567
- PrepareAttributesForInstances(attribs, defines);
568
- const uniforms = [
569
- "world",
570
- "view",
571
- "viewProjection",
572
- "vEyePosition",
573
- "vLightsType",
574
- "vFogInfos",
575
- "vFogColor",
576
- "pointSize",
577
- "mBones",
578
- "vPrimaryColor",
579
- "vPrimaryColorShadow",
580
- "fFovMultiplier",
581
- "shadowLevel",
582
- "alpha",
583
- "vBackgroundCenter",
584
- "vReflectionControl",
585
- "vDiffuseInfos",
586
- "diffuseMatrix",
587
- "projectedGroundInfos",
588
- "logarithmicDepthConstant",
589
- ];
590
- AddClipPlaneUniforms(uniforms);
591
- const samplers = ["diffuseSampler"];
592
- PrepareUniformsAndSamplersForIBL(uniforms, samplers, false);
593
- const uniformBuffers = ["Material", "Scene"];
594
- if (ImageProcessingConfiguration) {
595
- ImageProcessingConfiguration.PrepareUniforms(uniforms, defines);
596
- ImageProcessingConfiguration.PrepareSamplers(samplers, defines);
876
+ /**
877
+ * Bind only the world matrix to the material.
878
+ * @param world The world matrix to bind.
879
+ */
880
+ bindOnlyWorldMatrix(world) {
881
+ this._activeEffect.setMatrix("world", world);
597
882
  }
598
- PrepareUniformsAndSamplersList({
599
- uniformsNames: uniforms,
600
- uniformBuffersNames: uniformBuffers,
601
- samplers: samplers,
602
- defines: defines,
603
- maxSimultaneousLights: this._maxSimultaneousLights,
604
- shaderLanguage: this._shaderLanguage,
605
- });
606
- const join = defines.toString();
607
- const effect = scene.getEngine().createEffect("background", {
608
- attributes: attribs,
609
- uniformsNames: uniforms,
610
- uniformBuffersNames: uniformBuffers,
611
- samplers: samplers,
612
- defines: join,
613
- fallbacks: fallbacks,
614
- onCompiled: this.onCompiled,
615
- onError: this.onError,
616
- indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights },
617
- shaderLanguage: this._shaderLanguage,
618
- extraInitializationsAsync: this._shadersLoaded
619
- ? undefined
620
- : async () => {
621
- if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
622
- await Promise.all([import("../../ShadersWGSL/background.vertex.js"), import("../../ShadersWGSL/background.fragment.js")]);
883
+ /**
884
+ * Bind the material for a dedicated submesh (every used meshes will be considered opaque).
885
+ * @param world The world matrix to bind.
886
+ * @param mesh the mesh to bind for.
887
+ * @param subMesh The submesh to bind for.
888
+ */
889
+ bindForSubMesh(world, mesh, subMesh) {
890
+ const scene = this.getScene();
891
+ const defines = subMesh.materialDefines;
892
+ if (!defines) {
893
+ return;
894
+ }
895
+ const effect = subMesh.effect;
896
+ if (!effect) {
897
+ return;
898
+ }
899
+ this._activeEffect = effect;
900
+ // Matrices
901
+ this.bindOnlyWorldMatrix(world);
902
+ // Bones
903
+ BindBonesParameters(mesh, this._activeEffect);
904
+ const mustRebind = this._mustRebind(scene, effect, subMesh, mesh.visibility);
905
+ const needToAlwaysBindUniformBuffers = scene.getEngine()._features.needToAlwaysBindUniformBuffers;
906
+ if (mustRebind) {
907
+ this._uniformBuffer.bindToEffect(effect, "Material");
908
+ this.bindViewProjection(effect);
909
+ const reflectionTexture = this._reflectionTexture;
910
+ if (!this._uniformBuffer.useUbo || !this.isFrozen || !this._uniformBuffer.isSync || subMesh._drawWrapper._forceRebindOnNextCall) {
911
+ // Texture uniforms
912
+ if (scene.texturesEnabled) {
913
+ if (this._diffuseTexture && MaterialFlags.DiffuseTextureEnabled) {
914
+ this._uniformBuffer.updateFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level);
915
+ BindTextureMatrix(this._diffuseTexture, this._uniformBuffer, "diffuse");
916
+ }
917
+ BindIBLParameters(scene, defines, this._uniformBuffer, Color3.White(), reflectionTexture, false, true, false, false, false, false, this._reflectionBlur);
918
+ }
919
+ if (this.shadowLevel > 0) {
920
+ this._uniformBuffer.updateFloat("shadowLevel", this.shadowLevel);
921
+ }
922
+ this._uniformBuffer.updateFloat("alpha", this.alpha);
923
+ // Point size
924
+ if (this.pointsCloud) {
925
+ this._uniformBuffer.updateFloat("pointSize", this.pointSize);
926
+ }
927
+ if (defines.USEHIGHLIGHTANDSHADOWCOLORS) {
928
+ this._uniformBuffer.updateColor4("vPrimaryColor", this._primaryHighlightColor, 1.0);
929
+ this._uniformBuffer.updateColor4("vPrimaryColorShadow", this._primaryShadowColor, 1.0);
623
930
  }
624
931
  else {
625
- await Promise.all([import("../../Shaders/background.vertex.js"), import("../../Shaders/background.fragment.js")]);
932
+ this._uniformBuffer.updateColor4("vPrimaryColor", this._primaryColor, 1.0);
626
933
  }
627
- this._shadersLoaded = true;
628
- },
629
- }, engine);
630
- subMesh.setEffect(effect, defines, this._materialContext);
631
- this.buildUniformLayout();
632
- }
633
- if (!subMesh.effect || !subMesh.effect.isReady()) {
634
- return false;
635
- }
636
- defines._renderId = scene.getRenderId();
637
- drawWrapper._wasPreviouslyReady = true;
638
- drawWrapper._wasPreviouslyUsingInstances = useInstances;
639
- this._checkScenePerformancePriority();
640
- return true;
641
- }
642
- /**
643
- * Compute the primary color according to the chosen perceptual color.
644
- */
645
- _computePrimaryColorFromPerceptualColor() {
646
- if (!this.__perceptualColor) {
647
- return;
648
- }
649
- this._primaryColor.copyFrom(this.__perceptualColor);
650
- // Revert gamma space.
651
- this._primaryColor.toLinearSpaceToRef(this._primaryColor, this.getScene().getEngine().useExactSrgbConversions);
652
- // Revert image processing configuration.
653
- if (this._imageProcessingConfiguration) {
654
- // Revert Exposure.
655
- this._primaryColor.scaleToRef(1 / this._imageProcessingConfiguration.exposure, this._primaryColor);
656
- }
657
- this._computePrimaryColors();
658
- }
659
- /**
660
- * Compute the highlights and shadow colors according to their chosen levels.
661
- */
662
- _computePrimaryColors() {
663
- if (this._primaryColorShadowLevel === 0 && this._primaryColorHighlightLevel === 0) {
664
- return;
665
- }
666
- // Find the highlight color based on the configuration.
667
- this._primaryColor.scaleToRef(this._primaryColorShadowLevel, this._primaryShadowColor);
668
- this._primaryColor.subtractToRef(this._primaryShadowColor, this._primaryShadowColor);
669
- // Find the shadow color based on the configuration.
670
- this._white.subtractToRef(this._primaryColor, this._primaryHighlightColor);
671
- this._primaryHighlightColor.scaleToRef(this._primaryColorHighlightLevel, this._primaryHighlightColor);
672
- this._primaryColor.addToRef(this._primaryHighlightColor, this._primaryHighlightColor);
673
- }
674
- /**
675
- * Build the uniform buffer used in the material.
676
- */
677
- buildUniformLayout() {
678
- // Order is important !
679
- this._uniformBuffer.addUniform("vPrimaryColor", 4);
680
- this._uniformBuffer.addUniform("vPrimaryColorShadow", 4);
681
- this._uniformBuffer.addUniform("vDiffuseInfos", 2);
682
- this._uniformBuffer.addUniform("diffuseMatrix", 16);
683
- this._uniformBuffer.addUniform("fFovMultiplier", 1);
684
- this._uniformBuffer.addUniform("pointSize", 1);
685
- this._uniformBuffer.addUniform("shadowLevel", 1);
686
- this._uniformBuffer.addUniform("alpha", 1);
687
- this._uniformBuffer.addUniform("vBackgroundCenter", 3);
688
- this._uniformBuffer.addUniform("vReflectionControl", 4);
689
- this._uniformBuffer.addUniform("projectedGroundInfos", 2);
690
- PrepareUniformLayoutForIBL(this._uniformBuffer, true, false, false);
691
- this._uniformBuffer.create();
692
- }
693
- /**
694
- * Unbind the material.
695
- */
696
- unbind() {
697
- if (this._diffuseTexture && this._diffuseTexture.isRenderTarget) {
698
- this._uniformBuffer.setTexture("diffuseSampler", null);
699
- }
700
- if (this._reflectionTexture && this._reflectionTexture.isRenderTarget) {
701
- this._uniformBuffer.setTexture("reflectionSampler", null);
702
- }
703
- super.unbind();
704
- }
705
- /**
706
- * Bind only the world matrix to the material.
707
- * @param world The world matrix to bind.
708
- */
709
- bindOnlyWorldMatrix(world) {
710
- this._activeEffect.setMatrix("world", world);
711
- }
712
- /**
713
- * Bind the material for a dedicated submesh (every used meshes will be considered opaque).
714
- * @param world The world matrix to bind.
715
- * @param mesh the mesh to bind for.
716
- * @param subMesh The submesh to bind for.
717
- */
718
- bindForSubMesh(world, mesh, subMesh) {
719
- const scene = this.getScene();
720
- const defines = subMesh.materialDefines;
721
- if (!defines) {
722
- return;
723
- }
724
- const effect = subMesh.effect;
725
- if (!effect) {
726
- return;
727
- }
728
- this._activeEffect = effect;
729
- // Matrices
730
- this.bindOnlyWorldMatrix(world);
731
- // Bones
732
- BindBonesParameters(mesh, this._activeEffect);
733
- const mustRebind = this._mustRebind(scene, effect, subMesh, mesh.visibility);
734
- const needToAlwaysBindUniformBuffers = scene.getEngine()._features.needToAlwaysBindUniformBuffers;
735
- if (mustRebind) {
736
- this._uniformBuffer.bindToEffect(effect, "Material");
737
- this.bindViewProjection(effect);
738
- const reflectionTexture = this._reflectionTexture;
739
- if (!this._uniformBuffer.useUbo || !this.isFrozen || !this._uniformBuffer.isSync || subMesh._drawWrapper._forceRebindOnNextCall) {
740
- // Texture uniforms
741
- if (scene.texturesEnabled) {
742
- if (this._diffuseTexture && MaterialFlags.DiffuseTextureEnabled) {
743
- this._uniformBuffer.updateFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level);
744
- BindTextureMatrix(this._diffuseTexture, this._uniformBuffer, "diffuse");
745
934
  }
746
- BindIBLParameters(scene, defines, this._uniformBuffer, Color3.White(), reflectionTexture, false, true, false, false, false, false, this._reflectionBlur);
747
- }
748
- if (this.shadowLevel > 0) {
749
- this._uniformBuffer.updateFloat("shadowLevel", this.shadowLevel);
935
+ this._uniformBuffer.updateFloat("fFovMultiplier", this._fovMultiplier);
936
+ // Fresnel
937
+ if (defines.REFLECTIONFRESNEL) {
938
+ this._uniformBuffer.updateFloat4("vReflectionControl", this._reflectionControls.x, this._reflectionControls.y, this._reflectionControls.z, this._reflectionControls.w);
939
+ }
940
+ if ((defines.REFLECTIONFRESNEL && defines.REFLECTIONFALLOFF) || defines.OPACITYFRESNEL) {
941
+ const center = TmpVectors.Vector3[0].copyFrom(this.sceneCenter).subtractInPlace(scene.floatingOriginOffset);
942
+ this._uniformBuffer.updateFloat3("vBackgroundCenter", center.x, center.y, center.z);
943
+ }
944
+ // Textures
945
+ if (scene.texturesEnabled) {
946
+ if (this._diffuseTexture && MaterialFlags.DiffuseTextureEnabled) {
947
+ this._uniformBuffer.setTexture("diffuseSampler", this._diffuseTexture);
948
+ }
949
+ if (reflectionTexture && MaterialFlags.ReflectionTextureEnabled) {
950
+ BindIBLSamplers(scene, defines, this._uniformBuffer, reflectionTexture);
951
+ }
952
+ if (defines.PROJECTED_GROUND) {
953
+ this._uniformBuffer.updateFloat2("projectedGroundInfos", this.projectedGroundRadius, this.projectedGroundHeight);
954
+ }
955
+ }
956
+ // Clip plane
957
+ BindClipPlane(this._activeEffect, this, scene);
958
+ scene.bindEyePosition(effect);
750
959
  }
751
- this._uniformBuffer.updateFloat("alpha", this.alpha);
752
- // Point size
753
- if (this.pointsCloud) {
754
- this._uniformBuffer.updateFloat("pointSize", this.pointSize);
960
+ else if (needToAlwaysBindUniformBuffers) {
961
+ this._uniformBuffer.bindToEffect(effect, "Material");
962
+ this._needToBindSceneUbo = true;
755
963
  }
756
- if (defines.USEHIGHLIGHTANDSHADOWCOLORS) {
757
- this._uniformBuffer.updateColor4("vPrimaryColor", this._primaryHighlightColor, 1.0);
758
- this._uniformBuffer.updateColor4("vPrimaryColorShadow", this._primaryShadowColor, 1.0);
964
+ if ((mustRebind || !this.isFrozen || needToAlwaysBindUniformBuffers) && scene.lightsEnabled) {
965
+ BindLights(scene, mesh, this._activeEffect, defines, this._maxSimultaneousLights);
759
966
  }
760
- else {
761
- this._uniformBuffer.updateColor4("vPrimaryColor", this._primaryColor, 1.0);
967
+ if (mustRebind || !this.isFrozen) {
968
+ // View
969
+ this.bindView(effect);
970
+ // Fog
971
+ BindFogParameters(scene, mesh, this._activeEffect, true);
972
+ // Log. depth
973
+ if (this._useLogarithmicDepth) {
974
+ BindLogDepth(defines, effect, scene);
975
+ }
976
+ // image processing
977
+ if (this._imageProcessingConfiguration) {
978
+ this._imageProcessingConfiguration.bind(this._activeEffect);
979
+ }
762
980
  }
981
+ this._afterBind(mesh, this._activeEffect, subMesh);
982
+ this._uniformBuffer.update();
763
983
  }
764
- this._uniformBuffer.updateFloat("fFovMultiplier", this._fovMultiplier);
765
- // Fresnel
766
- if (defines.REFLECTIONFRESNEL) {
767
- this._uniformBuffer.updateFloat4("vReflectionControl", this._reflectionControls.x, this._reflectionControls.y, this._reflectionControls.z, this._reflectionControls.w);
768
- }
769
- if ((defines.REFLECTIONFRESNEL && defines.REFLECTIONFALLOFF) || defines.OPACITYFRESNEL) {
770
- const center = TmpVectors.Vector3[0].copyFrom(this.sceneCenter).subtractInPlace(scene.floatingOriginOffset);
771
- this._uniformBuffer.updateFloat3("vBackgroundCenter", center.x, center.y, center.z);
772
- }
773
- // Textures
774
- if (scene.texturesEnabled) {
775
- if (this._diffuseTexture && MaterialFlags.DiffuseTextureEnabled) {
776
- this._uniformBuffer.setTexture("diffuseSampler", this._diffuseTexture);
984
+ /**
985
+ * Checks to see if a texture is used in the material.
986
+ * @param texture - Base texture to use.
987
+ * @returns - Boolean specifying if a texture is used in the material.
988
+ */
989
+ hasTexture(texture) {
990
+ if (super.hasTexture(texture)) {
991
+ return true;
777
992
  }
778
- if (reflectionTexture && MaterialFlags.ReflectionTextureEnabled) {
779
- BindIBLSamplers(scene, defines, this._uniformBuffer, reflectionTexture);
993
+ if (this._reflectionTexture === texture) {
994
+ return true;
780
995
  }
781
- if (defines.PROJECTED_GROUND) {
782
- this._uniformBuffer.updateFloat2("projectedGroundInfos", this.projectedGroundRadius, this.projectedGroundHeight);
996
+ if (this._diffuseTexture === texture) {
997
+ return true;
783
998
  }
999
+ return false;
784
1000
  }
785
- // Clip plane
786
- BindClipPlane(this._activeEffect, this, scene);
787
- scene.bindEyePosition(effect);
788
- }
789
- else if (needToAlwaysBindUniformBuffers) {
790
- this._uniformBuffer.bindToEffect(effect, "Material");
791
- this._needToBindSceneUbo = true;
792
- }
793
- if ((mustRebind || !this.isFrozen || needToAlwaysBindUniformBuffers) && scene.lightsEnabled) {
794
- BindLights(scene, mesh, this._activeEffect, defines, this._maxSimultaneousLights);
795
- }
796
- if (mustRebind || !this.isFrozen) {
797
- // View
798
- this.bindView(effect);
799
- // Fog
800
- BindFogParameters(scene, mesh, this._activeEffect, true);
801
- // Log. depth
802
- if (this._useLogarithmicDepth) {
803
- BindLogDepth(defines, effect, scene);
1001
+ /**
1002
+ * Dispose the material.
1003
+ * @param forceDisposeEffect Force disposal of the associated effect.
1004
+ * @param forceDisposeTextures Force disposal of the associated textures.
1005
+ */
1006
+ dispose(forceDisposeEffect = false, forceDisposeTextures = false) {
1007
+ if (forceDisposeTextures) {
1008
+ if (this.diffuseTexture) {
1009
+ this.diffuseTexture.dispose();
1010
+ }
1011
+ if (this.reflectionTexture) {
1012
+ this.reflectionTexture.dispose();
1013
+ }
1014
+ }
1015
+ this._renderTargets.dispose();
1016
+ if (this._imageProcessingConfiguration && this._imageProcessingObserver) {
1017
+ this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);
1018
+ }
1019
+ super.dispose(forceDisposeEffect);
804
1020
  }
805
- // image processing
806
- if (this._imageProcessingConfiguration) {
807
- this._imageProcessingConfiguration.bind(this._activeEffect);
1021
+ /**
1022
+ * Clones the material.
1023
+ * @param name The cloned name.
1024
+ * @returns The cloned material.
1025
+ */
1026
+ clone(name) {
1027
+ return SerializationHelper.Clone(() => new _a(name, this.getScene()), this);
808
1028
  }
809
- }
810
- this._afterBind(mesh, this._activeEffect, subMesh);
811
- this._uniformBuffer.update();
812
- }
813
- /**
814
- * Checks to see if a texture is used in the material.
815
- * @param texture - Base texture to use.
816
- * @returns - Boolean specifying if a texture is used in the material.
817
- */
818
- hasTexture(texture) {
819
- if (super.hasTexture(texture)) {
820
- return true;
821
- }
822
- if (this._reflectionTexture === texture) {
823
- return true;
824
- }
825
- if (this._diffuseTexture === texture) {
826
- return true;
827
- }
828
- return false;
829
- }
830
- /**
831
- * Dispose the material.
832
- * @param forceDisposeEffect Force disposal of the associated effect.
833
- * @param forceDisposeTextures Force disposal of the associated textures.
834
- */
835
- dispose(forceDisposeEffect = false, forceDisposeTextures = false) {
836
- if (forceDisposeTextures) {
837
- if (this.diffuseTexture) {
838
- this.diffuseTexture.dispose();
1029
+ /**
1030
+ * Serializes the current material to its JSON representation.
1031
+ * @returns The JSON representation.
1032
+ */
1033
+ serialize() {
1034
+ const serializationObject = super.serialize();
1035
+ serializationObject.customType = "BABYLON.BackgroundMaterial";
1036
+ return serializationObject;
839
1037
  }
840
- if (this.reflectionTexture) {
841
- this.reflectionTexture.dispose();
1038
+ /**
1039
+ * Gets the class name of the material
1040
+ * @returns "BackgroundMaterial"
1041
+ */
1042
+ getClassName() {
1043
+ return "BackgroundMaterial";
842
1044
  }
843
- }
844
- this._renderTargets.dispose();
845
- if (this._imageProcessingConfiguration && this._imageProcessingObserver) {
846
- this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);
847
- }
848
- super.dispose(forceDisposeEffect);
849
- }
850
- /**
851
- * Clones the material.
852
- * @param name The cloned name.
853
- * @returns The cloned material.
854
- */
855
- clone(name) {
856
- return SerializationHelper.Clone(() => new BackgroundMaterial(name, this.getScene()), this);
857
- }
858
- /**
859
- * Serializes the current material to its JSON representation.
860
- * @returns The JSON representation.
861
- */
862
- serialize() {
863
- const serializationObject = super.serialize();
864
- serializationObject.customType = "BABYLON.BackgroundMaterial";
865
- return serializationObject;
866
- }
867
- /**
868
- * Gets the class name of the material
869
- * @returns "BackgroundMaterial"
870
- */
871
- getClassName() {
872
- return "BackgroundMaterial";
873
- }
874
- /**
875
- * Parse a JSON input to create back a background material.
876
- * @param source The JSON data to parse
877
- * @param scene The scene to create the parsed material in
878
- * @param rootUrl The root url of the assets the material depends upon
879
- * @returns the instantiated BackgroundMaterial.
880
- */
881
- static Parse(source, scene, rootUrl) {
882
- return SerializationHelper.Parse(() => new BackgroundMaterial(source.name, scene), source, scene, rootUrl);
883
- }
884
- }
885
- /**
886
- * Standard reflectance value at parallel view angle.
887
- */
888
- BackgroundMaterial.StandardReflectance0 = 0.05;
889
- /**
890
- * Standard reflectance value at grazing angle.
891
- */
892
- BackgroundMaterial.StandardReflectance90 = 0.5;
893
- __decorate([
894
- serializeAsColor3()
895
- ], BackgroundMaterial.prototype, "_primaryColor", void 0);
896
- __decorate([
897
- expandToProperty("_markAllSubMeshesAsLightsDirty")
898
- ], BackgroundMaterial.prototype, "primaryColor", void 0);
899
- __decorate([
900
- serializeAsColor3()
901
- ], BackgroundMaterial.prototype, "__perceptualColor", void 0);
902
- __decorate([
903
- serialize()
904
- ], BackgroundMaterial.prototype, "_primaryColorShadowLevel", void 0);
905
- __decorate([
906
- serialize()
907
- ], BackgroundMaterial.prototype, "_primaryColorHighlightLevel", void 0);
908
- __decorate([
909
- expandToProperty("_markAllSubMeshesAsLightsDirty")
910
- ], BackgroundMaterial.prototype, "primaryColorHighlightLevel", null);
911
- __decorate([
912
- serializeAsTexture()
913
- ], BackgroundMaterial.prototype, "_reflectionTexture", void 0);
914
- __decorate([
915
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
916
- ], BackgroundMaterial.prototype, "reflectionTexture", void 0);
917
- __decorate([
918
- serialize()
919
- ], BackgroundMaterial.prototype, "_reflectionBlur", void 0);
920
- __decorate([
921
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
922
- ], BackgroundMaterial.prototype, "reflectionBlur", void 0);
923
- __decorate([
924
- serializeAsTexture()
925
- ], BackgroundMaterial.prototype, "_diffuseTexture", void 0);
926
- __decorate([
927
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
928
- ], BackgroundMaterial.prototype, "diffuseTexture", void 0);
929
- __decorate([
930
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
931
- ], BackgroundMaterial.prototype, "shadowLights", void 0);
932
- __decorate([
933
- serialize()
934
- ], BackgroundMaterial.prototype, "_shadowLevel", void 0);
935
- __decorate([
936
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
937
- ], BackgroundMaterial.prototype, "shadowLevel", void 0);
938
- __decorate([
939
- serializeAsVector3()
940
- ], BackgroundMaterial.prototype, "_sceneCenter", void 0);
941
- __decorate([
942
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
943
- ], BackgroundMaterial.prototype, "sceneCenter", void 0);
944
- __decorate([
945
- serialize()
946
- ], BackgroundMaterial.prototype, "_opacityFresnel", void 0);
947
- __decorate([
948
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
949
- ], BackgroundMaterial.prototype, "opacityFresnel", void 0);
950
- __decorate([
951
- serialize()
952
- ], BackgroundMaterial.prototype, "_reflectionFresnel", void 0);
953
- __decorate([
954
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
955
- ], BackgroundMaterial.prototype, "reflectionFresnel", void 0);
956
- __decorate([
957
- serialize()
958
- ], BackgroundMaterial.prototype, "_reflectionFalloffDistance", void 0);
959
- __decorate([
960
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
961
- ], BackgroundMaterial.prototype, "reflectionFalloffDistance", void 0);
962
- __decorate([
963
- serialize()
964
- ], BackgroundMaterial.prototype, "_reflectionAmount", void 0);
965
- __decorate([
966
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
967
- ], BackgroundMaterial.prototype, "reflectionAmount", void 0);
968
- __decorate([
969
- serialize()
970
- ], BackgroundMaterial.prototype, "_reflectionReflectance0", void 0);
971
- __decorate([
972
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
973
- ], BackgroundMaterial.prototype, "reflectionReflectance0", void 0);
974
- __decorate([
975
- serialize()
976
- ], BackgroundMaterial.prototype, "_reflectionReflectance90", void 0);
977
- __decorate([
978
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
979
- ], BackgroundMaterial.prototype, "reflectionReflectance90", void 0);
980
- __decorate([
981
- serialize()
982
- ], BackgroundMaterial.prototype, "_useRGBColor", void 0);
983
- __decorate([
984
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
985
- ], BackgroundMaterial.prototype, "useRGBColor", void 0);
986
- __decorate([
987
- serialize()
988
- ], BackgroundMaterial.prototype, "_enableNoise", void 0);
989
- __decorate([
990
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
991
- ], BackgroundMaterial.prototype, "enableNoise", void 0);
992
- __decorate([
993
- serialize()
994
- ], BackgroundMaterial.prototype, "_maxSimultaneousLights", void 0);
995
- __decorate([
996
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
997
- ], BackgroundMaterial.prototype, "maxSimultaneousLights", void 0);
998
- __decorate([
999
- serialize()
1000
- ], BackgroundMaterial.prototype, "_shadowOnly", void 0);
1001
- __decorate([
1002
- expandToProperty("_markAllSubMeshesAsLightsDirty")
1003
- ], BackgroundMaterial.prototype, "shadowOnly", void 0);
1004
- __decorate([
1005
- serialize(),
1006
- expandToProperty("_markAllSubMeshesAsMiscDirty")
1007
- ], BackgroundMaterial.prototype, "enableGroundProjection", void 0);
1008
- __decorate([
1009
- serialize()
1010
- ], BackgroundMaterial.prototype, "projectedGroundRadius", void 0);
1011
- __decorate([
1012
- serialize()
1013
- ], BackgroundMaterial.prototype, "projectedGroundHeight", void 0);
1045
+ /**
1046
+ * Parse a JSON input to create back a background material.
1047
+ * @param source The JSON data to parse
1048
+ * @param scene The scene to create the parsed material in
1049
+ * @param rootUrl The root url of the assets the material depends upon
1050
+ * @returns the instantiated BackgroundMaterial.
1051
+ */
1052
+ static Parse(source, scene, rootUrl) {
1053
+ return SerializationHelper.Parse(() => new _a(source.name, scene), source, scene, rootUrl);
1054
+ }
1055
+ },
1056
+ _BackgroundMaterial_primaryColor_accessor_storage = new WeakMap(),
1057
+ _BackgroundMaterial_reflectionTexture_accessor_storage = new WeakMap(),
1058
+ _BackgroundMaterial_reflectionBlur_accessor_storage = new WeakMap(),
1059
+ _BackgroundMaterial_diffuseTexture_accessor_storage = new WeakMap(),
1060
+ _BackgroundMaterial_shadowLights_accessor_storage = new WeakMap(),
1061
+ _BackgroundMaterial_shadowLevel_accessor_storage = new WeakMap(),
1062
+ _BackgroundMaterial_sceneCenter_accessor_storage = new WeakMap(),
1063
+ _BackgroundMaterial_opacityFresnel_accessor_storage = new WeakMap(),
1064
+ _BackgroundMaterial_reflectionFresnel_accessor_storage = new WeakMap(),
1065
+ _BackgroundMaterial_reflectionFalloffDistance_accessor_storage = new WeakMap(),
1066
+ _BackgroundMaterial_reflectionAmount_accessor_storage = new WeakMap(),
1067
+ _BackgroundMaterial_reflectionReflectance0_accessor_storage = new WeakMap(),
1068
+ _BackgroundMaterial_reflectionReflectance90_accessor_storage = new WeakMap(),
1069
+ _BackgroundMaterial_useRGBColor_accessor_storage = new WeakMap(),
1070
+ _BackgroundMaterial_enableNoise_accessor_storage = new WeakMap(),
1071
+ _BackgroundMaterial_maxSimultaneousLights_accessor_storage = new WeakMap(),
1072
+ _BackgroundMaterial_shadowOnly_accessor_storage = new WeakMap(),
1073
+ _BackgroundMaterial_enableGroundProjection_accessor_storage = new WeakMap(),
1074
+ (() => {
1075
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1076
+ __primaryColor_decorators = [serializeAsColor3()];
1077
+ _primaryColor_decorators = [expandToProperty("_markAllSubMeshesAsLightsDirty")];
1078
+ ___perceptualColor_decorators = [serializeAsColor3()];
1079
+ __primaryColorShadowLevel_decorators = [serialize()];
1080
+ __primaryColorHighlightLevel_decorators = [serialize()];
1081
+ __reflectionTexture_decorators = [serializeAsTexture()];
1082
+ _reflectionTexture_decorators = [expandToProperty("_markAllSubMeshesAsTexturesDirty")];
1083
+ __reflectionBlur_decorators = [serialize()];
1084
+ _reflectionBlur_decorators = [expandToProperty("_markAllSubMeshesAsTexturesDirty")];
1085
+ __diffuseTexture_decorators = [serializeAsTexture()];
1086
+ _diffuseTexture_decorators = [expandToProperty("_markAllSubMeshesAsTexturesDirty")];
1087
+ _shadowLights_decorators = [expandToProperty("_markAllSubMeshesAsTexturesDirty")];
1088
+ __shadowLevel_decorators = [serialize()];
1089
+ _shadowLevel_decorators = [expandToProperty("_markAllSubMeshesAsTexturesDirty")];
1090
+ __sceneCenter_decorators = [serializeAsVector3()];
1091
+ _sceneCenter_decorators = [expandToProperty("_markAllSubMeshesAsTexturesDirty")];
1092
+ __opacityFresnel_decorators = [serialize()];
1093
+ _opacityFresnel_decorators = [expandToProperty("_markAllSubMeshesAsTexturesDirty")];
1094
+ __reflectionFresnel_decorators = [serialize()];
1095
+ _reflectionFresnel_decorators = [expandToProperty("_markAllSubMeshesAsTexturesDirty")];
1096
+ __reflectionFalloffDistance_decorators = [serialize()];
1097
+ _reflectionFalloffDistance_decorators = [expandToProperty("_markAllSubMeshesAsTexturesDirty")];
1098
+ __reflectionAmount_decorators = [serialize()];
1099
+ _reflectionAmount_decorators = [expandToProperty("_markAllSubMeshesAsTexturesDirty")];
1100
+ __reflectionReflectance0_decorators = [serialize()];
1101
+ _reflectionReflectance0_decorators = [expandToProperty("_markAllSubMeshesAsTexturesDirty")];
1102
+ __reflectionReflectance90_decorators = [serialize()];
1103
+ _reflectionReflectance90_decorators = [expandToProperty("_markAllSubMeshesAsTexturesDirty")];
1104
+ __useRGBColor_decorators = [serialize()];
1105
+ _useRGBColor_decorators = [expandToProperty("_markAllSubMeshesAsTexturesDirty")];
1106
+ __enableNoise_decorators = [serialize()];
1107
+ _enableNoise_decorators = [expandToProperty("_markAllSubMeshesAsTexturesDirty")];
1108
+ __maxSimultaneousLights_decorators = [serialize()];
1109
+ _maxSimultaneousLights_decorators = [expandToProperty("_markAllSubMeshesAsTexturesDirty")];
1110
+ __shadowOnly_decorators = [serialize()];
1111
+ _shadowOnly_decorators = [expandToProperty("_markAllSubMeshesAsLightsDirty")];
1112
+ _enableGroundProjection_decorators = [serialize(), expandToProperty("_markAllSubMeshesAsMiscDirty")];
1113
+ _projectedGroundRadius_decorators = [serialize()];
1114
+ _projectedGroundHeight_decorators = [serialize()];
1115
+ __esDecorate(_a, null, _primaryColor_decorators, { kind: "accessor", name: "primaryColor", static: false, private: false, access: { has: obj => "primaryColor" in obj, get: obj => obj.primaryColor, set: (obj, value) => { obj.primaryColor = value; } }, metadata: _metadata }, _primaryColor_initializers, _primaryColor_extraInitializers);
1116
+ __esDecorate(_a, null, _reflectionTexture_decorators, { kind: "accessor", name: "reflectionTexture", static: false, private: false, access: { has: obj => "reflectionTexture" in obj, get: obj => obj.reflectionTexture, set: (obj, value) => { obj.reflectionTexture = value; } }, metadata: _metadata }, _reflectionTexture_initializers, _reflectionTexture_extraInitializers);
1117
+ __esDecorate(_a, null, _reflectionBlur_decorators, { kind: "accessor", name: "reflectionBlur", static: false, private: false, access: { has: obj => "reflectionBlur" in obj, get: obj => obj.reflectionBlur, set: (obj, value) => { obj.reflectionBlur = value; } }, metadata: _metadata }, _reflectionBlur_initializers, _reflectionBlur_extraInitializers);
1118
+ __esDecorate(_a, null, _diffuseTexture_decorators, { kind: "accessor", name: "diffuseTexture", static: false, private: false, access: { has: obj => "diffuseTexture" in obj, get: obj => obj.diffuseTexture, set: (obj, value) => { obj.diffuseTexture = value; } }, metadata: _metadata }, _diffuseTexture_initializers, _diffuseTexture_extraInitializers);
1119
+ __esDecorate(_a, null, _shadowLights_decorators, { kind: "accessor", name: "shadowLights", static: false, private: false, access: { has: obj => "shadowLights" in obj, get: obj => obj.shadowLights, set: (obj, value) => { obj.shadowLights = value; } }, metadata: _metadata }, _shadowLights_initializers, _shadowLights_extraInitializers);
1120
+ __esDecorate(_a, null, _shadowLevel_decorators, { kind: "accessor", name: "shadowLevel", static: false, private: false, access: { has: obj => "shadowLevel" in obj, get: obj => obj.shadowLevel, set: (obj, value) => { obj.shadowLevel = value; } }, metadata: _metadata }, _shadowLevel_initializers, _shadowLevel_extraInitializers);
1121
+ __esDecorate(_a, null, _sceneCenter_decorators, { kind: "accessor", name: "sceneCenter", static: false, private: false, access: { has: obj => "sceneCenter" in obj, get: obj => obj.sceneCenter, set: (obj, value) => { obj.sceneCenter = value; } }, metadata: _metadata }, _sceneCenter_initializers, _sceneCenter_extraInitializers);
1122
+ __esDecorate(_a, null, _opacityFresnel_decorators, { kind: "accessor", name: "opacityFresnel", static: false, private: false, access: { has: obj => "opacityFresnel" in obj, get: obj => obj.opacityFresnel, set: (obj, value) => { obj.opacityFresnel = value; } }, metadata: _metadata }, _opacityFresnel_initializers, _opacityFresnel_extraInitializers);
1123
+ __esDecorate(_a, null, _reflectionFresnel_decorators, { kind: "accessor", name: "reflectionFresnel", static: false, private: false, access: { has: obj => "reflectionFresnel" in obj, get: obj => obj.reflectionFresnel, set: (obj, value) => { obj.reflectionFresnel = value; } }, metadata: _metadata }, _reflectionFresnel_initializers, _reflectionFresnel_extraInitializers);
1124
+ __esDecorate(_a, null, _reflectionFalloffDistance_decorators, { kind: "accessor", name: "reflectionFalloffDistance", static: false, private: false, access: { has: obj => "reflectionFalloffDistance" in obj, get: obj => obj.reflectionFalloffDistance, set: (obj, value) => { obj.reflectionFalloffDistance = value; } }, metadata: _metadata }, _reflectionFalloffDistance_initializers, _reflectionFalloffDistance_extraInitializers);
1125
+ __esDecorate(_a, null, _reflectionAmount_decorators, { kind: "accessor", name: "reflectionAmount", static: false, private: false, access: { has: obj => "reflectionAmount" in obj, get: obj => obj.reflectionAmount, set: (obj, value) => { obj.reflectionAmount = value; } }, metadata: _metadata }, _reflectionAmount_initializers, _reflectionAmount_extraInitializers);
1126
+ __esDecorate(_a, null, _reflectionReflectance0_decorators, { kind: "accessor", name: "reflectionReflectance0", static: false, private: false, access: { has: obj => "reflectionReflectance0" in obj, get: obj => obj.reflectionReflectance0, set: (obj, value) => { obj.reflectionReflectance0 = value; } }, metadata: _metadata }, _reflectionReflectance0_initializers, _reflectionReflectance0_extraInitializers);
1127
+ __esDecorate(_a, null, _reflectionReflectance90_decorators, { kind: "accessor", name: "reflectionReflectance90", static: false, private: false, access: { has: obj => "reflectionReflectance90" in obj, get: obj => obj.reflectionReflectance90, set: (obj, value) => { obj.reflectionReflectance90 = value; } }, metadata: _metadata }, _reflectionReflectance90_initializers, _reflectionReflectance90_extraInitializers);
1128
+ __esDecorate(_a, null, _useRGBColor_decorators, { kind: "accessor", name: "useRGBColor", static: false, private: false, access: { has: obj => "useRGBColor" in obj, get: obj => obj.useRGBColor, set: (obj, value) => { obj.useRGBColor = value; } }, metadata: _metadata }, _useRGBColor_initializers, _useRGBColor_extraInitializers);
1129
+ __esDecorate(_a, null, _enableNoise_decorators, { kind: "accessor", name: "enableNoise", static: false, private: false, access: { has: obj => "enableNoise" in obj, get: obj => obj.enableNoise, set: (obj, value) => { obj.enableNoise = value; } }, metadata: _metadata }, _enableNoise_initializers, _enableNoise_extraInitializers);
1130
+ __esDecorate(_a, null, _maxSimultaneousLights_decorators, { kind: "accessor", name: "maxSimultaneousLights", static: false, private: false, access: { has: obj => "maxSimultaneousLights" in obj, get: obj => obj.maxSimultaneousLights, set: (obj, value) => { obj.maxSimultaneousLights = value; } }, metadata: _metadata }, _maxSimultaneousLights_initializers, _maxSimultaneousLights_extraInitializers);
1131
+ __esDecorate(_a, null, _shadowOnly_decorators, { kind: "accessor", name: "shadowOnly", static: false, private: false, access: { has: obj => "shadowOnly" in obj, get: obj => obj.shadowOnly, set: (obj, value) => { obj.shadowOnly = value; } }, metadata: _metadata }, _shadowOnly_initializers, _shadowOnly_extraInitializers);
1132
+ __esDecorate(_a, null, _enableGroundProjection_decorators, { kind: "accessor", name: "enableGroundProjection", static: false, private: false, access: { has: obj => "enableGroundProjection" in obj, get: obj => obj.enableGroundProjection, set: (obj, value) => { obj.enableGroundProjection = value; } }, metadata: _metadata }, _enableGroundProjection_initializers, _enableGroundProjection_extraInitializers);
1133
+ __esDecorate(null, null, __primaryColor_decorators, { kind: "field", name: "_primaryColor", static: false, private: false, access: { has: obj => "_primaryColor" in obj, get: obj => obj._primaryColor, set: (obj, value) => { obj._primaryColor = value; } }, metadata: _metadata }, __primaryColor_initializers, __primaryColor_extraInitializers);
1134
+ __esDecorate(null, null, ___perceptualColor_decorators, { kind: "field", name: "__perceptualColor", static: false, private: false, access: { has: obj => "__perceptualColor" in obj, get: obj => obj.__perceptualColor, set: (obj, value) => { obj.__perceptualColor = value; } }, metadata: _metadata }, ___perceptualColor_initializers, ___perceptualColor_extraInitializers);
1135
+ __esDecorate(null, null, __primaryColorShadowLevel_decorators, { kind: "field", name: "_primaryColorShadowLevel", static: false, private: false, access: { has: obj => "_primaryColorShadowLevel" in obj, get: obj => obj._primaryColorShadowLevel, set: (obj, value) => { obj._primaryColorShadowLevel = value; } }, metadata: _metadata }, __primaryColorShadowLevel_initializers, __primaryColorShadowLevel_extraInitializers);
1136
+ __esDecorate(null, null, __primaryColorHighlightLevel_decorators, { kind: "field", name: "_primaryColorHighlightLevel", static: false, private: false, access: { has: obj => "_primaryColorHighlightLevel" in obj, get: obj => obj._primaryColorHighlightLevel, set: (obj, value) => { obj._primaryColorHighlightLevel = value; } }, metadata: _metadata }, __primaryColorHighlightLevel_initializers, __primaryColorHighlightLevel_extraInitializers);
1137
+ __esDecorate(null, null, __reflectionTexture_decorators, { kind: "field", name: "_reflectionTexture", static: false, private: false, access: { has: obj => "_reflectionTexture" in obj, get: obj => obj._reflectionTexture, set: (obj, value) => { obj._reflectionTexture = value; } }, metadata: _metadata }, __reflectionTexture_initializers, __reflectionTexture_extraInitializers);
1138
+ __esDecorate(null, null, __reflectionBlur_decorators, { kind: "field", name: "_reflectionBlur", static: false, private: false, access: { has: obj => "_reflectionBlur" in obj, get: obj => obj._reflectionBlur, set: (obj, value) => { obj._reflectionBlur = value; } }, metadata: _metadata }, __reflectionBlur_initializers, __reflectionBlur_extraInitializers);
1139
+ __esDecorate(null, null, __diffuseTexture_decorators, { kind: "field", name: "_diffuseTexture", static: false, private: false, access: { has: obj => "_diffuseTexture" in obj, get: obj => obj._diffuseTexture, set: (obj, value) => { obj._diffuseTexture = value; } }, metadata: _metadata }, __diffuseTexture_initializers, __diffuseTexture_extraInitializers);
1140
+ __esDecorate(null, null, __shadowLevel_decorators, { kind: "field", name: "_shadowLevel", static: false, private: false, access: { has: obj => "_shadowLevel" in obj, get: obj => obj._shadowLevel, set: (obj, value) => { obj._shadowLevel = value; } }, metadata: _metadata }, __shadowLevel_initializers, __shadowLevel_extraInitializers);
1141
+ __esDecorate(null, null, __sceneCenter_decorators, { kind: "field", name: "_sceneCenter", static: false, private: false, access: { has: obj => "_sceneCenter" in obj, get: obj => obj._sceneCenter, set: (obj, value) => { obj._sceneCenter = value; } }, metadata: _metadata }, __sceneCenter_initializers, __sceneCenter_extraInitializers);
1142
+ __esDecorate(null, null, __opacityFresnel_decorators, { kind: "field", name: "_opacityFresnel", static: false, private: false, access: { has: obj => "_opacityFresnel" in obj, get: obj => obj._opacityFresnel, set: (obj, value) => { obj._opacityFresnel = value; } }, metadata: _metadata }, __opacityFresnel_initializers, __opacityFresnel_extraInitializers);
1143
+ __esDecorate(null, null, __reflectionFresnel_decorators, { kind: "field", name: "_reflectionFresnel", static: false, private: false, access: { has: obj => "_reflectionFresnel" in obj, get: obj => obj._reflectionFresnel, set: (obj, value) => { obj._reflectionFresnel = value; } }, metadata: _metadata }, __reflectionFresnel_initializers, __reflectionFresnel_extraInitializers);
1144
+ __esDecorate(null, null, __reflectionFalloffDistance_decorators, { kind: "field", name: "_reflectionFalloffDistance", static: false, private: false, access: { has: obj => "_reflectionFalloffDistance" in obj, get: obj => obj._reflectionFalloffDistance, set: (obj, value) => { obj._reflectionFalloffDistance = value; } }, metadata: _metadata }, __reflectionFalloffDistance_initializers, __reflectionFalloffDistance_extraInitializers);
1145
+ __esDecorate(null, null, __reflectionAmount_decorators, { kind: "field", name: "_reflectionAmount", static: false, private: false, access: { has: obj => "_reflectionAmount" in obj, get: obj => obj._reflectionAmount, set: (obj, value) => { obj._reflectionAmount = value; } }, metadata: _metadata }, __reflectionAmount_initializers, __reflectionAmount_extraInitializers);
1146
+ __esDecorate(null, null, __reflectionReflectance0_decorators, { kind: "field", name: "_reflectionReflectance0", static: false, private: false, access: { has: obj => "_reflectionReflectance0" in obj, get: obj => obj._reflectionReflectance0, set: (obj, value) => { obj._reflectionReflectance0 = value; } }, metadata: _metadata }, __reflectionReflectance0_initializers, __reflectionReflectance0_extraInitializers);
1147
+ __esDecorate(null, null, __reflectionReflectance90_decorators, { kind: "field", name: "_reflectionReflectance90", static: false, private: false, access: { has: obj => "_reflectionReflectance90" in obj, get: obj => obj._reflectionReflectance90, set: (obj, value) => { obj._reflectionReflectance90 = value; } }, metadata: _metadata }, __reflectionReflectance90_initializers, __reflectionReflectance90_extraInitializers);
1148
+ __esDecorate(null, null, __useRGBColor_decorators, { kind: "field", name: "_useRGBColor", static: false, private: false, access: { has: obj => "_useRGBColor" in obj, get: obj => obj._useRGBColor, set: (obj, value) => { obj._useRGBColor = value; } }, metadata: _metadata }, __useRGBColor_initializers, __useRGBColor_extraInitializers);
1149
+ __esDecorate(null, null, __enableNoise_decorators, { kind: "field", name: "_enableNoise", static: false, private: false, access: { has: obj => "_enableNoise" in obj, get: obj => obj._enableNoise, set: (obj, value) => { obj._enableNoise = value; } }, metadata: _metadata }, __enableNoise_initializers, __enableNoise_extraInitializers);
1150
+ __esDecorate(null, null, __maxSimultaneousLights_decorators, { kind: "field", name: "_maxSimultaneousLights", static: false, private: false, access: { has: obj => "_maxSimultaneousLights" in obj, get: obj => obj._maxSimultaneousLights, set: (obj, value) => { obj._maxSimultaneousLights = value; } }, metadata: _metadata }, __maxSimultaneousLights_initializers, __maxSimultaneousLights_extraInitializers);
1151
+ __esDecorate(null, null, __shadowOnly_decorators, { kind: "field", name: "_shadowOnly", static: false, private: false, access: { has: obj => "_shadowOnly" in obj, get: obj => obj._shadowOnly, set: (obj, value) => { obj._shadowOnly = value; } }, metadata: _metadata }, __shadowOnly_initializers, __shadowOnly_extraInitializers);
1152
+ __esDecorate(null, null, _projectedGroundRadius_decorators, { kind: "field", name: "projectedGroundRadius", static: false, private: false, access: { has: obj => "projectedGroundRadius" in obj, get: obj => obj.projectedGroundRadius, set: (obj, value) => { obj.projectedGroundRadius = value; } }, metadata: _metadata }, _projectedGroundRadius_initializers, _projectedGroundRadius_extraInitializers);
1153
+ __esDecorate(null, null, _projectedGroundHeight_decorators, { kind: "field", name: "projectedGroundHeight", static: false, private: false, access: { has: obj => "projectedGroundHeight" in obj, get: obj => obj.projectedGroundHeight, set: (obj, value) => { obj.projectedGroundHeight = value; } }, metadata: _metadata }, _projectedGroundHeight_initializers, _projectedGroundHeight_extraInitializers);
1154
+ if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1155
+ })(),
1156
+ /**
1157
+ * Standard reflectance value at parallel view angle.
1158
+ */
1159
+ _a.StandardReflectance0 = 0.05,
1160
+ /**
1161
+ * Standard reflectance value at grazing angle.
1162
+ */
1163
+ _a.StandardReflectance90 = 0.5,
1164
+ _a;
1165
+ })();
1166
+ export { BackgroundMaterial };
1014
1167
  let _Registered = false;
1015
1168
  /**
1016
1169
  * Register side effects for backgroundMaterial.
@@ -1021,6 +1174,8 @@ export function RegisterBackgroundMaterial() {
1021
1174
  return;
1022
1175
  }
1023
1176
  _Registered = true;
1177
+ // BackgroundMaterial serializes its image processing configuration, so the parser must be registered for clone/parse to work.
1178
+ RegisterImageProcessingConfiguration();
1024
1179
  RegisterClass("BABYLON.BackgroundMaterial", BackgroundMaterial);
1025
1180
  }
1026
1181
  //# sourceMappingURL=backgroundMaterial.pure.js.map