@babylonjs/core 7.43.0 → 7.44.1

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 (341) hide show
  1. package/Actions/actionEvent.d.ts +4 -4
  2. package/Buffers/bufferUtils.d.ts +8 -1
  3. package/Buffers/bufferUtils.js +15 -0
  4. package/Buffers/bufferUtils.js.map +1 -1
  5. package/Culling/Helper/boundingInfoHelper.d.ts +2 -9
  6. package/Culling/Helper/boundingInfoHelper.js +2 -9
  7. package/Culling/Helper/boundingInfoHelper.js.map +1 -1
  8. package/Debug/debugLayer.d.ts +4 -0
  9. package/Debug/debugLayer.js +9 -0
  10. package/Debug/debugLayer.js.map +1 -1
  11. package/Engines/Extensions/engine.renderTarget.js +2 -4
  12. package/Engines/Extensions/engine.renderTarget.js.map +1 -1
  13. package/Engines/WebGPU/Extensions/engine.renderTarget.js +2 -4
  14. package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
  15. package/Engines/abstractEngine.d.ts +19 -1
  16. package/Engines/abstractEngine.js +48 -9
  17. package/Engines/abstractEngine.js.map +1 -1
  18. package/Engines/engine.d.ts +6 -3
  19. package/Engines/engine.js +2 -20
  20. package/Engines/engine.js.map +1 -1
  21. package/Engines/renderTargetWrapper.js +2 -2
  22. package/Engines/renderTargetWrapper.js.map +1 -1
  23. package/Engines/thinEngine.js +1 -5
  24. package/Engines/thinEngine.js.map +1 -1
  25. package/Engines/webgpuEngine.js +1 -0
  26. package/Engines/webgpuEngine.js.map +1 -1
  27. package/FlowGraph/flowGraphConnection.d.ts +1 -1
  28. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.d.ts +16 -12
  29. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js +63 -27
  30. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js.map +1 -1
  31. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.d.ts +72 -0
  32. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js +197 -0
  33. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js.map +1 -0
  34. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.d.ts +42 -0
  35. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js +78 -0
  36. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js.map +1 -0
  37. package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.d.ts +3 -19
  38. package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js +3 -49
  39. package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js.map +1 -1
  40. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.d.ts +3 -19
  41. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js +3 -49
  42. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js.map +1 -1
  43. package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.d.ts +3 -19
  44. package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js +3 -49
  45. package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js.map +1 -1
  46. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.d.ts +2 -17
  47. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js +3 -45
  48. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js.map +1 -1
  49. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.d.ts +2 -17
  50. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js +3 -44
  51. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js.map +1 -1
  52. package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.d.ts +3 -19
  53. package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js +3 -49
  54. package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js.map +1 -1
  55. package/FrameGraph/Node/Blocks/PostProcesses/passPostProcessBlock.d.ts +47 -0
  56. package/FrameGraph/Node/Blocks/PostProcesses/passPostProcessBlock.js +65 -0
  57. package/FrameGraph/Node/Blocks/PostProcesses/passPostProcessBlock.js.map +1 -0
  58. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.d.ts +4 -0
  59. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +9 -0
  60. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
  61. package/FrameGraph/Node/Blocks/index.d.ts +2 -0
  62. package/FrameGraph/Node/Blocks/index.js +2 -0
  63. package/FrameGraph/Node/Blocks/index.js.map +1 -1
  64. package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +4 -2
  65. package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +2 -0
  66. package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -1
  67. package/FrameGraph/Node/nodeRenderGraph.d.ts +3 -2
  68. package/FrameGraph/Node/nodeRenderGraph.js +4 -3
  69. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  70. package/FrameGraph/Node/nodeRenderGraphBlock.js +4 -4
  71. package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -1
  72. package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.d.ts +8 -0
  73. package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js +10 -0
  74. package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js.map +1 -1
  75. package/FrameGraph/Node/nodeRenderGraphConnectionPointCustomObject.d.ts +21 -0
  76. package/FrameGraph/Node/nodeRenderGraphConnectionPointCustomObject.js +31 -0
  77. package/FrameGraph/Node/nodeRenderGraphConnectionPointCustomObject.js.map +1 -0
  78. package/FrameGraph/Passes/pass.d.ts +1 -0
  79. package/FrameGraph/Passes/pass.js +4 -1
  80. package/FrameGraph/Passes/pass.js.map +1 -1
  81. package/FrameGraph/Tasks/Layers/baseLayerTask.d.ts +81 -0
  82. package/FrameGraph/Tasks/Layers/baseLayerTask.js +304 -0
  83. package/FrameGraph/Tasks/Layers/baseLayerTask.js.map +1 -0
  84. package/FrameGraph/Tasks/Layers/glowLayerTask.d.ts +3 -40
  85. package/FrameGraph/Tasks/Layers/glowLayerTask.js +4 -158
  86. package/FrameGraph/Tasks/Layers/glowLayerTask.js.map +1 -1
  87. package/FrameGraph/Tasks/Layers/highlightLayerTask.d.ts +21 -0
  88. package/FrameGraph/Tasks/Layers/highlightLayerTask.js +32 -0
  89. package/FrameGraph/Tasks/Layers/highlightLayerTask.js.map +1 -0
  90. package/FrameGraph/Tasks/Misc/executeTask.d.ts +2 -2
  91. package/FrameGraph/Tasks/Misc/executeTask.js +1 -0
  92. package/FrameGraph/Tasks/Misc/executeTask.js.map +1 -1
  93. package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js +1 -1
  94. package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js.map +1 -1
  95. package/FrameGraph/Tasks/PostProcesses/bloomTask.js +1 -1
  96. package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -1
  97. package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js +5 -4
  98. package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js.map +1 -1
  99. package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js +5 -4
  100. package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js.map +1 -1
  101. package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js +2 -4
  102. package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js.map +1 -1
  103. package/FrameGraph/Tasks/PostProcesses/passTask.d.ts +29 -0
  104. package/FrameGraph/Tasks/PostProcesses/passTask.js +31 -0
  105. package/FrameGraph/Tasks/PostProcesses/passTask.js.map +1 -0
  106. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +4 -2
  107. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
  108. package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +2 -2
  109. package/FrameGraph/Tasks/Rendering/objectRendererTask.js +1 -0
  110. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
  111. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.d.ts +2 -2
  112. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js +1 -0
  113. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js.map +1 -1
  114. package/FrameGraph/Tasks/Texture/clearTextureTask.d.ts +2 -2
  115. package/FrameGraph/Tasks/Texture/clearTextureTask.js +1 -0
  116. package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
  117. package/FrameGraph/Tasks/Texture/copyToTextureTask.js +1 -1
  118. package/FrameGraph/Tasks/Texture/copyToTextureTask.js.map +1 -1
  119. package/FrameGraph/frameGraph.d.ts +8 -2
  120. package/FrameGraph/frameGraph.js +31 -5
  121. package/FrameGraph/frameGraph.js.map +1 -1
  122. package/FrameGraph/frameGraphRenderContext.d.ts +10 -0
  123. package/FrameGraph/frameGraphRenderContext.js +14 -0
  124. package/FrameGraph/frameGraphRenderContext.js.map +1 -1
  125. package/FrameGraph/frameGraphTask.d.ts +3 -2
  126. package/FrameGraph/frameGraphTask.js +12 -2
  127. package/FrameGraph/frameGraphTask.js.map +1 -1
  128. package/FrameGraph/frameGraphTextureManager.d.ts +1 -1
  129. package/FrameGraph/frameGraphTypes.d.ts +4 -0
  130. package/FrameGraph/frameGraphTypes.js.map +1 -1
  131. package/FrameGraph/index.d.ts +2 -0
  132. package/FrameGraph/index.js +2 -0
  133. package/FrameGraph/index.js.map +1 -1
  134. package/Gizmos/planeRotationGizmo.js +10 -0
  135. package/Gizmos/planeRotationGizmo.js.map +1 -1
  136. package/Helpers/environmentHelper.js +7 -6
  137. package/Helpers/environmentHelper.js.map +1 -1
  138. package/Inputs/scene.inputManager.js +2 -2
  139. package/Inputs/scene.inputManager.js.map +1 -1
  140. package/Layers/effectLayer.d.ts +1 -1
  141. package/Layers/effectLayer.js.map +1 -1
  142. package/Layers/glowLayer.d.ts +2 -14
  143. package/Layers/glowLayer.js +34 -36
  144. package/Layers/glowLayer.js.map +1 -1
  145. package/Layers/highlightLayer.d.ts +13 -74
  146. package/Layers/highlightLayer.js +123 -309
  147. package/Layers/highlightLayer.js.map +1 -1
  148. package/Layers/index.d.ts +1 -0
  149. package/Layers/index.js +1 -0
  150. package/Layers/index.js.map +1 -1
  151. package/Layers/thinEffectLayer.d.ts +55 -2
  152. package/Layers/thinEffectLayer.js +66 -0
  153. package/Layers/thinEffectLayer.js.map +1 -1
  154. package/Layers/thinGlowLayer.d.ts +3 -6
  155. package/Layers/thinGlowLayer.js +4 -1
  156. package/Layers/thinGlowLayer.js.map +1 -1
  157. package/Layers/thinHighlightLayer.d.ts +197 -0
  158. package/Layers/thinHighlightLayer.js +417 -0
  159. package/Layers/thinHighlightLayer.js.map +1 -0
  160. package/Materials/GreasedLine/greasedLinePluginMaterial.d.ts +6 -2
  161. package/Materials/GreasedLine/greasedLinePluginMaterial.js +8 -2
  162. package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
  163. package/Materials/GreasedLine/greasedLinePluginMaterialShadersWGSL.js +11 -3
  164. package/Materials/GreasedLine/greasedLinePluginMaterialShadersWGSL.js.map +1 -1
  165. package/Materials/GreasedLine/greasedLineSimpleMaterial.d.ts +1 -0
  166. package/Materials/GreasedLine/greasedLineSimpleMaterial.js +1 -0
  167. package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -1
  168. package/Materials/Node/Blocks/PBR/reflectionBlock.js +1 -3
  169. package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
  170. package/Materials/Node/Blocks/PBR/subSurfaceBlock.js +3 -3
  171. package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
  172. package/Materials/Node/nodeMaterial.d.ts +4 -2
  173. package/Materials/Node/nodeMaterial.js +9 -6
  174. package/Materials/Node/nodeMaterial.js.map +1 -1
  175. package/Materials/PBR/pbrBaseMaterial.js +1 -0
  176. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  177. package/Materials/Textures/Filtering/hdrFiltering.js +1 -0
  178. package/Materials/Textures/Filtering/hdrFiltering.js.map +1 -1
  179. package/Materials/Textures/Filtering/hdrIrradianceFiltering.d.ts +69 -0
  180. package/Materials/Textures/Filtering/hdrIrradianceFiltering.js +187 -0
  181. package/Materials/Textures/Filtering/hdrIrradianceFiltering.js.map +1 -0
  182. package/Materials/Textures/hdrCubeTexture.d.ts +5 -1
  183. package/Materials/Textures/hdrCubeTexture.js +29 -3
  184. package/Materials/Textures/hdrCubeTexture.js.map +1 -1
  185. package/Materials/Textures/index.d.ts +4 -0
  186. package/Materials/Textures/index.js +4 -0
  187. package/Materials/Textures/index.js.map +1 -1
  188. package/Materials/effect.d.ts +5 -0
  189. package/Materials/effect.js +15 -0
  190. package/Materials/effect.js.map +1 -1
  191. package/Materials/standardMaterial.d.ts +1 -2
  192. package/Materials/standardMaterial.js +0 -2
  193. package/Materials/standardMaterial.js.map +1 -1
  194. package/Meshes/Builders/planeBuilder.js +2 -2
  195. package/Meshes/Builders/planeBuilder.js.map +1 -1
  196. package/Meshes/Compression/dracoCodec.d.ts +4 -4
  197. package/Meshes/Compression/dracoCodec.js.map +1 -1
  198. package/Meshes/Compression/dracoCompression.d.ts +5 -3
  199. package/Meshes/Compression/dracoCompression.js +24 -11
  200. package/Meshes/Compression/dracoCompression.js.map +1 -1
  201. package/Meshes/Compression/dracoCompressionWorker.d.ts +16 -30
  202. package/Meshes/Compression/dracoCompressionWorker.js +128 -22
  203. package/Meshes/Compression/dracoCompressionWorker.js.map +1 -1
  204. package/Meshes/Compression/dracoDecoder.d.ts +4 -9
  205. package/Meshes/Compression/dracoDecoder.js +5 -5
  206. package/Meshes/Compression/dracoDecoder.js.map +1 -1
  207. package/Meshes/Compression/dracoDecoder.types.d.ts +52 -0
  208. package/Meshes/Compression/dracoDecoder.types.js +2 -0
  209. package/Meshes/Compression/dracoDecoder.types.js.map +1 -0
  210. package/Meshes/Compression/dracoEncoder.d.ts +95 -0
  211. package/Meshes/Compression/dracoEncoder.js +245 -0
  212. package/Meshes/Compression/dracoEncoder.js.map +1 -0
  213. package/Meshes/Compression/dracoEncoder.types.d.ts +82 -0
  214. package/Meshes/Compression/dracoEncoder.types.js +2 -0
  215. package/Meshes/Compression/dracoEncoder.types.js.map +1 -0
  216. package/Meshes/Compression/index.d.ts +1 -0
  217. package/Meshes/Compression/index.js +1 -0
  218. package/Meshes/Compression/index.js.map +1 -1
  219. package/Meshes/Compression/meshoptCompression.js +17 -2
  220. package/Meshes/Compression/meshoptCompression.js.map +1 -1
  221. package/Meshes/Compression/test/integration/draco.test.d.ts +1 -0
  222. package/Meshes/Compression/test/integration/draco.test.js +30 -0
  223. package/Meshes/Compression/test/integration/draco.test.js.map +1 -0
  224. package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +92 -2
  225. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +286 -10
  226. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  227. package/Meshes/GreasedLine/greasedLineBaseMesh.js +4 -2
  228. package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
  229. package/Meshes/GreasedLine/greasedLineRibbonMesh.js +1 -1
  230. package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
  231. package/Meshes/Node/Blocks/Textures/geometryTextureBlock.d.ts +1 -1
  232. package/Meshes/csg.js +4 -0
  233. package/Meshes/csg.js.map +1 -1
  234. package/Meshes/mesh.d.ts +2 -2
  235. package/Meshes/transformNode.d.ts +4 -1
  236. package/Meshes/transformNode.js +6 -1
  237. package/Meshes/transformNode.js.map +1 -1
  238. package/Misc/copyTextureToTexture.js +1 -1
  239. package/Misc/copyTextureToTexture.js.map +1 -1
  240. package/Misc/decorators.serialization.js +2 -0
  241. package/Misc/decorators.serialization.js.map +1 -1
  242. package/Misc/greasedLineTools.d.ts +1 -1
  243. package/Misc/logger.d.ts +2 -1
  244. package/Misc/logger.js +2 -1
  245. package/Misc/logger.js.map +1 -1
  246. package/Misc/screenshotTools.js +58 -5
  247. package/Misc/screenshotTools.js.map +1 -1
  248. package/Misc/tools.d.ts +21 -1
  249. package/Misc/tools.js +33 -0
  250. package/Misc/tools.js.map +1 -1
  251. package/Morph/morphTargetManager.d.ts +1 -0
  252. package/Morph/morphTargetManager.js +6 -1
  253. package/Morph/morphTargetManager.js.map +1 -1
  254. package/Particles/particleHelper.js +2 -1
  255. package/Particles/particleHelper.js.map +1 -1
  256. package/Particles/particleSystemSet.d.ts +1 -0
  257. package/Particles/particleSystemSet.js +1 -0
  258. package/Particles/particleSystemSet.js.map +1 -1
  259. package/Particles/pointsCloudSystem.d.ts +3 -3
  260. package/Particles/webgl2ParticleSystem.d.ts +1 -1
  261. package/Particles/webgl2ParticleSystem.js +1 -2
  262. package/Particles/webgl2ParticleSystem.js.map +1 -1
  263. package/Physics/v2/Plugins/havokPlugin.d.ts +2 -2
  264. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +2 -1
  265. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
  266. package/PostProcesses/index.d.ts +1 -0
  267. package/PostProcesses/index.js +1 -0
  268. package/PostProcesses/index.js.map +1 -1
  269. package/PostProcesses/passPostProcess.d.ts +2 -3
  270. package/PostProcesses/passPostProcess.js +36 -48
  271. package/PostProcesses/passPostProcess.js.map +1 -1
  272. package/PostProcesses/thinPassPostProcess.d.ts +48 -0
  273. package/PostProcesses/thinPassPostProcess.js +113 -0
  274. package/PostProcesses/thinPassPostProcess.js.map +1 -0
  275. package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js +1 -1
  276. package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js.map +1 -1
  277. package/Rendering/depthRenderer.js +1 -1
  278. package/Rendering/depthRenderer.js.map +1 -1
  279. package/Rendering/iblCdfGenerator.d.ts +13 -5
  280. package/Rendering/iblCdfGenerator.js +67 -10
  281. package/Rendering/iblCdfGenerator.js.map +1 -1
  282. package/Rendering/objectRenderer.d.ts +5 -3
  283. package/Rendering/objectRenderer.js +5 -3
  284. package/Rendering/objectRenderer.js.map +1 -1
  285. package/Rendering/renderingManager.d.ts +4 -0
  286. package/Rendering/renderingManager.js +1 -0
  287. package/Rendering/renderingManager.js.map +1 -1
  288. package/Shaders/ShadersInclude/gaussianSplatting.js +6 -6
  289. package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
  290. package/Shaders/ShadersInclude/intersectionFunctions.d.ts +5 -0
  291. package/Shaders/ShadersInclude/intersectionFunctions.js +14 -0
  292. package/Shaders/ShadersInclude/intersectionFunctions.js.map +1 -0
  293. package/Shaders/ShadersInclude/pbrBlockReflection.js +13 -8
  294. package/Shaders/ShadersInclude/pbrBlockReflection.js.map +1 -1
  295. package/Shaders/background.fragment.d.ts +1 -0
  296. package/Shaders/background.fragment.js +3 -5
  297. package/Shaders/background.fragment.js.map +1 -1
  298. package/Shaders/gaussianSplatting.vertex.js +2 -1
  299. package/Shaders/gaussianSplatting.vertex.js.map +1 -1
  300. package/Shaders/hdrIrradianceFiltering.fragment.d.ts +9 -0
  301. package/Shaders/hdrIrradianceFiltering.fragment.js +25 -0
  302. package/Shaders/hdrIrradianceFiltering.fragment.js.map +1 -0
  303. package/Shaders/hdrIrradianceFiltering.vertex.d.ts +5 -0
  304. package/Shaders/hdrIrradianceFiltering.vertex.js +15 -0
  305. package/Shaders/hdrIrradianceFiltering.vertex.js.map +1 -0
  306. package/Shaders/pbr.fragment.js +1 -3
  307. package/Shaders/pbr.fragment.js.map +1 -1
  308. package/ShadersWGSL/ShadersInclude/intersectionFunctions.d.ts +5 -0
  309. package/ShadersWGSL/ShadersInclude/intersectionFunctions.js +14 -0
  310. package/ShadersWGSL/ShadersInclude/intersectionFunctions.js.map +1 -0
  311. package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js +13 -8
  312. package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js.map +1 -1
  313. package/ShadersWGSL/background.fragment.d.ts +1 -0
  314. package/ShadersWGSL/background.fragment.js +3 -5
  315. package/ShadersWGSL/background.fragment.js.map +1 -1
  316. package/ShadersWGSL/greasedLine.fragment.js +9 -3
  317. package/ShadersWGSL/greasedLine.fragment.js.map +1 -1
  318. package/ShadersWGSL/greasedLine.vertex.js +12 -2
  319. package/ShadersWGSL/greasedLine.vertex.js.map +1 -1
  320. package/ShadersWGSL/hdrIrradianceFiltering.fragment.d.ts +9 -0
  321. package/ShadersWGSL/hdrIrradianceFiltering.fragment.js +26 -0
  322. package/ShadersWGSL/hdrIrradianceFiltering.fragment.js.map +1 -0
  323. package/ShadersWGSL/hdrIrradianceFiltering.vertex.d.ts +5 -0
  324. package/ShadersWGSL/hdrIrradianceFiltering.vertex.js +16 -0
  325. package/ShadersWGSL/hdrIrradianceFiltering.vertex.js.map +1 -0
  326. package/ShadersWGSL/outline.fragment.js +1 -1
  327. package/ShadersWGSL/outline.fragment.js.map +1 -1
  328. package/ShadersWGSL/passCube.fragment.js +1 -1
  329. package/ShadersWGSL/passCube.fragment.js.map +1 -1
  330. package/ShadersWGSL/pbr.fragment.js +1 -3
  331. package/ShadersWGSL/pbr.fragment.js.map +1 -1
  332. package/XR/features/WebXRDepthSensing.d.ts +24 -2
  333. package/XR/features/WebXRDepthSensing.js +320 -26
  334. package/XR/features/WebXRDepthSensing.js.map +1 -1
  335. package/XR/features/WebXRHandTracking.js +8 -7
  336. package/XR/features/WebXRHandTracking.js.map +1 -1
  337. package/package.json +1 -1
  338. package/scene.js +9 -5
  339. package/scene.js.map +1 -1
  340. package/types.d.ts +4 -0
  341. package/types.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"environmentH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IAAI,IAAI,CAAC,QAAQ,CAAC,aAAa,YAAY,WAAW,EAAE,CAAC;YACrD,IAAI,CAAC,eAAe,CAAC,iBAAiB,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC;YACrE,OAAO;QACX,CAAC;QAED,IAAI,CAAC,cAAc,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QAChJ,IAAI,CAAC,cAAc,CAAC,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;QAC1D,IAAI,CAAC,cAAc,CAAC,UAAU,GAAG,KAAK,CAAC;QACvC,IAAI,CAAC,eAAe,CAAC,iBAAiB,GAAG,IAAI,CAAC,cAAc,CAAC;IACjE,CAAC;IAMD;;OAEG;IACI,OAAO;QACV,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC7C,CAAC;QACD,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC7C,CAAC;QACD,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;;AAzgBD;;GAEG;AACY,sCAAoB,GAAG,gEAAgE,AAAnE,CAAoE;AAEvG;;GAEG;AACY,sCAAoB,GAAG,gEAAgE,AAAnE,CAAoE;AAEvG;;GAEG;AACY,2CAAyB,GAAG,mEAAmE,AAAtE,CAAuE","sourcesContent":["import { Observable } from \"../Misc/observable\";\r\nimport type { Nullable } from \"../types\";\r\nimport { ArcRotateCamera } from \"../Cameras/arcRotateCamera\";\r\nimport type { Scene } from \"../scene\";\r\nimport { Vector3 } from \"../Maths/math.vector\";\r\nimport { Color3, Color4 } from \"../Maths/math.color\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport { Mesh } from \"../Meshes/mesh\";\r\nimport { BaseTexture } from \"../Materials/Textures/baseTexture\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport { MirrorTexture } from \"../Materials/Textures/mirrorTexture\";\r\nimport { CubeTexture } from \"../Materials/Textures/cubeTexture\";\r\nimport { BackgroundMaterial } from \"../Materials/Background/backgroundMaterial\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport { CreatePlane } from \"../Meshes/Builders/planeBuilder\";\r\nimport { CreateBox } from \"../Meshes/Builders/boxBuilder\";\r\nimport { Plane } from \"../Maths/math.plane\";\r\n\r\n/**\r\n * Represents the different options available during the creation of\r\n * a Environment helper.\r\n *\r\n * This can control the default ground, skybox and image processing setup of your scene.\r\n */\r\nexport interface IEnvironmentHelperOptions {\r\n /**\r\n * Specifies whether or not to create a ground.\r\n * True by default.\r\n */\r\n createGround: boolean;\r\n /**\r\n * Specifies the ground size.\r\n * 15 by default.\r\n */\r\n groundSize: number;\r\n /**\r\n * The texture used on the ground for the main color.\r\n * Comes from the BabylonJS CDN by default.\r\n *\r\n * Remarks: Can be either a texture or a url.\r\n */\r\n groundTexture: string | BaseTexture;\r\n /**\r\n * The color mixed in the ground texture by default.\r\n * BabylonJS clearColor by default.\r\n */\r\n groundColor: Color3;\r\n /**\r\n * Specifies the ground opacity.\r\n * 1 by default.\r\n */\r\n groundOpacity: number;\r\n /**\r\n * Enables the ground to receive shadows.\r\n * True by default.\r\n */\r\n enableGroundShadow: boolean;\r\n /**\r\n * Helps preventing the shadow to be fully black on the ground.\r\n * 0.5 by default.\r\n */\r\n groundShadowLevel: number;\r\n /**\r\n * Creates a mirror texture attach to the ground.\r\n * false by default.\r\n */\r\n enableGroundMirror: boolean;\r\n /**\r\n * Specifies the ground mirror size ratio.\r\n * 0.3 by default as the default kernel is 64.\r\n */\r\n groundMirrorSizeRatio: number;\r\n /**\r\n * Specifies the ground mirror blur kernel size.\r\n * 64 by default.\r\n */\r\n groundMirrorBlurKernel: number;\r\n /**\r\n * Specifies the ground mirror visibility amount.\r\n * 1 by default\r\n */\r\n groundMirrorAmount: number;\r\n /**\r\n * Specifies the ground mirror reflectance weight.\r\n * This uses the standard weight of the background material to setup the fresnel effect\r\n * of the mirror.\r\n * 1 by default.\r\n */\r\n groundMirrorFresnelWeight: number;\r\n /**\r\n * Specifies the ground mirror Falloff distance.\r\n * This can helps reducing the size of the reflection.\r\n * 0 by Default.\r\n */\r\n groundMirrorFallOffDistance: number;\r\n /**\r\n * Specifies the ground mirror texture type.\r\n * Unsigned Int by Default.\r\n */\r\n groundMirrorTextureType: number;\r\n /**\r\n * Specifies a bias applied to the ground vertical position to prevent z-fighting with\r\n * the shown objects.\r\n */\r\n groundYBias: number;\r\n\r\n /**\r\n * Specifies whether or not to create a skybox.\r\n * True by default.\r\n */\r\n createSkybox: boolean;\r\n /**\r\n * Specifies the skybox size.\r\n * 20 by default.\r\n */\r\n skyboxSize: number;\r\n /**\r\n * The texture used on the skybox for the main color.\r\n * Comes from the BabylonJS CDN by default.\r\n *\r\n * Remarks: Can be either a texture or a url.\r\n */\r\n skyboxTexture: string | BaseTexture;\r\n /**\r\n * The color mixed in the skybox texture by default.\r\n * BabylonJS clearColor by default.\r\n */\r\n skyboxColor: Color3;\r\n\r\n /**\r\n * The background rotation around the Y axis of the scene.\r\n * This helps aligning the key lights of your scene with the background.\r\n * 0 by default.\r\n */\r\n backgroundYRotation: number;\r\n\r\n /**\r\n * Compute automatically the size of the elements to best fit with the scene.\r\n */\r\n sizeAuto: boolean;\r\n\r\n /**\r\n * Default position of the rootMesh if autoSize is not true.\r\n */\r\n rootPosition: Vector3;\r\n\r\n /**\r\n * Sets up the image processing in the scene.\r\n * true by default.\r\n */\r\n setupImageProcessing: boolean;\r\n\r\n /**\r\n * The texture used as your environment texture in the scene.\r\n * Comes from the BabylonJS CDN by default and in use if setupImageProcessing is true.\r\n *\r\n * Remarks: Can be either a texture or a url.\r\n */\r\n environmentTexture: string | BaseTexture;\r\n\r\n /**\r\n * The value of the exposure to apply to the scene.\r\n * 0.6 by default if setupImageProcessing is true.\r\n */\r\n cameraExposure: number;\r\n\r\n /**\r\n * The value of the contrast to apply to the scene.\r\n * 1.6 by default if setupImageProcessing is true.\r\n */\r\n cameraContrast: number;\r\n\r\n /**\r\n * Specifies whether or not tonemapping should be enabled in the scene.\r\n * true by default if setupImageProcessing is true.\r\n */\r\n toneMappingEnabled: boolean;\r\n}\r\n\r\ninterface ISceneSize {\r\n groundSize: number;\r\n skyboxSize: number;\r\n rootPosition: Vector3;\r\n}\r\n\r\n/**\r\n * The EnvironmentHelper class can be used to add a fully featured non-expensive background to your scene.\r\n * It includes by default a skybox and a ground relying on the BackgroundMaterial.\r\n * It also helps with the default setup of your ImageProcessingConfiguration.\r\n */\r\nexport class EnvironmentHelper {\r\n /**\r\n * Default ground texture URL.\r\n */\r\n private static _GroundTextureCDNUrl = \"https://assets.babylonjs.com/environments/backgroundGround.png\";\r\n\r\n /**\r\n * Default skybox texture URL.\r\n */\r\n private static _SkyboxTextureCDNUrl = \"https://assets.babylonjs.com/environments/backgroundSkybox.dds\";\r\n\r\n /**\r\n * Default environment texture URL.\r\n */\r\n private static _EnvironmentTextureCDNUrl = \"https://assets.babylonjs.com/environments/environmentSpecular.env\";\r\n\r\n /**\r\n * Creates the default options for the helper.\r\n * @param scene The scene the environment helper belongs to.\r\n * @returns default options for the helper.\r\n */\r\n private static _GetDefaultOptions(scene: Scene): IEnvironmentHelperOptions {\r\n return {\r\n createGround: true,\r\n groundSize: 15,\r\n groundTexture: this._GroundTextureCDNUrl,\r\n groundColor: new Color3(0.2, 0.2, 0.3).toLinearSpace(scene.getEngine().useExactSrgbConversions).scale(3),\r\n groundOpacity: 0.9,\r\n enableGroundShadow: true,\r\n groundShadowLevel: 0.5,\r\n\r\n enableGroundMirror: false,\r\n groundMirrorSizeRatio: 0.3,\r\n groundMirrorBlurKernel: 64,\r\n groundMirrorAmount: 1,\r\n groundMirrorFresnelWeight: 1,\r\n groundMirrorFallOffDistance: 0,\r\n groundMirrorTextureType: Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n\r\n groundYBias: 0.00001,\r\n\r\n createSkybox: true,\r\n skyboxSize: 20,\r\n skyboxTexture: this._SkyboxTextureCDNUrl,\r\n skyboxColor: new Color3(0.2, 0.2, 0.3).toLinearSpace(scene.getEngine().useExactSrgbConversions).scale(3),\r\n\r\n backgroundYRotation: 0,\r\n sizeAuto: true,\r\n rootPosition: Vector3.Zero(),\r\n\r\n setupImageProcessing: true,\r\n environmentTexture: this._EnvironmentTextureCDNUrl,\r\n cameraExposure: 0.8,\r\n cameraContrast: 1.2,\r\n toneMappingEnabled: true,\r\n };\r\n }\r\n\r\n private _rootMesh: Mesh;\r\n /**\r\n * Gets the root mesh created by the helper.\r\n */\r\n public get rootMesh(): Mesh {\r\n return this._rootMesh;\r\n }\r\n\r\n private _skybox: Nullable<Mesh>;\r\n /**\r\n * Gets the skybox created by the helper.\r\n */\r\n public get skybox(): Nullable<Mesh> {\r\n return this._skybox;\r\n }\r\n\r\n private _skyboxTexture: Nullable<BaseTexture>;\r\n /**\r\n * Gets the skybox texture created by the helper.\r\n */\r\n public get skyboxTexture(): Nullable<BaseTexture> {\r\n return this._skyboxTexture;\r\n }\r\n\r\n private _skyboxMaterial: Nullable<BackgroundMaterial>;\r\n /**\r\n * Gets the skybox material created by the helper.\r\n */\r\n public get skyboxMaterial(): Nullable<BackgroundMaterial> {\r\n return this._skyboxMaterial;\r\n }\r\n\r\n private _ground: Nullable<Mesh>;\r\n /**\r\n * Gets the ground mesh created by the helper.\r\n */\r\n public get ground(): Nullable<Mesh> {\r\n return this._ground;\r\n }\r\n\r\n private _groundTexture: Nullable<BaseTexture>;\r\n /**\r\n * Gets the ground texture created by the helper.\r\n */\r\n public get groundTexture(): Nullable<BaseTexture> {\r\n return this._groundTexture;\r\n }\r\n\r\n private _groundMirror: Nullable<MirrorTexture>;\r\n /**\r\n * Gets the ground mirror created by the helper.\r\n */\r\n public get groundMirror(): Nullable<MirrorTexture> {\r\n return this._groundMirror;\r\n }\r\n\r\n /**\r\n * Gets the ground mirror render list to helps pushing the meshes\r\n * you wish in the ground reflection.\r\n */\r\n public get groundMirrorRenderList(): Nullable<AbstractMesh[]> {\r\n if (this._groundMirror) {\r\n return this._groundMirror.renderList;\r\n }\r\n return null;\r\n }\r\n\r\n private _groundMaterial: Nullable<BackgroundMaterial>;\r\n /**\r\n * Gets the ground material created by the helper.\r\n */\r\n public get groundMaterial(): Nullable<BackgroundMaterial> {\r\n return this._groundMaterial;\r\n }\r\n\r\n /**\r\n * Stores the creation options.\r\n */\r\n private readonly _scene: Scene;\r\n private _options: IEnvironmentHelperOptions;\r\n\r\n /**\r\n * This observable will be notified with any error during the creation of the environment,\r\n * mainly texture creation errors.\r\n */\r\n public onErrorObservable: Observable<{ message?: string; exception?: any }>;\r\n\r\n /**\r\n * constructor\r\n * @param options Defines the options we want to customize the helper\r\n * @param scene The scene to add the material to\r\n */\r\n constructor(options: Partial<IEnvironmentHelperOptions>, scene: Scene) {\r\n this._options = {\r\n ...EnvironmentHelper._GetDefaultOptions(scene),\r\n ...options,\r\n };\r\n this._scene = scene;\r\n this.onErrorObservable = new Observable();\r\n\r\n this._setupBackground();\r\n this._setupImageProcessing();\r\n }\r\n\r\n /**\r\n * Updates the environment according to the new options\r\n * @param options options to configure the helper (IEnvironmentHelperOptions)\r\n */\r\n public updateOptions(options: Partial<IEnvironmentHelperOptions>) {\r\n const newOptions = {\r\n ...this._options,\r\n ...options,\r\n };\r\n\r\n if (this._ground && !newOptions.createGround) {\r\n this._ground.dispose();\r\n this._ground = null;\r\n }\r\n\r\n if (this._groundMaterial && !newOptions.createGround) {\r\n this._groundMaterial.dispose();\r\n this._groundMaterial = null;\r\n }\r\n\r\n if (this._groundTexture) {\r\n if (this._options.groundTexture != newOptions.groundTexture) {\r\n this._groundTexture.dispose();\r\n this._groundTexture = null;\r\n }\r\n }\r\n\r\n if (this._skybox && !newOptions.createSkybox) {\r\n this._skybox.dispose();\r\n this._skybox = null;\r\n }\r\n\r\n if (this._skyboxMaterial && !newOptions.createSkybox) {\r\n this._skyboxMaterial.dispose();\r\n this._skyboxMaterial = null;\r\n }\r\n\r\n if (this._skyboxTexture) {\r\n if (this._options.skyboxTexture != newOptions.skyboxTexture) {\r\n this._skyboxTexture.dispose();\r\n this._skyboxTexture = null;\r\n }\r\n }\r\n\r\n if (this._groundMirror && !newOptions.enableGroundMirror) {\r\n this._groundMirror.dispose();\r\n this._groundMirror = null;\r\n }\r\n\r\n if (this._scene.environmentTexture) {\r\n if (this._options.environmentTexture != newOptions.environmentTexture) {\r\n this._scene.environmentTexture.dispose();\r\n }\r\n }\r\n\r\n this._options = newOptions;\r\n\r\n this._setupBackground();\r\n this._setupImageProcessing();\r\n }\r\n\r\n /**\r\n * Sets the primary color of all the available elements.\r\n * @param color the main color to affect to the ground and the background\r\n */\r\n public setMainColor(color: Color3): void {\r\n if (this.groundMaterial) {\r\n this.groundMaterial.primaryColor = color;\r\n }\r\n\r\n if (this.skyboxMaterial) {\r\n this.skyboxMaterial.primaryColor = color;\r\n }\r\n\r\n if (this.groundMirror) {\r\n this.groundMirror.clearColor = new Color4(color.r, color.g, color.b, 1.0);\r\n }\r\n }\r\n\r\n /**\r\n * Setup the image processing according to the specified options.\r\n */\r\n private _setupImageProcessing(): void {\r\n if (this._options.setupImageProcessing) {\r\n this._scene.imageProcessingConfiguration.contrast = this._options.cameraContrast;\r\n this._scene.imageProcessingConfiguration.exposure = this._options.cameraExposure;\r\n this._scene.imageProcessingConfiguration.toneMappingEnabled = this._options.toneMappingEnabled;\r\n this._setupEnvironmentTexture();\r\n }\r\n }\r\n\r\n /**\r\n * Setup the environment texture according to the specified options.\r\n */\r\n private _setupEnvironmentTexture(): void {\r\n if (this._scene.environmentTexture) {\r\n return;\r\n }\r\n\r\n if (this._options.environmentTexture instanceof BaseTexture) {\r\n this._scene.environmentTexture = this._options.environmentTexture;\r\n return;\r\n }\r\n\r\n const environmentTexture = CubeTexture.CreateFromPrefilteredData(this._options.environmentTexture, this._scene);\r\n this._scene.environmentTexture = environmentTexture;\r\n }\r\n\r\n /**\r\n * Setup the background according to the specified options.\r\n */\r\n private _setupBackground(): void {\r\n if (!this._rootMesh) {\r\n this._rootMesh = new Mesh(\"BackgroundHelper\", this._scene);\r\n }\r\n this._rootMesh.rotation.y = this._options.backgroundYRotation;\r\n\r\n const sceneSize = this._getSceneSize();\r\n if (this._options.createGround) {\r\n this._setupGround(sceneSize);\r\n this._setupGroundMaterial();\r\n this._setupGroundDiffuseTexture();\r\n\r\n if (this._options.enableGroundMirror) {\r\n this._setupGroundMirrorTexture(sceneSize);\r\n }\r\n this._setupMirrorInGroundMaterial();\r\n }\r\n\r\n if (this._options.createSkybox) {\r\n this._setupSkybox(sceneSize);\r\n this._setupSkyboxMaterial();\r\n this._setupSkyboxReflectionTexture();\r\n }\r\n\r\n this._rootMesh.position.x = sceneSize.rootPosition.x;\r\n this._rootMesh.position.z = sceneSize.rootPosition.z;\r\n this._rootMesh.position.y = sceneSize.rootPosition.y;\r\n }\r\n\r\n /**\r\n * Get the scene sizes according to the setup.\r\n * @returns the different ground and skybox sizes.\r\n */\r\n private _getSceneSize(): ISceneSize {\r\n let groundSize = this._options.groundSize;\r\n let skyboxSize = this._options.skyboxSize;\r\n let rootPosition = this._options.rootPosition;\r\n if (!this._scene.meshes || this._scene.meshes.length === 1) {\r\n // 1 only means the root of the helper.\r\n return { groundSize, skyboxSize, rootPosition };\r\n }\r\n\r\n const sceneExtends = this._scene.getWorldExtends((mesh) => {\r\n return mesh !== this._ground && mesh !== this._rootMesh && mesh !== this._skybox;\r\n });\r\n const sceneDiagonal = sceneExtends.max.subtract(sceneExtends.min);\r\n\r\n if (this._options.sizeAuto) {\r\n if (this._scene.activeCamera instanceof ArcRotateCamera && this._scene.activeCamera.upperRadiusLimit) {\r\n groundSize = this._scene.activeCamera.upperRadiusLimit * 2;\r\n skyboxSize = groundSize;\r\n }\r\n\r\n const sceneDiagonalLenght = sceneDiagonal.length();\r\n if (sceneDiagonalLenght > groundSize) {\r\n groundSize = sceneDiagonalLenght * 2;\r\n skyboxSize = groundSize;\r\n }\r\n\r\n // 10 % bigger.\r\n groundSize *= 1.1;\r\n skyboxSize *= 1.5;\r\n rootPosition = sceneExtends.min.add(sceneDiagonal.scale(0.5));\r\n rootPosition.y = sceneExtends.min.y - this._options.groundYBias;\r\n }\r\n\r\n return { groundSize, skyboxSize, rootPosition };\r\n }\r\n\r\n /**\r\n * Setup the ground according to the specified options.\r\n * @param sceneSize\r\n */\r\n private _setupGround(sceneSize: ISceneSize): void {\r\n if (!this._ground || this._ground.isDisposed()) {\r\n this._ground = CreatePlane(\"BackgroundPlane\", { size: sceneSize.groundSize }, this._scene);\r\n this._ground.rotation.x = Math.PI / 2; // Face up by default.\r\n this._ground.isPickable = false;\r\n this._ground.parent = this._rootMesh;\r\n this._ground.onDisposeObservable.add(() => {\r\n this._ground = null;\r\n });\r\n }\r\n\r\n this._ground.receiveShadows = this._options.enableGroundShadow;\r\n }\r\n\r\n /**\r\n * Setup the ground material according to the specified options.\r\n */\r\n private _setupGroundMaterial(): void {\r\n if (!this._groundMaterial) {\r\n this._groundMaterial = new BackgroundMaterial(\"BackgroundPlaneMaterial\", this._scene);\r\n }\r\n this._groundMaterial.alpha = this._options.groundOpacity;\r\n this._groundMaterial.alphaMode = Constants.ALPHA_PREMULTIPLIED_PORTERDUFF;\r\n this._groundMaterial.shadowLevel = this._options.groundShadowLevel;\r\n this._groundMaterial.primaryColor = this._options.groundColor;\r\n this._groundMaterial.useRGBColor = false;\r\n this._groundMaterial.enableNoise = true;\r\n\r\n if (this._ground) {\r\n this._ground.material = this._groundMaterial;\r\n }\r\n }\r\n\r\n /**\r\n * Setup the ground diffuse texture according to the specified options.\r\n */\r\n private _setupGroundDiffuseTexture(): void {\r\n if (!this._groundMaterial) {\r\n return;\r\n }\r\n\r\n if (this._groundTexture) {\r\n return;\r\n }\r\n\r\n if (this._options.groundTexture instanceof BaseTexture) {\r\n this._groundMaterial.diffuseTexture = this._options.groundTexture;\r\n return;\r\n }\r\n\r\n this._groundTexture = new Texture(this._options.groundTexture, this._scene, undefined, undefined, undefined, undefined, this._errorHandler);\r\n this._groundTexture.gammaSpace = false;\r\n this._groundTexture.hasAlpha = true;\r\n this._groundMaterial.diffuseTexture = this._groundTexture;\r\n }\r\n\r\n /**\r\n * Setup the ground mirror texture according to the specified options.\r\n * @param sceneSize\r\n */\r\n private _setupGroundMirrorTexture(sceneSize: ISceneSize): void {\r\n const wrapping = Texture.CLAMP_ADDRESSMODE;\r\n if (!this._groundMirror) {\r\n this._groundMirror = new MirrorTexture(\r\n \"BackgroundPlaneMirrorTexture\",\r\n { ratio: this._options.groundMirrorSizeRatio },\r\n this._scene,\r\n false,\r\n this._options.groundMirrorTextureType,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n true\r\n );\r\n this._groundMirror.mirrorPlane = new Plane(0, -1, 0, sceneSize.rootPosition.y);\r\n this._groundMirror.anisotropicFilteringLevel = 1;\r\n this._groundMirror.wrapU = wrapping;\r\n this._groundMirror.wrapV = wrapping;\r\n\r\n if (this._groundMirror.renderList) {\r\n for (let i = 0; i < this._scene.meshes.length; i++) {\r\n const mesh = this._scene.meshes[i];\r\n if (mesh !== this._ground && mesh !== this._skybox && mesh !== this._rootMesh) {\r\n this._groundMirror.renderList.push(mesh);\r\n }\r\n }\r\n }\r\n }\r\n\r\n const gammaGround = this._options.groundColor.toGammaSpace(this._scene.getEngine().useExactSrgbConversions);\r\n this._groundMirror.clearColor = new Color4(gammaGround.r, gammaGround.g, gammaGround.b, 1);\r\n this._groundMirror.adaptiveBlurKernel = this._options.groundMirrorBlurKernel;\r\n }\r\n\r\n /**\r\n * Setup the ground to receive the mirror texture.\r\n */\r\n private _setupMirrorInGroundMaterial(): void {\r\n if (this._groundMaterial) {\r\n this._groundMaterial.reflectionTexture = this._groundMirror;\r\n this._groundMaterial.reflectionFresnel = true;\r\n this._groundMaterial.reflectionAmount = this._options.groundMirrorAmount;\r\n this._groundMaterial.reflectionStandardFresnelWeight = this._options.groundMirrorFresnelWeight;\r\n this._groundMaterial.reflectionFalloffDistance = this._options.groundMirrorFallOffDistance;\r\n }\r\n }\r\n\r\n /**\r\n * Setup the skybox according to the specified options.\r\n * @param sceneSize\r\n */\r\n private _setupSkybox(sceneSize: ISceneSize): void {\r\n if (!this._skybox || this._skybox.isDisposed()) {\r\n this._skybox = CreateBox(\"BackgroundSkybox\", { size: sceneSize.skyboxSize, sideOrientation: Mesh.BACKSIDE }, this._scene);\r\n this._skybox.isPickable = false;\r\n this._skybox.onDisposeObservable.add(() => {\r\n this._skybox = null;\r\n });\r\n }\r\n this._skybox.parent = this._rootMesh;\r\n }\r\n\r\n /**\r\n * Setup the skybox material according to the specified options.\r\n */\r\n private _setupSkyboxMaterial(): void {\r\n if (!this._skybox) {\r\n return;\r\n }\r\n\r\n if (!this._skyboxMaterial) {\r\n this._skyboxMaterial = new BackgroundMaterial(\"BackgroundSkyboxMaterial\", this._scene);\r\n }\r\n this._skyboxMaterial.useRGBColor = false;\r\n this._skyboxMaterial.primaryColor = this._options.skyboxColor;\r\n this._skyboxMaterial.enableNoise = true;\r\n\r\n this._skybox.material = this._skyboxMaterial;\r\n }\r\n\r\n /**\r\n * Setup the skybox reflection texture according to the specified options.\r\n */\r\n private _setupSkyboxReflectionTexture(): void {\r\n if (!this._skyboxMaterial) {\r\n return;\r\n }\r\n\r\n if (this._skyboxTexture) {\r\n return;\r\n }\r\n\r\n if (this._options.skyboxTexture instanceof BaseTexture) {\r\n this._skyboxMaterial.reflectionTexture = this._options.skyboxTexture;\r\n return;\r\n }\r\n\r\n this._skyboxTexture = new CubeTexture(this._options.skyboxTexture, this._scene, undefined, undefined, undefined, undefined, this._errorHandler);\r\n this._skyboxTexture.coordinatesMode = Texture.SKYBOX_MODE;\r\n this._skyboxTexture.gammaSpace = false;\r\n this._skyboxMaterial.reflectionTexture = this._skyboxTexture;\r\n }\r\n\r\n private _errorHandler = (message?: string, exception?: any) => {\r\n this.onErrorObservable.notifyObservers({ message: message, exception: exception });\r\n };\r\n\r\n /**\r\n * Dispose all the elements created by the Helper.\r\n */\r\n public dispose(): void {\r\n if (this._groundMaterial) {\r\n this._groundMaterial.dispose(true, true);\r\n }\r\n if (this._skyboxMaterial) {\r\n this._skyboxMaterial.dispose(true, true);\r\n }\r\n this._rootMesh.dispose(false);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"environmentHelper.js","sourceRoot":"","sources":["../../../../dev/core/src/Helpers/environmentHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,yBAAwB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AC;QACD,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC7C,CAAC;QACD,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;;AAzgBD;;GAEG;AACY,sCAAoB,GAAG,qEAAqE,AAAxE,CAAyE;AAE5G;;GAEG;AACY,sCAAoB,GAAG,qEAAqE,AAAxE,CAAyE;AAE5G;;GAEG;AACY,2CAAyB,GAAG,wEAAwE,AAA3E,CAA4E","sourcesContent":["import { Observable } from \"../Misc/observable\";\r\nimport type { Nullable } from \"../types\";\r\nimport { ArcRotateCamera } from \"../Cameras/arcRotateCamera\";\r\nimport type { Scene } from \"../scene\";\r\nimport { Vector3 } from \"../Maths/math.vector\";\r\nimport { Color3, Color4 } from \"../Maths/math.color\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport { Mesh } from \"../Meshes/mesh\";\r\nimport { BaseTexture } from \"../Materials/Textures/baseTexture\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport { MirrorTexture } from \"../Materials/Textures/mirrorTexture\";\r\nimport { CubeTexture } from \"../Materials/Textures/cubeTexture\";\r\nimport { BackgroundMaterial } from \"../Materials/Background/backgroundMaterial\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport { CreatePlane } from \"../Meshes/Builders/planeBuilder\";\r\nimport { CreateBox } from \"../Meshes/Builders/boxBuilder\";\r\nimport { Plane } from \"../Maths/math.plane\";\r\nimport { Tools } from \"core/Misc/tools\";\r\n\r\n/**\r\n * Represents the different options available during the creation of\r\n * a Environment helper.\r\n *\r\n * This can control the default ground, skybox and image processing setup of your scene.\r\n */\r\nexport interface IEnvironmentHelperOptions {\r\n /**\r\n * Specifies whether or not to create a ground.\r\n * True by default.\r\n */\r\n createGround: boolean;\r\n /**\r\n * Specifies the ground size.\r\n * 15 by default.\r\n */\r\n groundSize: number;\r\n /**\r\n * The texture used on the ground for the main color.\r\n * Comes from the BabylonJS CDN by default.\r\n *\r\n * Remarks: Can be either a texture or a url.\r\n */\r\n groundTexture: string | BaseTexture;\r\n /**\r\n * The color mixed in the ground texture by default.\r\n * BabylonJS clearColor by default.\r\n */\r\n groundColor: Color3;\r\n /**\r\n * Specifies the ground opacity.\r\n * 1 by default.\r\n */\r\n groundOpacity: number;\r\n /**\r\n * Enables the ground to receive shadows.\r\n * True by default.\r\n */\r\n enableGroundShadow: boolean;\r\n /**\r\n * Helps preventing the shadow to be fully black on the ground.\r\n * 0.5 by default.\r\n */\r\n groundShadowLevel: number;\r\n /**\r\n * Creates a mirror texture attach to the ground.\r\n * false by default.\r\n */\r\n enableGroundMirror: boolean;\r\n /**\r\n * Specifies the ground mirror size ratio.\r\n * 0.3 by default as the default kernel is 64.\r\n */\r\n groundMirrorSizeRatio: number;\r\n /**\r\n * Specifies the ground mirror blur kernel size.\r\n * 64 by default.\r\n */\r\n groundMirrorBlurKernel: number;\r\n /**\r\n * Specifies the ground mirror visibility amount.\r\n * 1 by default\r\n */\r\n groundMirrorAmount: number;\r\n /**\r\n * Specifies the ground mirror reflectance weight.\r\n * This uses the standard weight of the background material to setup the fresnel effect\r\n * of the mirror.\r\n * 1 by default.\r\n */\r\n groundMirrorFresnelWeight: number;\r\n /**\r\n * Specifies the ground mirror Falloff distance.\r\n * This can helps reducing the size of the reflection.\r\n * 0 by Default.\r\n */\r\n groundMirrorFallOffDistance: number;\r\n /**\r\n * Specifies the ground mirror texture type.\r\n * Unsigned Int by Default.\r\n */\r\n groundMirrorTextureType: number;\r\n /**\r\n * Specifies a bias applied to the ground vertical position to prevent z-fighting with\r\n * the shown objects.\r\n */\r\n groundYBias: number;\r\n\r\n /**\r\n * Specifies whether or not to create a skybox.\r\n * True by default.\r\n */\r\n createSkybox: boolean;\r\n /**\r\n * Specifies the skybox size.\r\n * 20 by default.\r\n */\r\n skyboxSize: number;\r\n /**\r\n * The texture used on the skybox for the main color.\r\n * Comes from the BabylonJS CDN by default.\r\n *\r\n * Remarks: Can be either a texture or a url.\r\n */\r\n skyboxTexture: string | BaseTexture;\r\n /**\r\n * The color mixed in the skybox texture by default.\r\n * BabylonJS clearColor by default.\r\n */\r\n skyboxColor: Color3;\r\n\r\n /**\r\n * The background rotation around the Y axis of the scene.\r\n * This helps aligning the key lights of your scene with the background.\r\n * 0 by default.\r\n */\r\n backgroundYRotation: number;\r\n\r\n /**\r\n * Compute automatically the size of the elements to best fit with the scene.\r\n */\r\n sizeAuto: boolean;\r\n\r\n /**\r\n * Default position of the rootMesh if autoSize is not true.\r\n */\r\n rootPosition: Vector3;\r\n\r\n /**\r\n * Sets up the image processing in the scene.\r\n * true by default.\r\n */\r\n setupImageProcessing: boolean;\r\n\r\n /**\r\n * The texture used as your environment texture in the scene.\r\n * Comes from the BabylonJS CDN by default and in use if setupImageProcessing is true.\r\n *\r\n * Remarks: Can be either a texture or a url.\r\n */\r\n environmentTexture: string | BaseTexture;\r\n\r\n /**\r\n * The value of the exposure to apply to the scene.\r\n * 0.6 by default if setupImageProcessing is true.\r\n */\r\n cameraExposure: number;\r\n\r\n /**\r\n * The value of the contrast to apply to the scene.\r\n * 1.6 by default if setupImageProcessing is true.\r\n */\r\n cameraContrast: number;\r\n\r\n /**\r\n * Specifies whether or not tonemapping should be enabled in the scene.\r\n * true by default if setupImageProcessing is true.\r\n */\r\n toneMappingEnabled: boolean;\r\n}\r\n\r\ninterface ISceneSize {\r\n groundSize: number;\r\n skyboxSize: number;\r\n rootPosition: Vector3;\r\n}\r\n\r\n/**\r\n * The EnvironmentHelper class can be used to add a fully featured non-expensive background to your scene.\r\n * It includes by default a skybox and a ground relying on the BackgroundMaterial.\r\n * It also helps with the default setup of your ImageProcessingConfiguration.\r\n */\r\nexport class EnvironmentHelper {\r\n /**\r\n * Default ground texture URL.\r\n */\r\n private static _GroundTextureCDNUrl = \"https://assets.babylonjs.com/core/environments/backgroundGround.png\";\r\n\r\n /**\r\n * Default skybox texture URL.\r\n */\r\n private static _SkyboxTextureCDNUrl = \"https://assets.babylonjs.com/core/environments/backgroundSkybox.dds\";\r\n\r\n /**\r\n * Default environment texture URL.\r\n */\r\n private static _EnvironmentTextureCDNUrl = \"https://assets.babylonjs.com/core/environments/environmentSpecular.env\";\r\n\r\n /**\r\n * Creates the default options for the helper.\r\n * @param scene The scene the environment helper belongs to.\r\n * @returns default options for the helper.\r\n */\r\n private static _GetDefaultOptions(scene: Scene): IEnvironmentHelperOptions {\r\n return {\r\n createGround: true,\r\n groundSize: 15,\r\n groundTexture: Tools.GetAssetUrl(this._GroundTextureCDNUrl),\r\n groundColor: new Color3(0.2, 0.2, 0.3).toLinearSpace(scene.getEngine().useExactSrgbConversions).scale(3),\r\n groundOpacity: 0.9,\r\n enableGroundShadow: true,\r\n groundShadowLevel: 0.5,\r\n\r\n enableGroundMirror: false,\r\n groundMirrorSizeRatio: 0.3,\r\n groundMirrorBlurKernel: 64,\r\n groundMirrorAmount: 1,\r\n groundMirrorFresnelWeight: 1,\r\n groundMirrorFallOffDistance: 0,\r\n groundMirrorTextureType: Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n\r\n groundYBias: 0.00001,\r\n\r\n createSkybox: true,\r\n skyboxSize: 20,\r\n skyboxTexture: Tools.GetAssetUrl(this._SkyboxTextureCDNUrl),\r\n skyboxColor: new Color3(0.2, 0.2, 0.3).toLinearSpace(scene.getEngine().useExactSrgbConversions).scale(3),\r\n\r\n backgroundYRotation: 0,\r\n sizeAuto: true,\r\n rootPosition: Vector3.Zero(),\r\n\r\n setupImageProcessing: true,\r\n environmentTexture: Tools.GetAssetUrl(this._EnvironmentTextureCDNUrl),\r\n cameraExposure: 0.8,\r\n cameraContrast: 1.2,\r\n toneMappingEnabled: true,\r\n };\r\n }\r\n\r\n private _rootMesh: Mesh;\r\n /**\r\n * Gets the root mesh created by the helper.\r\n */\r\n public get rootMesh(): Mesh {\r\n return this._rootMesh;\r\n }\r\n\r\n private _skybox: Nullable<Mesh>;\r\n /**\r\n * Gets the skybox created by the helper.\r\n */\r\n public get skybox(): Nullable<Mesh> {\r\n return this._skybox;\r\n }\r\n\r\n private _skyboxTexture: Nullable<BaseTexture>;\r\n /**\r\n * Gets the skybox texture created by the helper.\r\n */\r\n public get skyboxTexture(): Nullable<BaseTexture> {\r\n return this._skyboxTexture;\r\n }\r\n\r\n private _skyboxMaterial: Nullable<BackgroundMaterial>;\r\n /**\r\n * Gets the skybox material created by the helper.\r\n */\r\n public get skyboxMaterial(): Nullable<BackgroundMaterial> {\r\n return this._skyboxMaterial;\r\n }\r\n\r\n private _ground: Nullable<Mesh>;\r\n /**\r\n * Gets the ground mesh created by the helper.\r\n */\r\n public get ground(): Nullable<Mesh> {\r\n return this._ground;\r\n }\r\n\r\n private _groundTexture: Nullable<BaseTexture>;\r\n /**\r\n * Gets the ground texture created by the helper.\r\n */\r\n public get groundTexture(): Nullable<BaseTexture> {\r\n return this._groundTexture;\r\n }\r\n\r\n private _groundMirror: Nullable<MirrorTexture>;\r\n /**\r\n * Gets the ground mirror created by the helper.\r\n */\r\n public get groundMirror(): Nullable<MirrorTexture> {\r\n return this._groundMirror;\r\n }\r\n\r\n /**\r\n * Gets the ground mirror render list to helps pushing the meshes\r\n * you wish in the ground reflection.\r\n */\r\n public get groundMirrorRenderList(): Nullable<AbstractMesh[]> {\r\n if (this._groundMirror) {\r\n return this._groundMirror.renderList;\r\n }\r\n return null;\r\n }\r\n\r\n private _groundMaterial: Nullable<BackgroundMaterial>;\r\n /**\r\n * Gets the ground material created by the helper.\r\n */\r\n public get groundMaterial(): Nullable<BackgroundMaterial> {\r\n return this._groundMaterial;\r\n }\r\n\r\n /**\r\n * Stores the creation options.\r\n */\r\n private readonly _scene: Scene;\r\n private _options: IEnvironmentHelperOptions;\r\n\r\n /**\r\n * This observable will be notified with any error during the creation of the environment,\r\n * mainly texture creation errors.\r\n */\r\n public onErrorObservable: Observable<{ message?: string; exception?: any }>;\r\n\r\n /**\r\n * constructor\r\n * @param options Defines the options we want to customize the helper\r\n * @param scene The scene to add the material to\r\n */\r\n constructor(options: Partial<IEnvironmentHelperOptions>, scene: Scene) {\r\n this._options = {\r\n ...EnvironmentHelper._GetDefaultOptions(scene),\r\n ...options,\r\n };\r\n this._scene = scene;\r\n this.onErrorObservable = new Observable();\r\n\r\n this._setupBackground();\r\n this._setupImageProcessing();\r\n }\r\n\r\n /**\r\n * Updates the environment according to the new options\r\n * @param options options to configure the helper (IEnvironmentHelperOptions)\r\n */\r\n public updateOptions(options: Partial<IEnvironmentHelperOptions>) {\r\n const newOptions = {\r\n ...this._options,\r\n ...options,\r\n };\r\n\r\n if (this._ground && !newOptions.createGround) {\r\n this._ground.dispose();\r\n this._ground = null;\r\n }\r\n\r\n if (this._groundMaterial && !newOptions.createGround) {\r\n this._groundMaterial.dispose();\r\n this._groundMaterial = null;\r\n }\r\n\r\n if (this._groundTexture) {\r\n if (this._options.groundTexture != newOptions.groundTexture) {\r\n this._groundTexture.dispose();\r\n this._groundTexture = null;\r\n }\r\n }\r\n\r\n if (this._skybox && !newOptions.createSkybox) {\r\n this._skybox.dispose();\r\n this._skybox = null;\r\n }\r\n\r\n if (this._skyboxMaterial && !newOptions.createSkybox) {\r\n this._skyboxMaterial.dispose();\r\n this._skyboxMaterial = null;\r\n }\r\n\r\n if (this._skyboxTexture) {\r\n if (this._options.skyboxTexture != newOptions.skyboxTexture) {\r\n this._skyboxTexture.dispose();\r\n this._skyboxTexture = null;\r\n }\r\n }\r\n\r\n if (this._groundMirror && !newOptions.enableGroundMirror) {\r\n this._groundMirror.dispose();\r\n this._groundMirror = null;\r\n }\r\n\r\n if (this._scene.environmentTexture) {\r\n if (this._options.environmentTexture != newOptions.environmentTexture) {\r\n this._scene.environmentTexture.dispose();\r\n }\r\n }\r\n\r\n this._options = newOptions;\r\n\r\n this._setupBackground();\r\n this._setupImageProcessing();\r\n }\r\n\r\n /**\r\n * Sets the primary color of all the available elements.\r\n * @param color the main color to affect to the ground and the background\r\n */\r\n public setMainColor(color: Color3): void {\r\n if (this.groundMaterial) {\r\n this.groundMaterial.primaryColor = color;\r\n }\r\n\r\n if (this.skyboxMaterial) {\r\n this.skyboxMaterial.primaryColor = color;\r\n }\r\n\r\n if (this.groundMirror) {\r\n this.groundMirror.clearColor = new Color4(color.r, color.g, color.b, 1.0);\r\n }\r\n }\r\n\r\n /**\r\n * Setup the image processing according to the specified options.\r\n */\r\n private _setupImageProcessing(): void {\r\n if (this._options.setupImageProcessing) {\r\n this._scene.imageProcessingConfiguration.contrast = this._options.cameraContrast;\r\n this._scene.imageProcessingConfiguration.exposure = this._options.cameraExposure;\r\n this._scene.imageProcessingConfiguration.toneMappingEnabled = this._options.toneMappingEnabled;\r\n this._setupEnvironmentTexture();\r\n }\r\n }\r\n\r\n /**\r\n * Setup the environment texture according to the specified options.\r\n */\r\n private _setupEnvironmentTexture(): void {\r\n if (this._scene.environmentTexture) {\r\n return;\r\n }\r\n\r\n if (this._options.environmentTexture instanceof BaseTexture) {\r\n this._scene.environmentTexture = this._options.environmentTexture;\r\n return;\r\n }\r\n\r\n const environmentTexture = CubeTexture.CreateFromPrefilteredData(this._options.environmentTexture, this._scene);\r\n this._scene.environmentTexture = environmentTexture;\r\n }\r\n\r\n /**\r\n * Setup the background according to the specified options.\r\n */\r\n private _setupBackground(): void {\r\n if (!this._rootMesh) {\r\n this._rootMesh = new Mesh(\"BackgroundHelper\", this._scene);\r\n }\r\n this._rootMesh.rotation.y = this._options.backgroundYRotation;\r\n\r\n const sceneSize = this._getSceneSize();\r\n if (this._options.createGround) {\r\n this._setupGround(sceneSize);\r\n this._setupGroundMaterial();\r\n this._setupGroundDiffuseTexture();\r\n\r\n if (this._options.enableGroundMirror) {\r\n this._setupGroundMirrorTexture(sceneSize);\r\n }\r\n this._setupMirrorInGroundMaterial();\r\n }\r\n\r\n if (this._options.createSkybox) {\r\n this._setupSkybox(sceneSize);\r\n this._setupSkyboxMaterial();\r\n this._setupSkyboxReflectionTexture();\r\n }\r\n\r\n this._rootMesh.position.x = sceneSize.rootPosition.x;\r\n this._rootMesh.position.z = sceneSize.rootPosition.z;\r\n this._rootMesh.position.y = sceneSize.rootPosition.y;\r\n }\r\n\r\n /**\r\n * Get the scene sizes according to the setup.\r\n * @returns the different ground and skybox sizes.\r\n */\r\n private _getSceneSize(): ISceneSize {\r\n let groundSize = this._options.groundSize;\r\n let skyboxSize = this._options.skyboxSize;\r\n let rootPosition = this._options.rootPosition;\r\n if (!this._scene.meshes || this._scene.meshes.length === 1) {\r\n // 1 only means the root of the helper.\r\n return { groundSize, skyboxSize, rootPosition };\r\n }\r\n\r\n const sceneExtends = this._scene.getWorldExtends((mesh) => {\r\n return mesh !== this._ground && mesh !== this._rootMesh && mesh !== this._skybox;\r\n });\r\n const sceneDiagonal = sceneExtends.max.subtract(sceneExtends.min);\r\n\r\n if (this._options.sizeAuto) {\r\n if (this._scene.activeCamera instanceof ArcRotateCamera && this._scene.activeCamera.upperRadiusLimit) {\r\n groundSize = this._scene.activeCamera.upperRadiusLimit * 2;\r\n skyboxSize = groundSize;\r\n }\r\n\r\n const sceneDiagonalLenght = sceneDiagonal.length();\r\n if (sceneDiagonalLenght > groundSize) {\r\n groundSize = sceneDiagonalLenght * 2;\r\n skyboxSize = groundSize;\r\n }\r\n\r\n // 10 % bigger.\r\n groundSize *= 1.1;\r\n skyboxSize *= 1.5;\r\n rootPosition = sceneExtends.min.add(sceneDiagonal.scale(0.5));\r\n rootPosition.y = sceneExtends.min.y - this._options.groundYBias;\r\n }\r\n\r\n return { groundSize, skyboxSize, rootPosition };\r\n }\r\n\r\n /**\r\n * Setup the ground according to the specified options.\r\n * @param sceneSize\r\n */\r\n private _setupGround(sceneSize: ISceneSize): void {\r\n if (!this._ground || this._ground.isDisposed()) {\r\n this._ground = CreatePlane(\"BackgroundPlane\", { size: sceneSize.groundSize }, this._scene);\r\n this._ground.rotation.x = Math.PI / 2; // Face up by default.\r\n this._ground.isPickable = false;\r\n this._ground.parent = this._rootMesh;\r\n this._ground.onDisposeObservable.add(() => {\r\n this._ground = null;\r\n });\r\n }\r\n\r\n this._ground.receiveShadows = this._options.enableGroundShadow;\r\n }\r\n\r\n /**\r\n * Setup the ground material according to the specified options.\r\n */\r\n private _setupGroundMaterial(): void {\r\n if (!this._groundMaterial) {\r\n this._groundMaterial = new BackgroundMaterial(\"BackgroundPlaneMaterial\", this._scene);\r\n }\r\n this._groundMaterial.alpha = this._options.groundOpacity;\r\n this._groundMaterial.alphaMode = Constants.ALPHA_PREMULTIPLIED_PORTERDUFF;\r\n this._groundMaterial.shadowLevel = this._options.groundShadowLevel;\r\n this._groundMaterial.primaryColor = this._options.groundColor;\r\n this._groundMaterial.useRGBColor = false;\r\n this._groundMaterial.enableNoise = true;\r\n\r\n if (this._ground) {\r\n this._ground.material = this._groundMaterial;\r\n }\r\n }\r\n\r\n /**\r\n * Setup the ground diffuse texture according to the specified options.\r\n */\r\n private _setupGroundDiffuseTexture(): void {\r\n if (!this._groundMaterial) {\r\n return;\r\n }\r\n\r\n if (this._groundTexture) {\r\n return;\r\n }\r\n\r\n if (this._options.groundTexture instanceof BaseTexture) {\r\n this._groundMaterial.diffuseTexture = this._options.groundTexture;\r\n return;\r\n }\r\n\r\n this._groundTexture = new Texture(this._options.groundTexture, this._scene, undefined, undefined, undefined, undefined, this._errorHandler);\r\n this._groundTexture.gammaSpace = false;\r\n this._groundTexture.hasAlpha = true;\r\n this._groundMaterial.diffuseTexture = this._groundTexture;\r\n }\r\n\r\n /**\r\n * Setup the ground mirror texture according to the specified options.\r\n * @param sceneSize\r\n */\r\n private _setupGroundMirrorTexture(sceneSize: ISceneSize): void {\r\n const wrapping = Texture.CLAMP_ADDRESSMODE;\r\n if (!this._groundMirror) {\r\n this._groundMirror = new MirrorTexture(\r\n \"BackgroundPlaneMirrorTexture\",\r\n { ratio: this._options.groundMirrorSizeRatio },\r\n this._scene,\r\n false,\r\n this._options.groundMirrorTextureType,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n true\r\n );\r\n this._groundMirror.mirrorPlane = new Plane(0, -1, 0, sceneSize.rootPosition.y);\r\n this._groundMirror.anisotropicFilteringLevel = 1;\r\n this._groundMirror.wrapU = wrapping;\r\n this._groundMirror.wrapV = wrapping;\r\n\r\n if (this._groundMirror.renderList) {\r\n for (let i = 0; i < this._scene.meshes.length; i++) {\r\n const mesh = this._scene.meshes[i];\r\n if (mesh !== this._ground && mesh !== this._skybox && mesh !== this._rootMesh) {\r\n this._groundMirror.renderList.push(mesh);\r\n }\r\n }\r\n }\r\n }\r\n\r\n const gammaGround = this._options.groundColor.toGammaSpace(this._scene.getEngine().useExactSrgbConversions);\r\n this._groundMirror.clearColor = new Color4(gammaGround.r, gammaGround.g, gammaGround.b, 1);\r\n this._groundMirror.adaptiveBlurKernel = this._options.groundMirrorBlurKernel;\r\n }\r\n\r\n /**\r\n * Setup the ground to receive the mirror texture.\r\n */\r\n private _setupMirrorInGroundMaterial(): void {\r\n if (this._groundMaterial) {\r\n this._groundMaterial.reflectionTexture = this._groundMirror;\r\n this._groundMaterial.reflectionFresnel = true;\r\n this._groundMaterial.reflectionAmount = this._options.groundMirrorAmount;\r\n this._groundMaterial.reflectionStandardFresnelWeight = this._options.groundMirrorFresnelWeight;\r\n this._groundMaterial.reflectionFalloffDistance = this._options.groundMirrorFallOffDistance;\r\n }\r\n }\r\n\r\n /**\r\n * Setup the skybox according to the specified options.\r\n * @param sceneSize\r\n */\r\n private _setupSkybox(sceneSize: ISceneSize): void {\r\n if (!this._skybox || this._skybox.isDisposed()) {\r\n this._skybox = CreateBox(\"BackgroundSkybox\", { size: sceneSize.skyboxSize, sideOrientation: Mesh.BACKSIDE }, this._scene);\r\n this._skybox.isPickable = false;\r\n this._skybox.onDisposeObservable.add(() => {\r\n this._skybox = null;\r\n });\r\n }\r\n this._skybox.parent = this._rootMesh;\r\n }\r\n\r\n /**\r\n * Setup the skybox material according to the specified options.\r\n */\r\n private _setupSkyboxMaterial(): void {\r\n if (!this._skybox) {\r\n return;\r\n }\r\n\r\n if (!this._skyboxMaterial) {\r\n this._skyboxMaterial = new BackgroundMaterial(\"BackgroundSkyboxMaterial\", this._scene);\r\n }\r\n this._skyboxMaterial.useRGBColor = false;\r\n this._skyboxMaterial.primaryColor = this._options.skyboxColor;\r\n this._skyboxMaterial.enableNoise = true;\r\n\r\n this._skybox.material = this._skyboxMaterial;\r\n }\r\n\r\n /**\r\n * Setup the skybox reflection texture according to the specified options.\r\n */\r\n private _setupSkyboxReflectionTexture(): void {\r\n if (!this._skyboxMaterial) {\r\n return;\r\n }\r\n\r\n if (this._skyboxTexture) {\r\n return;\r\n }\r\n\r\n if (this._options.skyboxTexture instanceof BaseTexture) {\r\n this._skyboxMaterial.reflectionTexture = this._options.skyboxTexture;\r\n return;\r\n }\r\n\r\n this._skyboxTexture = new CubeTexture(this._options.skyboxTexture, this._scene, undefined, undefined, undefined, undefined, this._errorHandler);\r\n this._skyboxTexture.coordinatesMode = Texture.SKYBOX_MODE;\r\n this._skyboxTexture.gammaSpace = false;\r\n this._skyboxMaterial.reflectionTexture = this._skyboxTexture;\r\n }\r\n\r\n private _errorHandler = (message?: string, exception?: any) => {\r\n this.onErrorObservable.notifyObservers({ message: message, exception: exception });\r\n };\r\n\r\n /**\r\n * Dispose all the elements created by the Helper.\r\n */\r\n public dispose(): void {\r\n if (this._groundMaterial) {\r\n this._groundMaterial.dispose(true, true);\r\n }\r\n if (this._skyboxMaterial) {\r\n this._skyboxMaterial.dispose(true, true);\r\n }\r\n this._rootMesh.dispose(false);\r\n }\r\n}\r\n"]}
@@ -926,7 +926,7 @@ export class InputManager {
926
926
  if (underPointerMesh) {
927
927
  actionManager = underPointerMesh._getActionManagerForTrigger(10);
928
928
  if (actionManager) {
929
- actionManager.processTrigger(10, ActionEvent.CreateNew(underPointerMesh, evt, { pointerId }));
929
+ actionManager.processTrigger(10, new ActionEvent(underPointerMesh, this._pointerX, this._pointerY, mesh, evt, { pointerId }));
930
930
  }
931
931
  }
932
932
  if (mesh) {
@@ -934,7 +934,7 @@ export class InputManager {
934
934
  this._pointerOverMesh = mesh;
935
935
  actionManager = mesh._getActionManagerForTrigger(9);
936
936
  if (actionManager) {
937
- actionManager.processTrigger(9, ActionEvent.CreateNew(mesh, evt, { pointerId, pickResult }));
937
+ actionManager.processTrigger(9, new ActionEvent(mesh, this._pointerX, this._pointerY, mesh, evt, { pointerId, pickResult }));
938
938
  }
939
939
  }
940
940
  else {