@onerjs/core 8.53.5 → 8.53.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (841) hide show
  1. package/Animations/animationGroup.d.ts +0 -1
  2. package/Animations/animationGroup.js +0 -1
  3. package/Animations/animationGroup.js.map +1 -1
  4. package/Animations/animationGroup.pure.js +2 -0
  5. package/Animations/animationGroup.pure.js.map +1 -1
  6. package/Animations/runtimeAnimation.js +11 -0
  7. package/Animations/runtimeAnimation.js.map +1 -1
  8. package/Audio/audioSceneComponent.pure.js +1 -1
  9. package/AudioV2/abstractAudio/abstractSound.d.ts +2 -1
  10. package/AudioV2/abstractAudio/abstractSound.js +7 -2
  11. package/AudioV2/abstractAudio/abstractSound.js.map +1 -1
  12. package/AudioV2/abstractAudio/abstractSoundInstance.d.ts +3 -1
  13. package/AudioV2/abstractAudio/abstractSoundInstance.js.map +1 -1
  14. package/AudioV2/abstractAudio/staticSound.d.ts +6 -0
  15. package/AudioV2/abstractAudio/staticSound.js +17 -1
  16. package/AudioV2/abstractAudio/staticSound.js.map +1 -1
  17. package/AudioV2/abstractAudio/staticSoundInstance.d.ts +4 -2
  18. package/AudioV2/abstractAudio/staticSoundInstance.js.map +1 -1
  19. package/AudioV2/abstractAudio/streamingSound.d.ts +6 -0
  20. package/AudioV2/abstractAudio/streamingSound.js +9 -1
  21. package/AudioV2/abstractAudio/streamingSound.js.map +1 -1
  22. package/AudioV2/webAudio/webAudioStaticSound.d.ts +7 -1
  23. package/AudioV2/webAudio/webAudioStaticSound.js +56 -8
  24. package/AudioV2/webAudio/webAudioStaticSound.js.map +1 -1
  25. package/AudioV2/webAudio/webAudioStreamingSound.d.ts +3 -1
  26. package/AudioV2/webAudio/webAudioStreamingSound.js +16 -4
  27. package/AudioV2/webAudio/webAudioStreamingSound.js.map +1 -1
  28. package/BakedVertexAnimation/bakedVertexAnimationManager.d.ts +2 -2
  29. package/BakedVertexAnimation/bakedVertexAnimationManager.js +151 -121
  30. package/BakedVertexAnimation/bakedVertexAnimationManager.js.map +1 -1
  31. package/Behaviors/Cameras/interpolatingBehavior.d.ts +17 -2
  32. package/Behaviors/Cameras/interpolatingBehavior.js +53 -23
  33. package/Behaviors/Cameras/interpolatingBehavior.js.map +1 -1
  34. package/Bones/bone.pure.js +3 -3
  35. package/Buffers/buffer.pure.js +0 -12
  36. package/Buffers/buffer.pure.js.map +1 -1
  37. package/Cameras/Inputs/BaseCameraMouseWheelInput.js +141 -126
  38. package/Cameras/Inputs/BaseCameraMouseWheelInput.js.map +1 -1
  39. package/Cameras/Inputs/BaseCameraPointersInput.d.ts +2 -1
  40. package/Cameras/Inputs/BaseCameraPointersInput.js +290 -277
  41. package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
  42. package/Cameras/Inputs/arcRotateCameraGamepadInput.js +115 -102
  43. package/Cameras/Inputs/arcRotateCameraGamepadInput.js.map +1 -1
  44. package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.d.ts +3 -0
  45. package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js +334 -273
  46. package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js.map +1 -1
  47. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +273 -258
  48. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
  49. package/Cameras/Inputs/arcRotateCameraPointersInput.js +237 -213
  50. package/Cameras/Inputs/arcRotateCameraPointersInput.js.map +1 -1
  51. package/Cameras/Inputs/flyCameraKeyboardInput.js +199 -168
  52. package/Cameras/Inputs/flyCameraKeyboardInput.js.map +1 -1
  53. package/Cameras/Inputs/flyCameraMouseInput.js +243 -229
  54. package/Cameras/Inputs/flyCameraMouseInput.js.map +1 -1
  55. package/Cameras/Inputs/followCameraKeyboardMoveInput.js +311 -266
  56. package/Cameras/Inputs/followCameraKeyboardMoveInput.js.map +1 -1
  57. package/Cameras/Inputs/followCameraMouseWheelInput.js +139 -119
  58. package/Cameras/Inputs/followCameraMouseWheelInput.js.map +1 -1
  59. package/Cameras/Inputs/followCameraPointersInput.js +239 -203
  60. package/Cameras/Inputs/followCameraPointersInput.js.map +1 -1
  61. package/Cameras/Inputs/freeCameraGamepadInput.js +127 -114
  62. package/Cameras/Inputs/freeCameraGamepadInput.js.map +1 -1
  63. package/Cameras/Inputs/freeCameraKeyboardMoveInput.js +278 -244
  64. package/Cameras/Inputs/freeCameraKeyboardMoveInput.js.map +1 -1
  65. package/Cameras/Inputs/freeCameraMouseInput.js +216 -202
  66. package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
  67. package/Cameras/Inputs/freeCameraMouseWheelInput.js +368 -353
  68. package/Cameras/Inputs/freeCameraMouseWheelInput.js.map +1 -1
  69. package/Cameras/Inputs/freeCameraTouchInput.js +185 -172
  70. package/Cameras/Inputs/freeCameraTouchInput.js.map +1 -1
  71. package/Cameras/Inputs/geospatialCameraKeyboardInput.d.ts +2 -0
  72. package/Cameras/Inputs/geospatialCameraKeyboardInput.js +291 -246
  73. package/Cameras/Inputs/geospatialCameraKeyboardInput.js.map +1 -1
  74. package/Cameras/Inputs/geospatialCameraPointersInput.d.ts +11 -1
  75. package/Cameras/Inputs/geospatialCameraPointersInput.js +18 -2
  76. package/Cameras/Inputs/geospatialCameraPointersInput.js.map +1 -1
  77. package/Cameras/Inputs/orbitCameraPointersInput.js +112 -96
  78. package/Cameras/Inputs/orbitCameraPointersInput.js.map +1 -1
  79. package/Cameras/VR/vrExperienceHelper.d.ts +0 -2
  80. package/Cameras/VR/vrExperienceHelper.js +0 -2
  81. package/Cameras/VR/vrExperienceHelper.js.map +1 -1
  82. package/Cameras/VR/vrExperienceHelper.pure.js +5 -0
  83. package/Cameras/VR/vrExperienceHelper.pure.js.map +1 -1
  84. package/Cameras/arcRotateCamera.pure.js +1559 -1479
  85. package/Cameras/arcRotateCamera.pure.js.map +1 -1
  86. package/Cameras/camera.pure.js +1225 -1178
  87. package/Cameras/camera.pure.js.map +1 -1
  88. package/Cameras/flyCamera.pure.js +369 -351
  89. package/Cameras/flyCamera.pure.js.map +1 -1
  90. package/Cameras/followCamera.pure.js +229 -192
  91. package/Cameras/followCamera.pure.js.map +1 -1
  92. package/Cameras/freeCamera.pure.js +373 -351
  93. package/Cameras/freeCamera.pure.js.map +1 -1
  94. package/Cameras/geospatialCamera.pure.d.ts +30 -7
  95. package/Cameras/geospatialCamera.pure.js +502 -457
  96. package/Cameras/geospatialCamera.pure.js.map +1 -1
  97. package/Cameras/geospatialCameraMovement.js +2 -2
  98. package/Cameras/geospatialCameraMovement.js.map +1 -1
  99. package/Cameras/targetCamera.pure.d.ts +7 -0
  100. package/Cameras/targetCamera.pure.js +550 -509
  101. package/Cameras/targetCamera.pure.js.map +1 -1
  102. package/Cameras/universalCamera.pure.js +98 -85
  103. package/Cameras/universalCamera.pure.js.map +1 -1
  104. package/Collisions/gpuPicker.d.ts +111 -4
  105. package/Collisions/gpuPicker.js +696 -119
  106. package/Collisions/gpuPicker.js.map +1 -1
  107. package/Compute/computeShader.pure.js +372 -355
  108. package/Compute/computeShader.pure.js.map +1 -1
  109. package/Culling/Helper/transformFeedbackBoundingHelper.pure.js +2 -2
  110. package/Decorators/nodeDecorator.d.ts +11 -1
  111. package/Decorators/nodeDecorator.js +43 -6
  112. package/Decorators/nodeDecorator.js.map +1 -1
  113. package/Engines/AbstractEngine/abstractEngine.loadFile.pure.js +8 -0
  114. package/Engines/AbstractEngine/abstractEngine.loadFile.pure.js.map +1 -1
  115. package/Engines/Native/nativeHelpers.js +15 -0
  116. package/Engines/Native/nativeHelpers.js.map +1 -1
  117. package/Engines/Native/nativeInterfaces.d.ts +7 -2
  118. package/Engines/Native/nativeInterfaces.js.map +1 -1
  119. package/Engines/Native/nativeRenderTargetWrapper.d.ts +5 -0
  120. package/Engines/Native/nativeRenderTargetWrapper.js +35 -1
  121. package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
  122. package/Engines/Processors/shaderProcessor.js +5 -3
  123. package/Engines/Processors/shaderProcessor.js.map +1 -1
  124. package/Engines/WebGPU/Extensions/engine.videoTexture.pure.js +16 -3
  125. package/Engines/WebGPU/Extensions/engine.videoTexture.pure.js.map +1 -1
  126. package/Engines/WebGPU/webgpuClearQuad.pure.js +7 -1
  127. package/Engines/WebGPU/webgpuClearQuad.pure.js.map +1 -1
  128. package/Engines/abstractEngine.functions.d.ts +8 -2
  129. package/Engines/abstractEngine.functions.js +12 -4
  130. package/Engines/abstractEngine.functions.js.map +1 -1
  131. package/Engines/abstractEngine.pure.d.ts +20 -1
  132. package/Engines/abstractEngine.pure.js +21 -134
  133. package/Engines/abstractEngine.pure.js.map +1 -1
  134. package/Engines/engine.d.ts +208 -0
  135. package/Engines/engine.pure.js +0 -15
  136. package/Engines/engine.pure.js.map +1 -1
  137. package/Engines/nullEngine.pure.d.ts +66 -0
  138. package/Engines/nullEngine.pure.js +97 -0
  139. package/Engines/nullEngine.pure.js.map +1 -1
  140. package/Engines/thinEngine.pure.d.ts +0 -13
  141. package/Engines/thinEngine.pure.js +4 -23
  142. package/Engines/thinEngine.pure.js.map +1 -1
  143. package/Engines/thinNativeEngine.d.ts +0 -1
  144. package/Engines/thinNativeEngine.js +0 -1
  145. package/Engines/thinNativeEngine.js.map +1 -1
  146. package/Engines/thinNativeEngine.pure.d.ts +27 -0
  147. package/Engines/thinNativeEngine.pure.js +383 -17
  148. package/Engines/thinNativeEngine.pure.js.map +1 -1
  149. package/Engines/webgpuEngine.d.ts +1 -0
  150. package/Engines/webgpuEngine.js +1 -0
  151. package/Engines/webgpuEngine.js.map +1 -1
  152. package/Engines/webgpuEngine.pure.d.ts +9 -0
  153. package/Engines/webgpuEngine.pure.js +7 -0
  154. package/Engines/webgpuEngine.pure.js.map +1 -1
  155. package/FlowGraph/flowGraph.js +9 -0
  156. package/FlowGraph/flowGraph.js.map +1 -1
  157. package/FlowGraph/flowGraphContext.js +597 -584
  158. package/FlowGraph/flowGraphContext.js.map +1 -1
  159. package/FlowGraph/flowGraphDataConnection.pure.d.ts +14 -0
  160. package/FlowGraph/flowGraphDataConnection.pure.js +38 -1
  161. package/FlowGraph/flowGraphDataConnection.pure.js.map +1 -1
  162. package/FlowGraph/serialization.d.ts +11 -0
  163. package/FlowGraph/serialization.js +11 -1
  164. package/FlowGraph/serialization.js.map +1 -1
  165. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.pure.js +182 -170
  166. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.pure.js.map +1 -1
  167. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.pure.js +196 -184
  168. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.pure.js.map +1 -1
  169. package/FrameGraph/Node/Blocks/Layers/selectionOutlineLayerBlock.pure.js +222 -210
  170. package/FrameGraph/Node/Blocks/Layers/selectionOutlineLayerBlock.pure.js.map +1 -1
  171. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js +123 -111
  172. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js.map +1 -1
  173. package/FrameGraph/Node/Blocks/PostProcesses/baseWithPropertiesPostProcessBlock.js +158 -146
  174. package/FrameGraph/Node/Blocks/PostProcesses/baseWithPropertiesPostProcessBlock.js.map +1 -1
  175. package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.pure.js +63 -51
  176. package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.pure.js.map +1 -1
  177. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.pure.js +122 -110
  178. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.pure.js.map +1 -1
  179. package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.pure.js +76 -64
  180. package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.pure.js.map +1 -1
  181. package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.pure.js +89 -77
  182. package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.pure.js.map +1 -1
  183. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.pure.js +134 -122
  184. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.pure.js.map +1 -1
  185. package/FrameGraph/Node/Blocks/PostProcesses/colorCorrectionPostProcessBlock.pure.js +58 -46
  186. package/FrameGraph/Node/Blocks/PostProcesses/colorCorrectionPostProcessBlock.pure.js.map +1 -1
  187. package/FrameGraph/Node/Blocks/PostProcesses/convolutionPostProcessBlock.pure.js +107 -95
  188. package/FrameGraph/Node/Blocks/PostProcesses/convolutionPostProcessBlock.pure.js.map +1 -1
  189. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.pure.js +181 -169
  190. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.pure.js.map +1 -1
  191. package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.pure.js +63 -51
  192. package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.pure.js.map +1 -1
  193. package/FrameGraph/Node/Blocks/PostProcesses/filterPostProcessBlock.pure.js +63 -51
  194. package/FrameGraph/Node/Blocks/PostProcesses/filterPostProcessBlock.pure.js.map +1 -1
  195. package/FrameGraph/Node/Blocks/PostProcesses/grainPostProcessBlock.pure.js +76 -64
  196. package/FrameGraph/Node/Blocks/PostProcesses/grainPostProcessBlock.pure.js.map +1 -1
  197. package/FrameGraph/Node/Blocks/PostProcesses/imageProcessingPostProcessBlock.pure.js +246 -234
  198. package/FrameGraph/Node/Blocks/PostProcesses/imageProcessingPostProcessBlock.pure.js.map +1 -1
  199. package/FrameGraph/Node/Blocks/PostProcesses/motionBlurPostProcessBlock.pure.js +108 -96
  200. package/FrameGraph/Node/Blocks/PostProcesses/motionBlurPostProcessBlock.pure.js.map +1 -1
  201. package/FrameGraph/Node/Blocks/PostProcesses/screenSpaceCurvaturePostProcessBlock.pure.js +87 -75
  202. package/FrameGraph/Node/Blocks/PostProcesses/screenSpaceCurvaturePostProcessBlock.pure.js.map +1 -1
  203. package/FrameGraph/Node/Blocks/PostProcesses/sharpenPostProcessBlock.pure.js +76 -64
  204. package/FrameGraph/Node/Blocks/PostProcesses/sharpenPostProcessBlock.pure.js.map +1 -1
  205. package/FrameGraph/Node/Blocks/PostProcesses/ssao2PostProcessBlock.pure.js +313 -301
  206. package/FrameGraph/Node/Blocks/PostProcesses/ssao2PostProcessBlock.pure.js.map +1 -1
  207. package/FrameGraph/Node/Blocks/PostProcesses/ssrPostProcessBlock.pure.js +502 -490
  208. package/FrameGraph/Node/Blocks/PostProcesses/ssrPostProcessBlock.pure.js.map +1 -1
  209. package/FrameGraph/Node/Blocks/PostProcesses/taaPostProcessBlock.pure.js +147 -135
  210. package/FrameGraph/Node/Blocks/PostProcesses/taaPostProcessBlock.pure.js.map +1 -1
  211. package/FrameGraph/Node/Blocks/PostProcesses/tonemapPostProcessBlock.pure.js +90 -78
  212. package/FrameGraph/Node/Blocks/PostProcesses/tonemapPostProcessBlock.pure.js.map +1 -1
  213. package/FrameGraph/Node/Blocks/PostProcesses/volumetricLightingBlock.pure.js +179 -167
  214. package/FrameGraph/Node/Blocks/PostProcesses/volumetricLightingBlock.pure.js.map +1 -1
  215. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +462 -451
  216. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
  217. package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js +265 -253
  218. package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js.map +1 -1
  219. package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.pure.js +204 -192
  220. package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.pure.js.map +1 -1
  221. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js +611 -550
  222. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js.map +1 -1
  223. package/FrameGraph/Node/Blocks/Rendering/iblShadowsRendererBlock.pure.js +320 -308
  224. package/FrameGraph/Node/Blocks/Rendering/iblShadowsRendererBlock.pure.js.map +1 -1
  225. package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.pure.js +87 -75
  226. package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.pure.js.map +1 -1
  227. package/FrameGraph/Node/Blocks/Textures/clearBlock.pure.js +154 -142
  228. package/FrameGraph/Node/Blocks/Textures/clearBlock.pure.js.map +1 -1
  229. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.pure.js +150 -138
  230. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.pure.js.map +1 -1
  231. package/FrameGraph/Node/Blocks/inputBlock.pure.js +270 -256
  232. package/FrameGraph/Node/Blocks/inputBlock.pure.js.map +1 -1
  233. package/FrameGraph/Node/Blocks/lightingVolumeBlock.pure.js +95 -83
  234. package/FrameGraph/Node/Blocks/lightingVolumeBlock.pure.js.map +1 -1
  235. package/FrameGraph/Node/nodeRenderGraph.js +715 -693
  236. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  237. package/FrameGraph/Node/nodeRenderGraphBlock.js +548 -533
  238. package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -1
  239. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsAccumulationTask.d.ts +2 -2
  240. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsAccumulationTask.js +43 -51
  241. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsAccumulationTask.js.map +1 -1
  242. package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.d.ts +0 -1
  243. package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.js +0 -1
  244. package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.js.map +1 -1
  245. package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.pure.d.ts +0 -1
  246. package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.pure.js +66 -35
  247. package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.pure.js.map +1 -1
  248. package/Helpers/environmentHelper.js +2 -2
  249. package/Helpers/environmentHelper.js.map +1 -1
  250. package/Layers/effectLayer.js +529 -519
  251. package/Layers/effectLayer.js.map +1 -1
  252. package/Layers/glowLayer.pure.js +428 -413
  253. package/Layers/glowLayer.pure.js.map +1 -1
  254. package/Layers/highlightLayer.pure.js +473 -458
  255. package/Layers/highlightLayer.pure.js.map +1 -1
  256. package/Layers/selectionOutlineLayer.pure.js +360 -345
  257. package/Layers/selectionOutlineLayer.pure.js.map +1 -1
  258. package/Lights/Clustered/clusteredLightContainer.pure.d.ts +1 -1
  259. package/Lights/Clustered/clusteredLightContainer.pure.js +583 -558
  260. package/Lights/Clustered/clusteredLightContainer.pure.js.map +1 -1
  261. package/Lights/Shadows/shadowGenerator.js +6 -1
  262. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  263. package/Lights/areaLight.pure.js +61 -39
  264. package/Lights/areaLight.pure.js.map +1 -1
  265. package/Lights/directionalLight.pure.js +308 -284
  266. package/Lights/directionalLight.pure.js.map +1 -1
  267. package/Lights/hemisphericLight.pure.js +123 -104
  268. package/Lights/hemisphericLight.pure.js.map +1 -1
  269. package/Lights/light.d.ts +5 -3
  270. package/Lights/light.js +869 -827
  271. package/Lights/light.js.map +1 -1
  272. package/Lights/pointLight.pure.js +185 -174
  273. package/Lights/pointLight.pure.js.map +1 -1
  274. package/Lights/rectAreaLight.pure.d.ts +17 -0
  275. package/Lights/rectAreaLight.pure.js +238 -159
  276. package/Lights/rectAreaLight.pure.js.map +1 -1
  277. package/Lights/shadowLight.js +280 -268
  278. package/Lights/shadowLight.js.map +1 -1
  279. package/Lights/spotLight.pure.js +460 -427
  280. package/Lights/spotLight.pure.js.map +1 -1
  281. package/Loading/Plugins/babylonFileLoader.pure.js +17 -5
  282. package/Loading/Plugins/babylonFileLoader.pure.js.map +1 -1
  283. package/Loading/sceneLoader.d.ts +5 -1
  284. package/Loading/sceneLoader.js +299 -402
  285. package/Loading/sceneLoader.js.map +1 -1
  286. package/Materials/Background/backgroundMaterial.pure.d.ts +18 -18
  287. package/Materials/Background/backgroundMaterial.pure.js +949 -794
  288. package/Materials/Background/backgroundMaterial.pure.js.map +1 -1
  289. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.d.ts +15 -0
  290. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js +34 -1
  291. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js.map +1 -1
  292. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.d.ts +9 -0
  293. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +26 -2
  294. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
  295. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.d.ts +2 -1
  296. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js +169 -149
  297. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js.map +1 -1
  298. package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.js +1 -1
  299. package/Materials/Node/Blocks/Dual/lightBlock.pure.js +442 -429
  300. package/Materials/Node/Blocks/Dual/lightBlock.pure.js.map +1 -1
  301. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.pure.js +396 -383
  302. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.pure.js.map +1 -1
  303. package/Materials/Node/Blocks/Dual/sceneDepthBlock.pure.js +237 -220
  304. package/Materials/Node/Blocks/Dual/sceneDepthBlock.pure.js.map +1 -1
  305. package/Materials/Node/Blocks/Dual/textureBlock.pure.js +1 -1
  306. package/Materials/Node/Blocks/Fragment/ambientOcclusionBlock.pure.js +150 -133
  307. package/Materials/Node/Blocks/Fragment/ambientOcclusionBlock.pure.js.map +1 -1
  308. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js +265 -250
  309. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js.map +1 -1
  310. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.pure.js +159 -142
  311. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.pure.js.map +1 -1
  312. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.pure.js +214 -201
  313. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.pure.js.map +1 -1
  314. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.pure.js +419 -400
  315. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.pure.js.map +1 -1
  316. package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js +3 -1
  317. package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js.map +1 -1
  318. package/Materials/Node/Blocks/PBR/clearCoatBlock.pure.js +302 -289
  319. package/Materials/Node/Blocks/PBR/clearCoatBlock.pure.js.map +1 -1
  320. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.js +1327 -1272
  321. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.js.map +1 -1
  322. package/Materials/Node/Blocks/PBR/reflectionBlock.pure.js +352 -337
  323. package/Materials/Node/Blocks/PBR/reflectionBlock.pure.js.map +1 -1
  324. package/Materials/Node/Blocks/PBR/refractionBlock.pure.js +297 -277
  325. package/Materials/Node/Blocks/PBR/refractionBlock.pure.js.map +1 -1
  326. package/Materials/Node/Blocks/PBR/sheenBlock.pure.js +146 -131
  327. package/Materials/Node/Blocks/PBR/sheenBlock.pure.js.map +1 -1
  328. package/Materials/Node/Blocks/PBR/subSurfaceBlock.pure.js +158 -145
  329. package/Materials/Node/Blocks/PBR/subSurfaceBlock.pure.js.map +1 -1
  330. package/Materials/Node/Blocks/clampBlock.pure.js +92 -77
  331. package/Materials/Node/Blocks/clampBlock.pure.js.map +1 -1
  332. package/Materials/Node/Blocks/cloudBlock.pure.js +145 -132
  333. package/Materials/Node/Blocks/cloudBlock.pure.js.map +1 -1
  334. package/Materials/Node/Blocks/conditionalBlock.pure.js +182 -169
  335. package/Materials/Node/Blocks/conditionalBlock.pure.js.map +1 -1
  336. package/Materials/Node/Blocks/curveBlock.pure.js +259 -246
  337. package/Materials/Node/Blocks/curveBlock.pure.js.map +1 -1
  338. package/Materials/Node/Blocks/debugBlock.pure.js +119 -106
  339. package/Materials/Node/Blocks/debugBlock.pure.js.map +1 -1
  340. package/Materials/Node/Blocks/loopBlock.pure.js +123 -110
  341. package/Materials/Node/Blocks/loopBlock.pure.js.map +1 -1
  342. package/Materials/Node/Blocks/meshAttributeExistsBlock.pure.js +185 -172
  343. package/Materials/Node/Blocks/meshAttributeExistsBlock.pure.js.map +1 -1
  344. package/Materials/Node/Blocks/remapBlock.pure.js +127 -112
  345. package/Materials/Node/Blocks/remapBlock.pure.js.map +1 -1
  346. package/Materials/Node/Blocks/transformBlock.pure.js +196 -185
  347. package/Materials/Node/Blocks/transformBlock.pure.js.map +1 -1
  348. package/Materials/Node/Blocks/triPlanarBlock.pure.js +451 -438
  349. package/Materials/Node/Blocks/triPlanarBlock.pure.js.map +1 -1
  350. package/Materials/Node/Blocks/trigonometryBlock.pure.js +184 -171
  351. package/Materials/Node/Blocks/trigonometryBlock.pure.js.map +1 -1
  352. package/Materials/Node/Blocks/waveBlock.pure.js +97 -84
  353. package/Materials/Node/Blocks/waveBlock.pure.js.map +1 -1
  354. package/Materials/Node/Blocks/worleyNoise3DBlock.pure.js +276 -263
  355. package/Materials/Node/Blocks/worleyNoise3DBlock.pure.js.map +1 -1
  356. package/Materials/Node/nodeMaterial.pure.js +1765 -1737
  357. package/Materials/Node/nodeMaterial.pure.js.map +1 -1
  358. package/Materials/Node/nodeMaterialBuildState.d.ts +3 -3
  359. package/Materials/PBR/openpbrMaterial.pure.d.ts +102 -102
  360. package/Materials/PBR/openpbrMaterial.pure.js +3115 -2243
  361. package/Materials/PBR/openpbrMaterial.pure.js.map +1 -1
  362. package/Materials/PBR/pbrAnisotropicConfiguration.d.ts +3 -3
  363. package/Materials/PBR/pbrAnisotropicConfiguration.js +255 -227
  364. package/Materials/PBR/pbrAnisotropicConfiguration.js.map +1 -1
  365. package/Materials/PBR/pbrBRDFConfiguration.d.ts +9 -9
  366. package/Materials/PBR/pbrBRDFConfiguration.js +203 -155
  367. package/Materials/PBR/pbrBRDFConfiguration.js.map +1 -1
  368. package/Materials/PBR/pbrBaseMaterial.pure.d.ts +1 -1
  369. package/Materials/PBR/pbrBaseMaterial.pure.js +1751 -1736
  370. package/Materials/PBR/pbrBaseMaterial.pure.js.map +1 -1
  371. package/Materials/PBR/pbrBaseSimpleMaterial.d.ts +13 -13
  372. package/Materials/PBR/pbrBaseSimpleMaterial.js +205 -117
  373. package/Materials/PBR/pbrBaseSimpleMaterial.js.map +1 -1
  374. package/Materials/PBR/pbrClearCoatConfiguration.d.ts +9 -9
  375. package/Materials/PBR/pbrClearCoatConfiguration.js +464 -406
  376. package/Materials/PBR/pbrClearCoatConfiguration.js.map +1 -1
  377. package/Materials/PBR/pbrIridescenceConfiguration.d.ts +3 -3
  378. package/Materials/PBR/pbrIridescenceConfiguration.js +271 -239
  379. package/Materials/PBR/pbrIridescenceConfiguration.js.map +1 -1
  380. package/Materials/PBR/pbrMaterial.pure.d.ts +66 -66
  381. package/Materials/PBR/pbrMaterial.pure.js +1041 -685
  382. package/Materials/PBR/pbrMaterial.pure.js.map +1 -1
  383. package/Materials/PBR/pbrMetallicRoughnessMaterial.pure.d.ts +5 -5
  384. package/Materials/PBR/pbrMetallicRoughnessMaterial.pure.js +176 -115
  385. package/Materials/PBR/pbrMetallicRoughnessMaterial.pure.js.map +1 -1
  386. package/Materials/PBR/pbrSheenConfiguration.d.ts +7 -7
  387. package/Materials/PBR/pbrSheenConfiguration.js +314 -270
  388. package/Materials/PBR/pbrSheenConfiguration.js.map +1 -1
  389. package/Materials/PBR/pbrSpecularGlossinessMaterial.pure.d.ts +5 -5
  390. package/Materials/PBR/pbrSpecularGlossinessMaterial.pure.js +172 -117
  391. package/Materials/PBR/pbrSpecularGlossinessMaterial.pure.js.map +1 -1
  392. package/Materials/PBR/pbrSubSurfaceConfiguration.d.ts +16 -16
  393. package/Materials/PBR/pbrSubSurfaceConfiguration.js +864 -764
  394. package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
  395. package/Materials/Textures/HTML/htmlInCanvasPolyfill.d.ts +43 -0
  396. package/Materials/Textures/HTML/htmlInCanvasPolyfill.js +64 -0
  397. package/Materials/Textures/HTML/htmlInCanvasPolyfill.js.map +1 -0
  398. package/Materials/Textures/HTML/htmlInteractionManager.d.ts +69 -0
  399. package/Materials/Textures/HTML/htmlInteractionManager.js +130 -0
  400. package/Materials/Textures/HTML/htmlInteractionManager.js.map +1 -0
  401. package/Materials/Textures/HTML/htmlRaycastInteractionManager.d.ts +84 -0
  402. package/Materials/Textures/HTML/htmlRaycastInteractionManager.js +246 -0
  403. package/Materials/Textures/HTML/htmlRaycastInteractionManager.js.map +1 -0
  404. package/Materials/Textures/HTML/htmlTexture.d.ts +148 -0
  405. package/Materials/Textures/HTML/htmlTexture.js +455 -0
  406. package/Materials/Textures/HTML/htmlTexture.js.map +1 -0
  407. package/Materials/Textures/HTML/index.d.ts +4 -0
  408. package/Materials/Textures/HTML/index.js +5 -0
  409. package/Materials/Textures/HTML/index.js.map +1 -0
  410. package/Materials/Textures/HTML/pure.d.ts +5 -0
  411. package/Materials/Textures/HTML/pure.js +6 -0
  412. package/Materials/Textures/HTML/pure.js.map +1 -0
  413. package/Materials/Textures/Procedurals/proceduralTexture.pure.js +671 -643
  414. package/Materials/Textures/Procedurals/proceduralTexture.pure.js.map +1 -1
  415. package/Materials/Textures/baseTexture.pure.js +880 -825
  416. package/Materials/Textures/baseTexture.pure.js.map +1 -1
  417. package/Materials/Textures/cubeTexture.d.ts +0 -1
  418. package/Materials/Textures/cubeTexture.js +0 -1
  419. package/Materials/Textures/cubeTexture.js.map +1 -1
  420. package/Materials/Textures/cubeTexture.pure.js +368 -333
  421. package/Materials/Textures/cubeTexture.pure.js.map +1 -1
  422. package/Materials/Textures/dynamicTexture.d.ts +0 -1
  423. package/Materials/Textures/dynamicTexture.js +0 -1
  424. package/Materials/Textures/dynamicTexture.js.map +1 -1
  425. package/Materials/Textures/dynamicTexture.pure.js +2 -0
  426. package/Materials/Textures/dynamicTexture.pure.js.map +1 -1
  427. package/Materials/Textures/htmlElementTexture.d.ts +0 -2
  428. package/Materials/Textures/htmlElementTexture.js +0 -2
  429. package/Materials/Textures/htmlElementTexture.js.map +1 -1
  430. package/Materials/Textures/htmlElementTexture.pure.js +4 -0
  431. package/Materials/Textures/htmlElementTexture.pure.js.map +1 -1
  432. package/Materials/Textures/index.d.ts +1 -0
  433. package/Materials/Textures/index.js +1 -1
  434. package/Materials/Textures/index.js.map +1 -1
  435. package/Materials/Textures/multiRenderTarget.d.ts +0 -1
  436. package/Materials/Textures/multiRenderTarget.js +0 -1
  437. package/Materials/Textures/multiRenderTarget.js.map +1 -1
  438. package/Materials/Textures/multiRenderTarget.pure.js +2 -0
  439. package/Materials/Textures/multiRenderTarget.pure.js.map +1 -1
  440. package/Materials/Textures/pure.d.ts +1 -0
  441. package/Materials/Textures/pure.js +1 -0
  442. package/Materials/Textures/pure.js.map +1 -1
  443. package/Materials/Textures/texture.pure.js +961 -923
  444. package/Materials/Textures/texture.pure.js.map +1 -1
  445. package/Materials/Textures/videoTexture.pure.d.ts +3 -0
  446. package/Materials/Textures/videoTexture.pure.js +450 -401
  447. package/Materials/Textures/videoTexture.pure.js.map +1 -1
  448. package/Materials/colorCurves.pure.js +510 -477
  449. package/Materials/colorCurves.pure.js.map +1 -1
  450. package/Materials/effect.pure.js +0 -7
  451. package/Materials/effect.pure.js.map +1 -1
  452. package/Materials/imageProcessing.js +12 -4
  453. package/Materials/imageProcessing.js.map +1 -1
  454. package/Materials/imageProcessingConfiguration.pure.js +647 -587
  455. package/Materials/imageProcessingConfiguration.pure.js.map +1 -1
  456. package/Materials/material.decalMapConfiguration.pure.d.ts +2 -2
  457. package/Materials/material.decalMapConfiguration.pure.js +149 -130
  458. package/Materials/material.decalMapConfiguration.pure.js.map +1 -1
  459. package/Materials/material.detailMapConfiguration.d.ts +3 -3
  460. package/Materials/material.detailMapConfiguration.js +213 -175
  461. package/Materials/material.detailMapConfiguration.js.map +1 -1
  462. package/Materials/material.pure.js +1815 -1721
  463. package/Materials/material.pure.js.map +1 -1
  464. package/Materials/materialPluginBase.pure.js +270 -249
  465. package/Materials/materialPluginBase.pure.js.map +1 -1
  466. package/Materials/materialPluginManager.pure.js +18 -8
  467. package/Materials/materialPluginManager.pure.js.map +1 -1
  468. package/Materials/materialStencilState.js +211 -200
  469. package/Materials/materialStencilState.js.map +1 -1
  470. package/Materials/meshDebugPluginMaterial.pure.d.ts +2 -2
  471. package/Materials/meshDebugPluginMaterial.pure.js +397 -275
  472. package/Materials/meshDebugPluginMaterial.pure.js.map +1 -1
  473. package/Materials/standardMaterial.pure.d.ts +32 -32
  474. package/Materials/standardMaterial.pure.js +1804 -1394
  475. package/Materials/standardMaterial.pure.js.map +1 -1
  476. package/Maths/math.color.pure.js +5 -5
  477. package/Maths/math.functions.js +38 -30
  478. package/Maths/math.functions.js.map +1 -1
  479. package/Maths/math.vector.pure.js +25 -25
  480. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +18 -8
  481. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
  482. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +86 -1
  483. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +255 -104
  484. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
  485. package/Meshes/GaussianSplatting/gaussianSplattingSortWorker.d.ts +39 -0
  486. package/Meshes/GaussianSplatting/gaussianSplattingSortWorker.js +322 -0
  487. package/Meshes/GaussianSplatting/gaussianSplattingSortWorker.js.map +1 -0
  488. package/Meshes/GreasedLine/greasedLineMesh.pure.js +4 -4
  489. package/Meshes/GreasedLine/greasedLineRibbonMesh.pure.js +3 -3
  490. package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js +107 -94
  491. package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js.map +1 -1
  492. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.pure.js +276 -263
  493. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.pure.js.map +1 -1
  494. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.pure.js +247 -232
  495. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.pure.js.map +1 -1
  496. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.pure.js +299 -284
  497. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.pure.js.map +1 -1
  498. package/Meshes/Node/Blocks/Set/aggregatorBlock.pure.js +196 -181
  499. package/Meshes/Node/Blocks/Set/aggregatorBlock.pure.js.map +1 -1
  500. package/Meshes/Node/Blocks/Set/latticeBlock.pure.js +198 -179
  501. package/Meshes/Node/Blocks/Set/latticeBlock.pure.js.map +1 -1
  502. package/Meshes/Node/Blocks/Set/setColorsBlock.pure.js +151 -138
  503. package/Meshes/Node/Blocks/Set/setColorsBlock.pure.js.map +1 -1
  504. package/Meshes/Node/Blocks/Set/setMaterialIDBlock.pure.js +107 -94
  505. package/Meshes/Node/Blocks/Set/setMaterialIDBlock.pure.js.map +1 -1
  506. package/Meshes/Node/Blocks/Set/setNormalsBlock.pure.js +138 -125
  507. package/Meshes/Node/Blocks/Set/setNormalsBlock.pure.js.map +1 -1
  508. package/Meshes/Node/Blocks/Set/setPositionsBlock.pure.js +213 -200
  509. package/Meshes/Node/Blocks/Set/setPositionsBlock.pure.js.map +1 -1
  510. package/Meshes/Node/Blocks/Set/setTangentsBlock.pure.js +138 -125
  511. package/Meshes/Node/Blocks/Set/setTangentsBlock.pure.js.map +1 -1
  512. package/Meshes/Node/Blocks/Set/setUVsBlock.pure.js +179 -164
  513. package/Meshes/Node/Blocks/Set/setUVsBlock.pure.js.map +1 -1
  514. package/Meshes/Node/Blocks/Sources/boxBlock.pure.js +183 -170
  515. package/Meshes/Node/Blocks/Sources/boxBlock.pure.js.map +1 -1
  516. package/Meshes/Node/Blocks/Sources/capsuleBlock.pure.js +125 -112
  517. package/Meshes/Node/Blocks/Sources/capsuleBlock.pure.js.map +1 -1
  518. package/Meshes/Node/Blocks/Sources/cylinderBlock.pure.js +153 -140
  519. package/Meshes/Node/Blocks/Sources/cylinderBlock.pure.js.map +1 -1
  520. package/Meshes/Node/Blocks/Sources/discBlock.pure.js +112 -99
  521. package/Meshes/Node/Blocks/Sources/discBlock.pure.js.map +1 -1
  522. package/Meshes/Node/Blocks/Sources/gridBlock.pure.js +133 -120
  523. package/Meshes/Node/Blocks/Sources/gridBlock.pure.js.map +1 -1
  524. package/Meshes/Node/Blocks/Sources/icoSphereBlock.pure.js +128 -115
  525. package/Meshes/Node/Blocks/Sources/icoSphereBlock.pure.js.map +1 -1
  526. package/Meshes/Node/Blocks/Sources/meshBlock.pure.js +116 -103
  527. package/Meshes/Node/Blocks/Sources/meshBlock.pure.js.map +1 -1
  528. package/Meshes/Node/Blocks/Sources/planeBlock.pure.js +160 -147
  529. package/Meshes/Node/Blocks/Sources/planeBlock.pure.js.map +1 -1
  530. package/Meshes/Node/Blocks/Sources/sphereBlock.pure.js +144 -131
  531. package/Meshes/Node/Blocks/Sources/sphereBlock.pure.js.map +1 -1
  532. package/Meshes/Node/Blocks/Sources/torusBlock.pure.js +112 -99
  533. package/Meshes/Node/Blocks/Sources/torusBlock.pure.js.map +1 -1
  534. package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.pure.js +200 -185
  535. package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.pure.js.map +1 -1
  536. package/Meshes/Node/Blocks/bevelBlock.pure.js +111 -98
  537. package/Meshes/Node/Blocks/bevelBlock.pure.js.map +1 -1
  538. package/Meshes/Node/Blocks/booleanGeometryBlock.pure.js +182 -165
  539. package/Meshes/Node/Blocks/booleanGeometryBlock.pure.js.map +1 -1
  540. package/Meshes/Node/Blocks/cleanGeometryBlock.pure.js +89 -76
  541. package/Meshes/Node/Blocks/cleanGeometryBlock.pure.js.map +1 -1
  542. package/Meshes/Node/Blocks/conditionBlock.pure.js +184 -169
  543. package/Meshes/Node/Blocks/conditionBlock.pure.js.map +1 -1
  544. package/Meshes/Node/Blocks/extrudeGeometryBlock.pure.js +270 -255
  545. package/Meshes/Node/Blocks/extrudeGeometryBlock.pure.js.map +1 -1
  546. package/Meshes/Node/Blocks/geometryCollectionBlock.pure.js +172 -159
  547. package/Meshes/Node/Blocks/geometryCollectionBlock.pure.js.map +1 -1
  548. package/Meshes/Node/Blocks/geometryCurveBlock.pure.js +230 -217
  549. package/Meshes/Node/Blocks/geometryCurveBlock.pure.js.map +1 -1
  550. package/Meshes/Node/Blocks/geometryEaseBlock.pure.js +256 -245
  551. package/Meshes/Node/Blocks/geometryEaseBlock.pure.js.map +1 -1
  552. package/Meshes/Node/Blocks/geometryOptimizeBlock.pure.js +206 -189
  553. package/Meshes/Node/Blocks/geometryOptimizeBlock.pure.js.map +1 -1
  554. package/Meshes/Node/Blocks/geometryTransformBlock.pure.js +166 -153
  555. package/Meshes/Node/Blocks/geometryTransformBlock.pure.js.map +1 -1
  556. package/Meshes/Node/Blocks/geometryTrigonometryBlock.pure.js +221 -208
  557. package/Meshes/Node/Blocks/geometryTrigonometryBlock.pure.js.map +1 -1
  558. package/Meshes/Node/Blocks/mappingBlock.pure.js +150 -137
  559. package/Meshes/Node/Blocks/mappingBlock.pure.js.map +1 -1
  560. package/Meshes/Node/Blocks/mathBlock.pure.js +269 -256
  561. package/Meshes/Node/Blocks/mathBlock.pure.js.map +1 -1
  562. package/Meshes/Node/Blocks/mergeGeometryBlock.pure.js +141 -128
  563. package/Meshes/Node/Blocks/mergeGeometryBlock.pure.js.map +1 -1
  564. package/Meshes/Node/Blocks/randomBlock.pure.js +161 -148
  565. package/Meshes/Node/Blocks/randomBlock.pure.js.map +1 -1
  566. package/Meshes/Node/Blocks/subdivideBlock.pure.js +102 -87
  567. package/Meshes/Node/Blocks/subdivideBlock.pure.js.map +1 -1
  568. package/Meshes/Node/nodeGeometry.js +560 -538
  569. package/Meshes/Node/nodeGeometry.js.map +1 -1
  570. package/Meshes/Node/nodeGeometryBlock.js +473 -458
  571. package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
  572. package/Meshes/abstractMesh.pure.js +2218 -2207
  573. package/Meshes/abstractMesh.pure.js.map +1 -1
  574. package/Meshes/geometry.js +30 -15
  575. package/Meshes/geometry.js.map +1 -1
  576. package/Meshes/mesh.pure.js +26 -14
  577. package/Meshes/mesh.pure.js.map +1 -1
  578. package/Meshes/mesh.vertexData.js +1665 -1655
  579. package/Meshes/mesh.vertexData.js.map +1 -1
  580. package/Meshes/transformNode.pure.js +1400 -1372
  581. package/Meshes/transformNode.pure.js.map +1 -1
  582. package/Misc/decorators.d.ts +34 -19
  583. package/Misc/decorators.functions.d.ts +33 -2
  584. package/Misc/decorators.functions.js +114 -35
  585. package/Misc/decorators.functions.js.map +1 -1
  586. package/Misc/decorators.js +96 -68
  587. package/Misc/decorators.js.map +1 -1
  588. package/Misc/decorators.serialization.js +47 -40
  589. package/Misc/decorators.serialization.js.map +1 -1
  590. package/Misc/decorators.serializationUtilities.d.ts +24 -0
  591. package/Misc/decorators.serializationUtilities.js +20 -0
  592. package/Misc/decorators.serializationUtilities.js.map +1 -0
  593. package/Misc/dumpTools.pure.js +43 -33
  594. package/Misc/dumpTools.pure.js.map +1 -1
  595. package/Misc/fileTools.pure.js +8 -0
  596. package/Misc/fileTools.pure.js.map +1 -1
  597. package/Misc/observable.pure.js +0 -7
  598. package/Misc/observable.pure.js.map +1 -1
  599. package/Misc/snapshotRenderingHelper.d.ts +4 -1
  600. package/Misc/snapshotRenderingHelper.js.map +1 -1
  601. package/Misc/symbolMetadataPolyfill.d.ts +11 -0
  602. package/Misc/symbolMetadataPolyfill.js +22 -0
  603. package/Misc/symbolMetadataPolyfill.js.map +1 -0
  604. package/Misc/tools.pure.js +2 -2
  605. package/Misc/tools.pure.js.map +1 -1
  606. package/Morph/morphTarget.js +382 -365
  607. package/Morph/morphTarget.js.map +1 -1
  608. package/Particles/Node/Blocks/Conditions/particleConditionBlock.pure.js +160 -145
  609. package/Particles/Node/Blocks/Conditions/particleConditionBlock.pure.js.map +1 -1
  610. package/Particles/Node/Blocks/Emitters/coneShapeBlock.pure.js +187 -174
  611. package/Particles/Node/Blocks/Emitters/coneShapeBlock.pure.js.map +1 -1
  612. package/Particles/Node/Blocks/Emitters/meshShapeBlock.pure.js +238 -219
  613. package/Particles/Node/Blocks/Emitters/meshShapeBlock.pure.js.map +1 -1
  614. package/Particles/Node/Blocks/Emitters/setupSpriteSheetBlock.pure.js +140 -115
  615. package/Particles/Node/Blocks/Emitters/setupSpriteSheetBlock.pure.js.map +1 -1
  616. package/Particles/Node/Blocks/Emitters/sphereShapeBlock.pure.js +157 -144
  617. package/Particles/Node/Blocks/Emitters/sphereShapeBlock.pure.js.map +1 -1
  618. package/Particles/Node/Blocks/Triggers/particleTriggerBlock.pure.js +133 -119
  619. package/Particles/Node/Blocks/Triggers/particleTriggerBlock.pure.js.map +1 -1
  620. package/Particles/Node/Blocks/Update/alignAngleBlock.pure.js +93 -80
  621. package/Particles/Node/Blocks/Update/alignAngleBlock.pure.js.map +1 -1
  622. package/Particles/Node/Blocks/particleDebugBlock.pure.js +117 -105
  623. package/Particles/Node/Blocks/particleDebugBlock.pure.js.map +1 -1
  624. package/Particles/Node/Blocks/particleFloatToIntBlock.pure.js +105 -92
  625. package/Particles/Node/Blocks/particleFloatToIntBlock.pure.js.map +1 -1
  626. package/Particles/Node/Blocks/particleGradientValueBlock.pure.js +82 -69
  627. package/Particles/Node/Blocks/particleGradientValueBlock.pure.js.map +1 -1
  628. package/Particles/Node/Blocks/particleLocalVariableBlock.pure.js +113 -101
  629. package/Particles/Node/Blocks/particleLocalVariableBlock.pure.js.map +1 -1
  630. package/Particles/Node/Blocks/particleMathBlock.pure.js +278 -265
  631. package/Particles/Node/Blocks/particleMathBlock.pure.js.map +1 -1
  632. package/Particles/Node/Blocks/particleNumberMathBlock.pure.js +155 -142
  633. package/Particles/Node/Blocks/particleNumberMathBlock.pure.js.map +1 -1
  634. package/Particles/Node/Blocks/particleRandomBlock.pure.js +156 -143
  635. package/Particles/Node/Blocks/particleRandomBlock.pure.js.map +1 -1
  636. package/Particles/Node/Blocks/particleTrigonometryBlock.pure.js +217 -204
  637. package/Particles/Node/Blocks/particleTrigonometryBlock.pure.js.map +1 -1
  638. package/Particles/Node/Blocks/particleVectorMathBlock.pure.js +106 -93
  639. package/Particles/Node/Blocks/particleVectorMathBlock.pure.js.map +1 -1
  640. package/Particles/Node/Blocks/systemBlock.pure.js +366 -330
  641. package/Particles/Node/Blocks/systemBlock.pure.js.map +1 -1
  642. package/Particles/Node/nodeParticleBlock.js +339 -324
  643. package/Particles/Node/nodeParticleBlock.js.map +1 -1
  644. package/Particles/Node/nodeParticleSystemSet.js +494 -473
  645. package/Particles/Node/nodeParticleSystemSet.js.map +1 -1
  646. package/Particles/gpuParticleSystem.d.ts +0 -1
  647. package/Particles/gpuParticleSystem.js +0 -1
  648. package/Particles/gpuParticleSystem.js.map +1 -1
  649. package/Particles/gpuParticleSystem.pure.d.ts +4 -3
  650. package/Particles/gpuParticleSystem.pure.js +27 -16
  651. package/Particles/gpuParticleSystem.pure.js.map +1 -1
  652. package/Particles/particleSystem.pure.js +57 -2
  653. package/Particles/particleSystem.pure.js.map +1 -1
  654. package/Particles/thinParticleSystem.d.ts +0 -1
  655. package/Particles/thinParticleSystem.js +0 -1
  656. package/Particles/thinParticleSystem.js.map +1 -1
  657. package/Particles/thinParticleSystem.pure.js +2 -0
  658. package/Particles/thinParticleSystem.pure.js.map +1 -1
  659. package/Particles/webgl2ParticleSystem.pure.js +2 -0
  660. package/Particles/webgl2ParticleSystem.pure.js.map +1 -1
  661. package/Physics/v1/physicsImpostor.pure.js +4 -4
  662. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.pure.js +675 -656
  663. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.pure.js.map +1 -1
  664. package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.d.ts +0 -1
  665. package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.js +0 -1
  666. package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.js.map +1 -1
  667. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.pure.js +521 -486
  668. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.pure.js.map +1 -1
  669. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.d.ts +0 -1
  670. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js +0 -1
  671. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js.map +1 -1
  672. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.pure.js +241 -220
  673. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.pure.js.map +1 -1
  674. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.pure.js +852 -835
  675. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.pure.js.map +1 -1
  676. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.pure.js +1135 -1073
  677. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.pure.js.map +1 -1
  678. package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.pure.js +319 -303
  679. package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.pure.js.map +1 -1
  680. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js +212 -199
  681. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
  682. package/PostProcesses/blackAndWhitePostProcess.pure.js +67 -55
  683. package/PostProcesses/blackAndWhitePostProcess.pure.js.map +1 -1
  684. package/PostProcesses/bloomMergePostProcess.pure.js +74 -62
  685. package/PostProcesses/bloomMergePostProcess.pure.js.map +1 -1
  686. package/PostProcesses/blurPostProcess.pure.js +127 -115
  687. package/PostProcesses/blurPostProcess.pure.js.map +1 -1
  688. package/PostProcesses/chromaticAberrationPostProcess.pure.js +130 -118
  689. package/PostProcesses/chromaticAberrationPostProcess.pure.js.map +1 -1
  690. package/PostProcesses/circleOfConfusionPostProcess.pure.js +115 -104
  691. package/PostProcesses/circleOfConfusionPostProcess.pure.js.map +1 -1
  692. package/PostProcesses/colorCorrectionPostProcess.pure.js +55 -43
  693. package/PostProcesses/colorCorrectionPostProcess.pure.js.map +1 -1
  694. package/PostProcesses/convolutionPostProcess.pure.js +96 -84
  695. package/PostProcesses/convolutionPostProcess.pure.js.map +1 -1
  696. package/PostProcesses/extractHighlightsPostProcess.pure.js +68 -57
  697. package/PostProcesses/extractHighlightsPostProcess.pure.js.map +1 -1
  698. package/PostProcesses/filterPostProcess.pure.js +66 -54
  699. package/PostProcesses/filterPostProcess.pure.js.map +1 -1
  700. package/PostProcesses/fxaaPostProcess.pure.js.map +1 -1
  701. package/PostProcesses/grainPostProcess.pure.js +82 -70
  702. package/PostProcesses/grainPostProcess.pure.js.map +1 -1
  703. package/PostProcesses/imageProcessingPostProcess.js +334 -322
  704. package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
  705. package/PostProcesses/motionBlurPostProcess.pure.js +246 -235
  706. package/PostProcesses/motionBlurPostProcess.pure.js.map +1 -1
  707. package/PostProcesses/passPostProcess.pure.js +75 -63
  708. package/PostProcesses/passPostProcess.pure.js.map +1 -1
  709. package/PostProcesses/postProcess.pure.js +899 -835
  710. package/PostProcesses/postProcess.pure.js.map +1 -1
  711. package/PostProcesses/refractionPostProcess.pure.js +114 -87
  712. package/PostProcesses/refractionPostProcess.pure.js.map +1 -1
  713. package/PostProcesses/screenSpaceCurvaturePostProcess.pure.js +108 -96
  714. package/PostProcesses/screenSpaceCurvaturePostProcess.pure.js.map +1 -1
  715. package/PostProcesses/screenSpaceReflectionPostProcess.pure.js +241 -220
  716. package/PostProcesses/screenSpaceReflectionPostProcess.pure.js.map +1 -1
  717. package/PostProcesses/sharpenPostProcess.pure.js +86 -74
  718. package/PostProcesses/sharpenPostProcess.pure.js.map +1 -1
  719. package/PostProcesses/tonemapPostProcess.pure.js +82 -70
  720. package/PostProcesses/tonemapPostProcess.pure.js.map +1 -1
  721. package/PostProcesses/volumetricLightScatteringPostProcess.pure.js +500 -465
  722. package/PostProcesses/volumetricLightScatteringPostProcess.pure.js.map +1 -1
  723. package/PostProcesses/vrMultiviewToSingleviewPostProcess.d.ts +0 -1
  724. package/PostProcesses/vrMultiviewToSingleviewPostProcess.js +0 -1
  725. package/PostProcesses/vrMultiviewToSingleviewPostProcess.js.map +1 -1
  726. package/PostProcesses/vrMultiviewToSingleviewPostProcess.pure.js +2 -0
  727. package/PostProcesses/vrMultiviewToSingleviewPostProcess.pure.js.map +1 -1
  728. package/Probes/reflectionProbe.pure.js +238 -224
  729. package/Probes/reflectionProbe.pure.js.map +1 -1
  730. package/Rendering/GlobalIllumination/giRSMManager.pure.d.ts +1 -1
  731. package/Rendering/GlobalIllumination/giRSMManager.pure.js +138 -105
  732. package/Rendering/GlobalIllumination/giRSMManager.pure.js.map +1 -1
  733. package/Rendering/IBLShadows/iblShadowsPluginMaterial.pure.d.ts +1 -1
  734. package/Rendering/IBLShadows/iblShadowsPluginMaterial.pure.js +155 -138
  735. package/Rendering/IBLShadows/iblShadowsPluginMaterial.pure.js.map +1 -1
  736. package/Rendering/IBLShadows/iblShadowsRenderPipeline.d.ts +0 -2
  737. package/Rendering/IBLShadows/iblShadowsRenderPipeline.js +0 -2
  738. package/Rendering/IBLShadows/iblShadowsRenderPipeline.js.map +1 -1
  739. package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js +5 -0
  740. package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js.map +1 -1
  741. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.d.ts +0 -1
  742. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js +0 -1
  743. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js.map +1 -1
  744. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.d.ts +1 -0
  745. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js +34 -0
  746. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js.map +1 -1
  747. package/Rendering/edgesRenderer.pure.js.map +1 -1
  748. package/Rendering/prePassRenderer.d.ts +0 -2
  749. package/Rendering/prePassRenderer.js +0 -2
  750. package/Rendering/prePassRenderer.js.map +1 -1
  751. package/Rendering/prePassRenderer.pure.js +2 -0
  752. package/Rendering/prePassRenderer.pure.js.map +1 -1
  753. package/Rendering/reflectiveShadowMap.pure.d.ts +1 -1
  754. package/Rendering/reflectiveShadowMap.pure.js +151 -130
  755. package/Rendering/reflectiveShadowMap.pure.js.map +1 -1
  756. package/Rendering/thinDepthPeelingRenderer.d.ts +0 -1
  757. package/Rendering/thinDepthPeelingRenderer.js +0 -1
  758. package/Rendering/thinDepthPeelingRenderer.js.map +1 -1
  759. package/Shaders/ShadersInclude/gaussianSplatting.js +1 -0
  760. package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
  761. package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js +35 -5
  762. package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
  763. package/Shaders/gaussianSplatting.fragment.js +17 -1
  764. package/Shaders/gaussianSplatting.fragment.js.map +1 -1
  765. package/Shaders/gaussianSplatting.vertex.js +1 -1
  766. package/Shaders/gaussianSplatting.vertex.js.map +1 -1
  767. package/Shaders/gaussianSplattingDepth.vertex.js +1 -1
  768. package/Shaders/gaussianSplattingDepth.vertex.js.map +1 -1
  769. package/Shaders/picking.fragment.js +39 -3
  770. package/Shaders/picking.fragment.js.map +1 -1
  771. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +3 -1
  772. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
  773. package/ShadersWGSL/ShadersInclude/helperFunctions.js +2 -2
  774. package/ShadersWGSL/ShadersInclude/helperFunctions.js.map +1 -1
  775. package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js +39 -7
  776. package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
  777. package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js +4 -3
  778. package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js.map +1 -1
  779. package/ShadersWGSL/gaussianSplatting.fragment.js +14 -1
  780. package/ShadersWGSL/gaussianSplatting.fragment.js.map +1 -1
  781. package/ShadersWGSL/gaussianSplatting.vertex.js +2 -2
  782. package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
  783. package/ShadersWGSL/gaussianSplattingDepth.vertex.js +2 -2
  784. package/ShadersWGSL/gaussianSplattingDepth.vertex.js.map +1 -1
  785. package/ShadersWGSL/lightingVolume.compute.js +2 -2
  786. package/ShadersWGSL/lightingVolume.compute.js.map +1 -1
  787. package/ShadersWGSL/picking.fragment.js +22 -1
  788. package/ShadersWGSL/picking.fragment.js.map +1 -1
  789. package/XR/features/Layers/WebXRCompositionLayer.d.ts +3 -2
  790. package/XR/features/Layers/WebXRCompositionLayer.js +2 -2
  791. package/XR/features/Layers/WebXRCompositionLayer.js.map +1 -1
  792. package/XR/features/Layers/WebXRWebGPUCompositionLayer.d.ts +59 -0
  793. package/XR/features/Layers/WebXRWebGPUCompositionLayer.js +120 -0
  794. package/XR/features/Layers/WebXRWebGPUCompositionLayer.js.map +1 -0
  795. package/XR/features/Layers/WebXRWebGPUProjectionLayer.d.ts +25 -0
  796. package/XR/features/Layers/WebXRWebGPUProjectionLayer.js +69 -0
  797. package/XR/features/Layers/WebXRWebGPUProjectionLayer.js.map +1 -0
  798. package/XR/features/WebXRLayers.pure.d.ts +8 -0
  799. package/XR/features/WebXRLayers.pure.js +43 -6
  800. package/XR/features/WebXRLayers.pure.js.map +1 -1
  801. package/XR/native/nativeXRRenderTarget.d.ts +2 -2
  802. package/XR/native/nativeXRRenderTarget.js +2 -2
  803. package/XR/native/nativeXRRenderTarget.js.map +1 -1
  804. package/XR/webXRExperienceHelper.js +10 -1
  805. package/XR/webXRExperienceHelper.js.map +1 -1
  806. package/XR/webXRGraphicsBinding.d.ts +90 -0
  807. package/XR/webXRGraphicsBinding.js +85 -0
  808. package/XR/webXRGraphicsBinding.js.map +1 -0
  809. package/XR/webXRLayerRenderTargetTexture.d.ts +24 -0
  810. package/XR/webXRLayerRenderTargetTexture.js +30 -0
  811. package/XR/webXRLayerRenderTargetTexture.js.map +1 -0
  812. package/XR/webXRManagedOutputCanvas.d.ts +14 -0
  813. package/XR/webXRManagedOutputCanvas.js +24 -5
  814. package/XR/webXRManagedOutputCanvas.js.map +1 -1
  815. package/XR/webXRRenderTargetTextureProvider.d.ts +25 -4
  816. package/XR/webXRRenderTargetTextureProvider.js +33 -35
  817. package/XR/webXRRenderTargetTextureProvider.js.map +1 -1
  818. package/XR/webXRSessionManager.d.ts +11 -0
  819. package/XR/webXRSessionManager.js +37 -0
  820. package/XR/webXRSessionManager.js.map +1 -1
  821. package/XR/webXRTypes.d.ts +9 -6
  822. package/XR/webXRTypes.js.map +1 -1
  823. package/XR/webXRWebGLLayer.d.ts +2 -2
  824. package/XR/webXRWebGLLayer.js +2 -2
  825. package/XR/webXRWebGLLayer.js.map +1 -1
  826. package/XR/webXRWebGLRenderTargetTextureProvider.d.ts +12 -0
  827. package/XR/webXRWebGLRenderTargetTextureProvider.js +58 -0
  828. package/XR/webXRWebGLRenderTargetTextureProvider.js.map +1 -0
  829. package/XR/webXRWebGPURenderTargetTextureProvider.d.ts +69 -0
  830. package/XR/webXRWebGPURenderTargetTextureProvider.js +148 -0
  831. package/XR/webXRWebGPURenderTargetTextureProvider.js.map +1 -0
  832. package/index.d.ts +1 -0
  833. package/index.js +1 -0
  834. package/index.js.map +1 -1
  835. package/node.js +878 -845
  836. package/node.js.map +1 -1
  837. package/package.json +8 -14
  838. package/scene.pure.d.ts +12 -0
  839. package/scene.pure.js +36 -0
  840. package/scene.pure.js.map +1 -1
  841. package/tslib.es6.js +304 -150
@@ -1,5 +1,5 @@
1
1
  /** This file must only contain pure code and pure imports */
2
- import { __decorate } from "../../../tslib.es6.js";
2
+ import { __esDecorate, __runInitializers } from "../../../tslib.es6.js";
3
3
  import { serialize } from "../../../Misc/decorators.js";
4
4
  import { SerializationHelper } from "../../../Misc/decorators.serialization.js";
5
5
  import { PostProcess } from "../../postProcess.pure.js";
@@ -31,863 +31,880 @@ import { RegisterClass } from "../../../Misc/typeStore.js";
31
31
  * - computation of blur radius from roughness and distance: https://github.com/godotengine/godot/blob/master/servers/rendering/renderer_rd/shaders/effects/screen_space_reflection.glsl
32
32
  * - blur and usage of back depth buffer: https://github.com/kode80/kode80SSR
33
33
  */
34
- export class SSRRenderingPipeline extends PostProcessRenderPipeline {
35
- /**
36
- * MSAA sample count, setting this to 4 will provide 4x anti aliasing. (default: 1)
37
- */
38
- set samples(sampleCount) {
39
- if (this._samples === sampleCount) {
40
- return;
41
- }
42
- this._samples = sampleCount;
43
- if (this._ssrPostProcess) {
44
- this._ssrPostProcess.samples = this.samples;
45
- }
46
- }
47
- get samples() {
48
- return this._samples;
49
- }
50
- /**
51
- * Gets or sets the maxDistance used to define how far we look for reflection during the ray-marching on the reflected ray (default: 1000).
52
- * Note that this value is a view (camera) space distance (not pixels!).
53
- */
54
- get maxDistance() {
55
- return this._thinSSRRenderingPipeline.maxDistance;
56
- }
57
- set maxDistance(distance) {
58
- this._thinSSRRenderingPipeline.maxDistance = distance;
59
- }
60
- /**
61
- * Gets or sets the step size used to iterate until the effect finds the color of the reflection's pixel. Should be an integer \>= 1 as it is the number of pixels we advance at each step (default: 1).
62
- * Use higher values to improve performances (but at the expense of quality).
63
- */
64
- get step() {
65
- return this._thinSSRRenderingPipeline.step;
66
- }
67
- set step(step) {
68
- this._thinSSRRenderingPipeline.step = step;
69
- }
70
- /**
71
- * Gets or sets the thickness value used as tolerance when computing the intersection between the reflected ray and the scene (default: 0.5).
72
- * If setting "enableAutomaticThicknessComputation" to true, you can use lower values for "thickness" (even 0), as the geometry thickness
73
- * is automatically computed thank to the regular depth buffer + the backface depth buffer
74
- */
75
- get thickness() {
76
- return this._thinSSRRenderingPipeline.thickness;
77
- }
78
- set thickness(thickness) {
79
- this._thinSSRRenderingPipeline.thickness = thickness;
80
- }
81
- /**
82
- * Gets or sets the current reflection strength. 1.0 is an ideal value but can be increased/decreased for particular results (default: 1).
83
- */
84
- get strength() {
85
- return this._thinSSRRenderingPipeline.strength;
86
- }
87
- set strength(strength) {
88
- this._thinSSRRenderingPipeline.strength = strength;
89
- }
90
- /**
91
- * Gets or sets the falloff exponent used to compute the reflection strength. Higher values lead to fainter reflections (default: 1).
92
- */
93
- get reflectionSpecularFalloffExponent() {
94
- return this._thinSSRRenderingPipeline.reflectionSpecularFalloffExponent;
95
- }
96
- set reflectionSpecularFalloffExponent(exponent) {
97
- this._thinSSRRenderingPipeline.reflectionSpecularFalloffExponent = exponent;
98
- }
99
- /**
100
- * Maximum number of steps during the ray marching process after which we consider an intersection could not be found (default: 1000).
101
- * Should be an integer value.
102
- */
103
- get maxSteps() {
104
- return this._thinSSRRenderingPipeline.maxSteps;
105
- }
106
- set maxSteps(steps) {
107
- this._thinSSRRenderingPipeline.maxSteps = steps;
108
- }
109
- /**
110
- * Gets or sets the factor applied when computing roughness. Default value is 0.2.
111
- * When blurring based on roughness is enabled (meaning blurDispersionStrength \> 0), roughnessFactor is used as a global roughness factor applied on all objects.
112
- * If you want to disable this global roughness set it to 0.
113
- */
114
- get roughnessFactor() {
115
- return this._thinSSRRenderingPipeline.roughnessFactor;
116
- }
117
- set roughnessFactor(factor) {
118
- this._thinSSRRenderingPipeline.roughnessFactor = factor;
119
- }
120
- /**
121
- * Number of steps to skip at start when marching the ray to avoid self collisions (default: 1)
122
- * 1 should normally be a good value, depending on the scene you may need to use a higher value (2 or 3)
123
- */
124
- get selfCollisionNumSkip() {
125
- return this._thinSSRRenderingPipeline.selfCollisionNumSkip;
126
- }
127
- set selfCollisionNumSkip(skip) {
128
- this._thinSSRRenderingPipeline.selfCollisionNumSkip = skip;
129
- }
130
- /**
131
- * Gets or sets the minimum value for one of the reflectivity component of the material to consider it for SSR (default: 0.04).
132
- * If all r/g/b components of the reflectivity is below or equal this value, the pixel will not be considered reflective and SSR won't be applied.
133
- */
134
- get reflectivityThreshold() {
135
- return this._thinSSRRenderingPipeline.reflectivityThreshold;
136
- }
137
- set reflectivityThreshold(threshold) {
138
- const currentThreshold = this.reflectivityThreshold;
139
- if (threshold === currentThreshold) {
140
- return;
141
- }
142
- this._thinSSRRenderingPipeline.reflectivityThreshold = threshold;
143
- if ((threshold === 0 && currentThreshold !== 0) || (threshold !== 0 && currentThreshold === 0)) {
144
- this._buildPipeline();
145
- }
146
- }
147
- /**
148
- * Gets or sets the downsample factor used to reduce the size of the texture used to compute the SSR contribution (default: 0).
149
- * Use 0 to render the SSR contribution at full resolution, 1 to render at half resolution, 2 to render at 1/3 resolution, etc.
150
- * Note that it is used only when blurring is enabled (blurDispersionStrength \> 0), because in that mode the SSR contribution is generated in a separate texture.
151
- */
152
- get ssrDownsample() {
153
- return this._thinSSRRenderingPipeline.ssrDownsample;
154
- }
155
- set ssrDownsample(downsample) {
156
- this._thinSSRRenderingPipeline.ssrDownsample = downsample;
157
- this._buildPipeline();
158
- }
159
- /**
160
- * Gets or sets the blur dispersion strength. Set this value to 0 to disable blurring (default: 0.03)
161
- * The reflections are blurred based on the roughness of the surface and the distance between the pixel shaded and the reflected pixel: the higher the distance the more blurry the reflection is.
162
- * blurDispersionStrength allows to increase or decrease this effect.
163
- */
164
- get blurDispersionStrength() {
165
- return this._thinSSRRenderingPipeline.blurDispersionStrength;
166
- }
167
- set blurDispersionStrength(strength) {
168
- const currentStrength = this.blurDispersionStrength;
169
- if (strength === currentStrength) {
170
- return;
171
- }
172
- this._thinSSRRenderingPipeline.blurDispersionStrength = strength;
173
- if ((strength === 0 && currentStrength !== 0) || (strength !== 0 && currentStrength === 0)) {
174
- this._buildPipeline();
175
- }
176
- }
177
- _useBlur() {
178
- return this.blurDispersionStrength > 0;
179
- }
180
- /**
181
- * Gets or sets the downsample factor used to reduce the size of the textures used to blur the reflection effect (default: 0).
182
- * Use 0 to blur at full resolution, 1 to render at half resolution, 2 to render at 1/3 resolution, etc.
183
- */
184
- get blurDownsample() {
185
- return this._thinSSRRenderingPipeline.blurDownsample;
186
- }
187
- set blurDownsample(downsample) {
188
- this._thinSSRRenderingPipeline.blurDownsample = downsample;
189
- this._buildPipeline();
190
- }
191
- /**
192
- * Gets or sets whether or not smoothing reflections is enabled (default: false)
193
- * Enabling smoothing will require more GPU power.
194
- * Note that this setting has no effect if step = 1: it's only used if step \> 1.
195
- */
196
- get enableSmoothReflections() {
197
- return this._thinSSRRenderingPipeline.enableSmoothReflections;
198
- }
199
- set enableSmoothReflections(enabled) {
200
- this._thinSSRRenderingPipeline.enableSmoothReflections = enabled;
201
- }
202
- get _useScreenspaceDepth() {
203
- return this._thinSSRRenderingPipeline.useScreenspaceDepth;
204
- }
205
- /**
206
- * Gets or sets the environment cube texture used to define the reflection when the reflected rays of SSR leave the view space or when the maxDistance/maxSteps is reached.
207
- */
208
- get environmentTexture() {
209
- return this._thinSSRRenderingPipeline.environmentTexture;
210
- }
211
- set environmentTexture(texture) {
212
- this._thinSSRRenderingPipeline.environmentTexture = texture;
213
- }
214
- /**
215
- * Gets or sets the boolean defining if the environment texture is a standard cubemap (false) or a probe (true). Default value is false.
216
- * Note: a probe cube texture is treated differently than an ordinary cube texture because the Y axis is reversed.
217
- */
218
- get environmentTextureIsProbe() {
219
- return this._thinSSRRenderingPipeline.environmentTextureIsProbe;
220
- }
221
- set environmentTextureIsProbe(isProbe) {
222
- this._thinSSRRenderingPipeline.environmentTextureIsProbe = isProbe;
223
- }
224
- /**
225
- * Gets or sets a boolean indicating if the reflections should be attenuated at the screen borders (default: true).
226
- */
227
- get attenuateScreenBorders() {
228
- return this._thinSSRRenderingPipeline.attenuateScreenBorders;
229
- }
230
- set attenuateScreenBorders(attenuate) {
231
- this._thinSSRRenderingPipeline.attenuateScreenBorders = attenuate;
232
- }
233
- /**
234
- * Gets or sets a boolean indicating if the reflections should be attenuated according to the distance of the intersection (default: true).
235
- */
236
- get attenuateIntersectionDistance() {
237
- return this._thinSSRRenderingPipeline.attenuateIntersectionDistance;
238
- }
239
- set attenuateIntersectionDistance(attenuate) {
240
- this._thinSSRRenderingPipeline.attenuateIntersectionDistance = attenuate;
241
- }
242
- /**
243
- * Gets or sets a boolean indicating if the reflections should be attenuated according to the number of iterations performed to find the intersection (default: true).
244
- */
245
- get attenuateIntersectionIterations() {
246
- return this._thinSSRRenderingPipeline.attenuateIntersectionIterations;
247
- }
248
- set attenuateIntersectionIterations(attenuate) {
249
- this._thinSSRRenderingPipeline.attenuateIntersectionIterations = attenuate;
250
- }
251
- /**
252
- * Gets or sets a boolean indicating if the reflections should be attenuated when the reflection ray is facing the camera (the view direction) (default: false).
253
- */
254
- get attenuateFacingCamera() {
255
- return this._thinSSRRenderingPipeline.attenuateFacingCamera;
256
- }
257
- set attenuateFacingCamera(attenuate) {
258
- this._thinSSRRenderingPipeline.attenuateFacingCamera = attenuate;
259
- }
260
- /**
261
- * Gets or sets a boolean indicating if the backface reflections should be attenuated (default: false).
262
- */
263
- get attenuateBackfaceReflection() {
264
- return this._thinSSRRenderingPipeline.attenuateBackfaceReflection;
265
- }
266
- set attenuateBackfaceReflection(attenuate) {
267
- this._thinSSRRenderingPipeline.attenuateBackfaceReflection = attenuate;
268
- }
269
- /**
270
- * Gets or sets a boolean indicating if the ray should be clipped to the frustum (default: true).
271
- * You can try to set this parameter to false to save some performances: it may produce some artefacts in some cases, but generally they won't really be visible
272
- */
273
- get clipToFrustum() {
274
- return this._thinSSRRenderingPipeline.clipToFrustum;
275
- }
276
- set clipToFrustum(clip) {
277
- this._thinSSRRenderingPipeline.clipToFrustum = clip;
278
- }
279
- /**
280
- * Gets or sets a boolean indicating whether the blending between the current color pixel and the reflection color should be done with a Fresnel coefficient (default: false).
281
- * It is more physically accurate to use the Fresnel coefficient (otherwise it uses the reflectivity of the material for blending), but it is also more expensive when you use blur (when blurDispersionStrength \> 0).
282
- */
283
- get useFresnel() {
284
- return this._thinSSRRenderingPipeline.useFresnel;
285
- }
286
- set useFresnel(fresnel) {
287
- this._thinSSRRenderingPipeline.useFresnel = fresnel;
288
- this._buildPipeline();
289
- }
290
- /**
291
- * Gets or sets a boolean defining if geometry thickness should be computed automatically (default: false).
292
- * When enabled, a depth renderer is created which will render the back faces of the scene to a depth texture (meaning additional work for the GPU).
293
- * In that mode, the "thickness" property is still used as an offset to compute the ray intersection, but you can typically use a much lower
294
- * value than when enableAutomaticThicknessComputation is false (it's even possible to use a value of 0 when using low values for "step")
295
- * Note that for performance reasons, this option will only apply to the first camera to which the rendering pipeline is attached!
296
- */
297
- get enableAutomaticThicknessComputation() {
298
- return this._thinSSRRenderingPipeline.enableAutomaticThicknessComputation;
299
- }
300
- set enableAutomaticThicknessComputation(automatic) {
301
- this._thinSSRRenderingPipeline.enableAutomaticThicknessComputation = automatic;
302
- this._buildPipeline();
303
- }
304
- /**
305
- * Gets the depth renderer used to render the back faces of the scene to a depth texture.
306
- */
307
- get backfaceDepthRenderer() {
308
- return this._depthRenderer;
309
- }
310
- /**
311
- * Gets or sets the downsample factor (default: 0) used to create the backface depth texture - used only if enableAutomaticThicknessComputation = true.
312
- * Use 0 to render the depth at full resolution, 1 to render at half resolution, 2 to render at 1/4 resolution, etc.
313
- * Note that you will get rendering artefacts when using a value different from 0: it's a tradeoff between image quality and performances.
314
- */
315
- get backfaceDepthTextureDownsample() {
316
- return this._backfaceDepthTextureDownsample;
317
- }
318
- set backfaceDepthTextureDownsample(factor) {
319
- if (this._backfaceDepthTextureDownsample === factor) {
320
- return;
321
- }
322
- this._backfaceDepthTextureDownsample = factor;
323
- this._resizeDepthRenderer();
324
- }
325
- /**
326
- * Gets or sets a boolean (default: true) indicating if the depth of transparent meshes should be written to the backface depth texture (when automatic thickness computation is enabled).
327
- */
328
- get backfaceForceDepthWriteTransparentMeshes() {
329
- return this._backfaceForceDepthWriteTransparentMeshes;
330
- }
331
- set backfaceForceDepthWriteTransparentMeshes(force) {
332
- if (this._backfaceForceDepthWriteTransparentMeshes === force) {
333
- return;
334
- }
335
- this._backfaceForceDepthWriteTransparentMeshes = force;
336
- if (this._depthRenderer) {
337
- this._depthRenderer.forceDepthWriteTransparentMeshes = force;
338
- }
339
- }
340
- /**
341
- * Gets or sets a boolean indicating if the effect is enabled (default: true).
342
- */
343
- get isEnabled() {
344
- return this._isEnabled;
345
- }
346
- set isEnabled(value) {
347
- if (this._isEnabled === value) {
348
- return;
349
- }
350
- this._isEnabled = value;
351
- if (!value) {
352
- if (this._cameras !== null) {
353
- this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras);
354
- this._cameras = this._camerasToBeAttached.slice();
34
+ let SSRRenderingPipeline = (() => {
35
+ var _a;
36
+ let _classSuper = PostProcessRenderPipeline;
37
+ let _instanceExtraInitializers = [];
38
+ let _get_samples_decorators;
39
+ let _get_maxDistance_decorators;
40
+ let _get_step_decorators;
41
+ let _get_thickness_decorators;
42
+ let _get_strength_decorators;
43
+ let _get_reflectionSpecularFalloffExponent_decorators;
44
+ let _get_maxSteps_decorators;
45
+ let _get_roughnessFactor_decorators;
46
+ let _get_selfCollisionNumSkip_decorators;
47
+ let _get_reflectivityThreshold_decorators;
48
+ let _get_ssrDownsample_decorators;
49
+ let _get_blurDispersionStrength_decorators;
50
+ let _get_blurDownsample_decorators;
51
+ let _get_enableSmoothReflections_decorators;
52
+ let _get_environmentTexture_decorators;
53
+ let _get_environmentTextureIsProbe_decorators;
54
+ let _get_attenuateScreenBorders_decorators;
55
+ let _get_attenuateIntersectionDistance_decorators;
56
+ let _get_attenuateIntersectionIterations_decorators;
57
+ let _get_attenuateFacingCamera_decorators;
58
+ let _get_attenuateBackfaceReflection_decorators;
59
+ let _get_clipToFrustum_decorators;
60
+ let _get_useFresnel_decorators;
61
+ let _get_enableAutomaticThicknessComputation_decorators;
62
+ let __backfaceDepthTextureDownsample_decorators;
63
+ let __backfaceDepthTextureDownsample_initializers = [];
64
+ let __backfaceDepthTextureDownsample_extraInitializers = [];
65
+ let __backfaceForceDepthWriteTransparentMeshes_decorators;
66
+ let __backfaceForceDepthWriteTransparentMeshes_initializers = [];
67
+ let __backfaceForceDepthWriteTransparentMeshes_extraInitializers = [];
68
+ let __isEnabled_decorators;
69
+ let __isEnabled_initializers = [];
70
+ let __isEnabled_extraInitializers = [];
71
+ let _get_inputTextureColorIsInGammaSpace_decorators;
72
+ let _get_generateOutputInGammaSpace_decorators;
73
+ let _get_debug_decorators;
74
+ return _a = class SSRRenderingPipeline extends _classSuper {
75
+ /**
76
+ * MSAA sample count, setting this to 4 will provide 4x anti aliasing. (default: 1)
77
+ */
78
+ set samples(sampleCount) {
79
+ if (this._samples === sampleCount) {
80
+ return;
81
+ }
82
+ this._samples = sampleCount;
83
+ if (this._ssrPostProcess) {
84
+ this._ssrPostProcess.samples = this.samples;
85
+ }
355
86
  }
356
- }
357
- else if (value) {
358
- if (!this._isDirty) {
359
- if (this._cameras !== null) {
360
- this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name, this._cameras);
87
+ get samples() {
88
+ return this._samples;
89
+ }
90
+ /**
91
+ * Gets or sets the maxDistance used to define how far we look for reflection during the ray-marching on the reflected ray (default: 1000).
92
+ * Note that this value is a view (camera) space distance (not pixels!).
93
+ */
94
+ get maxDistance() {
95
+ return this._thinSSRRenderingPipeline.maxDistance;
96
+ }
97
+ set maxDistance(distance) {
98
+ this._thinSSRRenderingPipeline.maxDistance = distance;
99
+ }
100
+ /**
101
+ * Gets or sets the step size used to iterate until the effect finds the color of the reflection's pixel. Should be an integer \>= 1 as it is the number of pixels we advance at each step (default: 1).
102
+ * Use higher values to improve performances (but at the expense of quality).
103
+ */
104
+ get step() {
105
+ return this._thinSSRRenderingPipeline.step;
106
+ }
107
+ set step(step) {
108
+ this._thinSSRRenderingPipeline.step = step;
109
+ }
110
+ /**
111
+ * Gets or sets the thickness value used as tolerance when computing the intersection between the reflected ray and the scene (default: 0.5).
112
+ * If setting "enableAutomaticThicknessComputation" to true, you can use lower values for "thickness" (even 0), as the geometry thickness
113
+ * is automatically computed thank to the regular depth buffer + the backface depth buffer
114
+ */
115
+ get thickness() {
116
+ return this._thinSSRRenderingPipeline.thickness;
117
+ }
118
+ set thickness(thickness) {
119
+ this._thinSSRRenderingPipeline.thickness = thickness;
120
+ }
121
+ /**
122
+ * Gets or sets the current reflection strength. 1.0 is an ideal value but can be increased/decreased for particular results (default: 1).
123
+ */
124
+ get strength() {
125
+ return this._thinSSRRenderingPipeline.strength;
126
+ }
127
+ set strength(strength) {
128
+ this._thinSSRRenderingPipeline.strength = strength;
129
+ }
130
+ /**
131
+ * Gets or sets the falloff exponent used to compute the reflection strength. Higher values lead to fainter reflections (default: 1).
132
+ */
133
+ get reflectionSpecularFalloffExponent() {
134
+ return this._thinSSRRenderingPipeline.reflectionSpecularFalloffExponent;
135
+ }
136
+ set reflectionSpecularFalloffExponent(exponent) {
137
+ this._thinSSRRenderingPipeline.reflectionSpecularFalloffExponent = exponent;
138
+ }
139
+ /**
140
+ * Maximum number of steps during the ray marching process after which we consider an intersection could not be found (default: 1000).
141
+ * Should be an integer value.
142
+ */
143
+ get maxSteps() {
144
+ return this._thinSSRRenderingPipeline.maxSteps;
145
+ }
146
+ set maxSteps(steps) {
147
+ this._thinSSRRenderingPipeline.maxSteps = steps;
148
+ }
149
+ /**
150
+ * Gets or sets the factor applied when computing roughness. Default value is 0.2.
151
+ * When blurring based on roughness is enabled (meaning blurDispersionStrength \> 0), roughnessFactor is used as a global roughness factor applied on all objects.
152
+ * If you want to disable this global roughness set it to 0.
153
+ */
154
+ get roughnessFactor() {
155
+ return this._thinSSRRenderingPipeline.roughnessFactor;
156
+ }
157
+ set roughnessFactor(factor) {
158
+ this._thinSSRRenderingPipeline.roughnessFactor = factor;
159
+ }
160
+ /**
161
+ * Number of steps to skip at start when marching the ray to avoid self collisions (default: 1)
162
+ * 1 should normally be a good value, depending on the scene you may need to use a higher value (2 or 3)
163
+ */
164
+ get selfCollisionNumSkip() {
165
+ return this._thinSSRRenderingPipeline.selfCollisionNumSkip;
166
+ }
167
+ set selfCollisionNumSkip(skip) {
168
+ this._thinSSRRenderingPipeline.selfCollisionNumSkip = skip;
169
+ }
170
+ /**
171
+ * Gets or sets the minimum value for one of the reflectivity component of the material to consider it for SSR (default: 0.04).
172
+ * If all r/g/b components of the reflectivity is below or equal this value, the pixel will not be considered reflective and SSR won't be applied.
173
+ */
174
+ get reflectivityThreshold() {
175
+ return this._thinSSRRenderingPipeline.reflectivityThreshold;
176
+ }
177
+ set reflectivityThreshold(threshold) {
178
+ const currentThreshold = this.reflectivityThreshold;
179
+ if (threshold === currentThreshold) {
180
+ return;
181
+ }
182
+ this._thinSSRRenderingPipeline.reflectivityThreshold = threshold;
183
+ if ((threshold === 0 && currentThreshold !== 0) || (threshold !== 0 && currentThreshold === 0)) {
184
+ this._buildPipeline();
361
185
  }
362
186
  }
363
- else {
187
+ /**
188
+ * Gets or sets the downsample factor used to reduce the size of the texture used to compute the SSR contribution (default: 0).
189
+ * Use 0 to render the SSR contribution at full resolution, 1 to render at half resolution, 2 to render at 1/3 resolution, etc.
190
+ * Note that it is used only when blurring is enabled (blurDispersionStrength \> 0), because in that mode the SSR contribution is generated in a separate texture.
191
+ */
192
+ get ssrDownsample() {
193
+ return this._thinSSRRenderingPipeline.ssrDownsample;
194
+ }
195
+ set ssrDownsample(downsample) {
196
+ this._thinSSRRenderingPipeline.ssrDownsample = downsample;
364
197
  this._buildPipeline();
365
198
  }
366
- }
367
- }
368
- /**
369
- * Gets or sets a boolean defining if the input color texture is in gamma space (default: true)
370
- * The SSR effect works in linear space, so if the input texture is in gamma space, we must convert the texture to linear space before applying the effect
371
- */
372
- get inputTextureColorIsInGammaSpace() {
373
- return this._thinSSRRenderingPipeline.inputTextureColorIsInGammaSpace;
374
- }
375
- set inputTextureColorIsInGammaSpace(gammaSpace) {
376
- this._thinSSRRenderingPipeline.inputTextureColorIsInGammaSpace = gammaSpace;
377
- this._buildPipeline();
378
- }
379
- /**
380
- * Gets or sets a boolean defining if the output color texture generated by the SSR pipeline should be in gamma space (default: true)
381
- * If you have a post-process that comes after the SSR and that post-process needs the input to be in a linear space, you must disable generateOutputInGammaSpace
382
- */
383
- get generateOutputInGammaSpace() {
384
- return this._thinSSRRenderingPipeline.generateOutputInGammaSpace;
385
- }
386
- set generateOutputInGammaSpace(gammaSpace) {
387
- this._thinSSRRenderingPipeline.generateOutputInGammaSpace = gammaSpace;
388
- this._buildPipeline();
389
- }
390
- /**
391
- * Gets or sets a boolean indicating if the effect should be rendered in debug mode (default: false).
392
- * In this mode, colors have this meaning:
393
- * - blue: the ray hit the max distance (we reached maxDistance)
394
- * - red: the ray ran out of steps (we reached maxSteps)
395
- * - yellow: the ray went off screen
396
- * - green: the ray hit a surface. The brightness of the green color is proportional to the distance between the ray origin and the intersection point: A brighter green means more computation than a darker green.
397
- * In the first 3 cases, the final color is calculated by mixing the skybox color with the pixel color (if environmentTexture is defined), otherwise the pixel color is not modified
398
- * You should try to get as few blue/red/yellow pixels as possible, as this means that the ray has gone further than if it had hit a surface.
399
- */
400
- get debug() {
401
- return this._thinSSRRenderingPipeline.debug;
402
- }
403
- set debug(value) {
404
- this._thinSSRRenderingPipeline.debug = value;
405
- this._buildPipeline();
406
- }
407
- /**
408
- * Checks if all the post processes in the pipeline are ready.
409
- * @returns True if all the post processes in the pipeline are ready
410
- */
411
- isReady() {
412
- return this._thinSSRRenderingPipeline.isReady();
413
- }
414
- /**
415
- * Gets the scene the effect belongs to.
416
- * @returns the scene the effect belongs to.
417
- */
418
- getScene() {
419
- return this._scene;
420
- }
421
- get _geometryBufferRenderer() {
422
- if (!this._forceGeometryBuffer) {
423
- return null;
424
- }
425
- return this._scene.geometryBufferRenderer;
426
- }
427
- get _prePassRenderer() {
428
- if (this._forceGeometryBuffer) {
429
- return null;
430
- }
431
- return this._scene.prePassRenderer;
432
- }
433
- /**
434
- * Gets active scene
435
- */
436
- get scene() {
437
- return this._scene;
438
- }
439
- /**
440
- * Returns true if SSR is supported by the running hardware
441
- */
442
- get isSupported() {
443
- const caps = this._scene.getEngine().getCaps();
444
- return caps.drawBuffersExtension && caps.texelFetch;
445
- }
446
- /**
447
- * Constructor of the SSR rendering pipeline
448
- * @param name The rendering pipeline name
449
- * @param scene The scene linked to this pipeline
450
- * @param cameras The array of cameras that the rendering pipeline will be attached to (default: scene.cameras)
451
- * @param forceGeometryBuffer Set to true if you want to use the legacy geometry buffer renderer (default: false)
452
- * @param textureType The texture type used by the different post processes created by SSR (default: 0)
453
- * @param useScreenspaceDepth Indicates if the depth buffer should be linear or screenspace (default: false). This allows sharing the buffer with other effect pipelines that may require the depth to be in screenspace.
454
- */
455
- constructor(name, scene, cameras, forceGeometryBuffer = false, textureType = 0, useScreenspaceDepth = false) {
456
- RegisterPrePassRendererSceneComponent(PrePassRenderer);
457
- RegisterGeometryBufferRendererSceneComponent(GeometryBufferRenderer);
458
- super(scene.getEngine(), name);
459
- /**
460
- * The SSR PostProcess effect id in the pipeline
461
- */
462
- this.SSRRenderEffect = "SSRRenderEffect";
463
- /**
464
- * The blur PostProcess effect id in the pipeline
465
- */
466
- this.SSRBlurRenderEffect = "SSRBlurRenderEffect";
467
- /**
468
- * The PostProcess effect id in the pipeline that combines the SSR-Blur output with the original scene color
469
- */
470
- this.SSRCombineRenderEffect = "SSRCombineRenderEffect";
471
- this._samples = 1;
472
- this._backfaceDepthTextureDownsample = 0;
473
- this._backfaceForceDepthWriteTransparentMeshes = true;
474
- this._isEnabled = true;
475
- this._forceGeometryBuffer = false;
476
- this._isDirty = false;
477
- this._camerasToBeAttached = [];
478
- this._thinSSRRenderingPipeline = new ThinSSRRenderingPipeline(name, scene);
479
- this._thinSSRRenderingPipeline.isSSRSupported = false;
480
- this._thinSSRRenderingPipeline.useScreenspaceDepth = useScreenspaceDepth;
481
- this._cameras = cameras || scene.cameras;
482
- this._cameras = this._cameras.slice();
483
- this._camerasToBeAttached = this._cameras.slice();
484
- this._scene = scene;
485
- this._textureType = textureType;
486
- this._forceGeometryBuffer = forceGeometryBuffer;
487
- if (this.isSupported) {
488
- this._createSSRPostProcess();
489
- scene.postProcessRenderPipelineManager.addPipeline(this);
490
- if (this._forceGeometryBuffer) {
491
- const geometryBufferRenderer = scene.enableGeometryBufferRenderer();
492
- if (geometryBufferRenderer) {
493
- geometryBufferRenderer.enableReflectivity = true;
494
- geometryBufferRenderer.useSpecificClearForDepthTexture = true;
495
- geometryBufferRenderer.enableScreenspaceDepth = this._useScreenspaceDepth;
496
- geometryBufferRenderer.enableDepth = !this._useScreenspaceDepth;
497
- }
199
+ /**
200
+ * Gets or sets the blur dispersion strength. Set this value to 0 to disable blurring (default: 0.03)
201
+ * The reflections are blurred based on the roughness of the surface and the distance between the pixel shaded and the reflected pixel: the higher the distance the more blurry the reflection is.
202
+ * blurDispersionStrength allows to increase or decrease this effect.
203
+ */
204
+ get blurDispersionStrength() {
205
+ return this._thinSSRRenderingPipeline.blurDispersionStrength;
498
206
  }
499
- else {
500
- const prePassRenderer = scene.enablePrePassRenderer();
501
- if (prePassRenderer) {
502
- prePassRenderer.useSpecificClearForDepthTexture = true;
503
- prePassRenderer.markAsDirty();
207
+ set blurDispersionStrength(strength) {
208
+ const currentStrength = this.blurDispersionStrength;
209
+ if (strength === currentStrength) {
210
+ return;
211
+ }
212
+ this._thinSSRRenderingPipeline.blurDispersionStrength = strength;
213
+ if ((strength === 0 && currentStrength !== 0) || (strength !== 0 && currentStrength === 0)) {
214
+ this._buildPipeline();
504
215
  }
505
216
  }
506
- this._thinSSRRenderingPipeline.isSSRSupported = !!this._geometryBufferRenderer || !!this._prePassRenderer;
507
- this._buildPipeline();
508
- }
509
- }
510
- /**
511
- * Get the class name
512
- * @returns "SSRRenderingPipeline"
513
- */
514
- getClassName() {
515
- return "SSRRenderingPipeline";
516
- }
517
- /**
518
- * Adds a camera to the pipeline
519
- * @param camera the camera to be added
520
- */
521
- addCamera(camera) {
522
- this._camerasToBeAttached.push(camera);
523
- this._buildPipeline();
524
- }
525
- /**
526
- * Removes a camera from the pipeline
527
- * @param camera the camera to remove
528
- */
529
- removeCamera(camera) {
530
- const index = this._camerasToBeAttached.indexOf(camera);
531
- this._camerasToBeAttached.splice(index, 1);
532
- this._buildPipeline();
533
- }
534
- /**
535
- * Removes the internal pipeline assets and detaches the pipeline from the scene cameras
536
- * @param disableGeometryBufferRenderer if the geometry buffer renderer should be disabled
537
- */
538
- dispose(disableGeometryBufferRenderer = false) {
539
- this._disposeDepthRenderer();
540
- this._disposeSSRPostProcess();
541
- this._disposeBlurPostProcesses();
542
- if (disableGeometryBufferRenderer) {
543
- this._scene.disableGeometryBufferRenderer();
544
- }
545
- this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras);
546
- this._scene.postProcessRenderPipelineManager.removePipeline(this._name);
547
- this._thinSSRRenderingPipeline.dispose();
548
- super.dispose();
549
- }
550
- _getTextureSize() {
551
- const engine = this._scene.getEngine();
552
- const prePassRenderer = this._prePassRenderer;
553
- let textureSize = { width: engine.getRenderWidth(), height: engine.getRenderHeight() };
554
- if (prePassRenderer && this._scene.activeCamera?._getFirstPostProcess() === this._ssrPostProcess) {
555
- const renderTarget = prePassRenderer.getRenderTarget();
556
- if (renderTarget && renderTarget.textures) {
557
- textureSize = renderTarget.textures[prePassRenderer.getIndex(4)].getSize();
558
- }
559
- }
560
- else if (this._ssrPostProcess?.inputTexture) {
561
- textureSize.width = this._ssrPostProcess.inputTexture.width;
562
- textureSize.height = this._ssrPostProcess.inputTexture.height;
563
- }
564
- return textureSize;
565
- }
566
- _buildPipeline() {
567
- if (!this.isSupported) {
568
- return;
569
- }
570
- if (!this._isEnabled) {
571
- this._isDirty = true;
572
- return;
573
- }
574
- this._isDirty = false;
575
- const engine = this._scene.getEngine();
576
- this._disposeDepthRenderer();
577
- if (this._cameras !== null) {
578
- this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras);
579
- // get back cameras to be used to reattach pipeline
580
- this._cameras = this._camerasToBeAttached.slice();
581
- if (this._cameras.length > 0) {
582
- this._thinSSRRenderingPipeline.camera = this._cameras[0];
583
- }
584
- }
585
- this._reset();
586
- this._thinSSRRenderingPipeline.normalsAreInWorldSpace = !!(this._geometryBufferRenderer?.generateNormalsInWorldSpace ?? this._prePassRenderer?.generateNormalsInWorldSpace);
587
- if (this.enableAutomaticThicknessComputation) {
588
- const camera = this._cameras?.[0];
589
- if (camera) {
590
- this._depthRendererCamera = camera;
591
- this._depthRenderer = new DepthRenderer(this._scene, undefined, undefined, this._useScreenspaceDepth, 1, !this._useScreenspaceDepth, "SSRBackDepth");
592
- this._depthRenderer.reverseCulling = true; // we generate depth for the back faces
593
- this._depthRenderer.forceDepthWriteTransparentMeshes = this.backfaceForceDepthWriteTransparentMeshes;
217
+ _useBlur() {
218
+ return this.blurDispersionStrength > 0;
219
+ }
220
+ /**
221
+ * Gets or sets the downsample factor used to reduce the size of the textures used to blur the reflection effect (default: 0).
222
+ * Use 0 to blur at full resolution, 1 to render at half resolution, 2 to render at 1/3 resolution, etc.
223
+ */
224
+ get blurDownsample() {
225
+ return this._thinSSRRenderingPipeline.blurDownsample;
226
+ }
227
+ set blurDownsample(downsample) {
228
+ this._thinSSRRenderingPipeline.blurDownsample = downsample;
229
+ this._buildPipeline();
230
+ }
231
+ /**
232
+ * Gets or sets whether or not smoothing reflections is enabled (default: false)
233
+ * Enabling smoothing will require more GPU power.
234
+ * Note that this setting has no effect if step = 1: it's only used if step \> 1.
235
+ */
236
+ get enableSmoothReflections() {
237
+ return this._thinSSRRenderingPipeline.enableSmoothReflections;
238
+ }
239
+ set enableSmoothReflections(enabled) {
240
+ this._thinSSRRenderingPipeline.enableSmoothReflections = enabled;
241
+ }
242
+ get _useScreenspaceDepth() {
243
+ return this._thinSSRRenderingPipeline.useScreenspaceDepth;
244
+ }
245
+ /**
246
+ * Gets or sets the environment cube texture used to define the reflection when the reflected rays of SSR leave the view space or when the maxDistance/maxSteps is reached.
247
+ */
248
+ get environmentTexture() {
249
+ return this._thinSSRRenderingPipeline.environmentTexture;
250
+ }
251
+ set environmentTexture(texture) {
252
+ this._thinSSRRenderingPipeline.environmentTexture = texture;
253
+ }
254
+ /**
255
+ * Gets or sets the boolean defining if the environment texture is a standard cubemap (false) or a probe (true). Default value is false.
256
+ * Note: a probe cube texture is treated differently than an ordinary cube texture because the Y axis is reversed.
257
+ */
258
+ get environmentTextureIsProbe() {
259
+ return this._thinSSRRenderingPipeline.environmentTextureIsProbe;
260
+ }
261
+ set environmentTextureIsProbe(isProbe) {
262
+ this._thinSSRRenderingPipeline.environmentTextureIsProbe = isProbe;
263
+ }
264
+ /**
265
+ * Gets or sets a boolean indicating if the reflections should be attenuated at the screen borders (default: true).
266
+ */
267
+ get attenuateScreenBorders() {
268
+ return this._thinSSRRenderingPipeline.attenuateScreenBorders;
269
+ }
270
+ set attenuateScreenBorders(attenuate) {
271
+ this._thinSSRRenderingPipeline.attenuateScreenBorders = attenuate;
272
+ }
273
+ /**
274
+ * Gets or sets a boolean indicating if the reflections should be attenuated according to the distance of the intersection (default: true).
275
+ */
276
+ get attenuateIntersectionDistance() {
277
+ return this._thinSSRRenderingPipeline.attenuateIntersectionDistance;
278
+ }
279
+ set attenuateIntersectionDistance(attenuate) {
280
+ this._thinSSRRenderingPipeline.attenuateIntersectionDistance = attenuate;
281
+ }
282
+ /**
283
+ * Gets or sets a boolean indicating if the reflections should be attenuated according to the number of iterations performed to find the intersection (default: true).
284
+ */
285
+ get attenuateIntersectionIterations() {
286
+ return this._thinSSRRenderingPipeline.attenuateIntersectionIterations;
287
+ }
288
+ set attenuateIntersectionIterations(attenuate) {
289
+ this._thinSSRRenderingPipeline.attenuateIntersectionIterations = attenuate;
290
+ }
291
+ /**
292
+ * Gets or sets a boolean indicating if the reflections should be attenuated when the reflection ray is facing the camera (the view direction) (default: false).
293
+ */
294
+ get attenuateFacingCamera() {
295
+ return this._thinSSRRenderingPipeline.attenuateFacingCamera;
296
+ }
297
+ set attenuateFacingCamera(attenuate) {
298
+ this._thinSSRRenderingPipeline.attenuateFacingCamera = attenuate;
299
+ }
300
+ /**
301
+ * Gets or sets a boolean indicating if the backface reflections should be attenuated (default: false).
302
+ */
303
+ get attenuateBackfaceReflection() {
304
+ return this._thinSSRRenderingPipeline.attenuateBackfaceReflection;
305
+ }
306
+ set attenuateBackfaceReflection(attenuate) {
307
+ this._thinSSRRenderingPipeline.attenuateBackfaceReflection = attenuate;
308
+ }
309
+ /**
310
+ * Gets or sets a boolean indicating if the ray should be clipped to the frustum (default: true).
311
+ * You can try to set this parameter to false to save some performances: it may produce some artefacts in some cases, but generally they won't really be visible
312
+ */
313
+ get clipToFrustum() {
314
+ return this._thinSSRRenderingPipeline.clipToFrustum;
315
+ }
316
+ set clipToFrustum(clip) {
317
+ this._thinSSRRenderingPipeline.clipToFrustum = clip;
318
+ }
319
+ /**
320
+ * Gets or sets a boolean indicating whether the blending between the current color pixel and the reflection color should be done with a Fresnel coefficient (default: false).
321
+ * It is more physically accurate to use the Fresnel coefficient (otherwise it uses the reflectivity of the material for blending), but it is also more expensive when you use blur (when blurDispersionStrength \> 0).
322
+ */
323
+ get useFresnel() {
324
+ return this._thinSSRRenderingPipeline.useFresnel;
325
+ }
326
+ set useFresnel(fresnel) {
327
+ this._thinSSRRenderingPipeline.useFresnel = fresnel;
328
+ this._buildPipeline();
329
+ }
330
+ /**
331
+ * Gets or sets a boolean defining if geometry thickness should be computed automatically (default: false).
332
+ * When enabled, a depth renderer is created which will render the back faces of the scene to a depth texture (meaning additional work for the GPU).
333
+ * In that mode, the "thickness" property is still used as an offset to compute the ray intersection, but you can typically use a much lower
334
+ * value than when enableAutomaticThicknessComputation is false (it's even possible to use a value of 0 when using low values for "step")
335
+ * Note that for performance reasons, this option will only apply to the first camera to which the rendering pipeline is attached!
336
+ */
337
+ get enableAutomaticThicknessComputation() {
338
+ return this._thinSSRRenderingPipeline.enableAutomaticThicknessComputation;
339
+ }
340
+ set enableAutomaticThicknessComputation(automatic) {
341
+ this._thinSSRRenderingPipeline.enableAutomaticThicknessComputation = automatic;
342
+ this._buildPipeline();
343
+ }
344
+ /**
345
+ * Gets the depth renderer used to render the back faces of the scene to a depth texture.
346
+ */
347
+ get backfaceDepthRenderer() {
348
+ return this._depthRenderer;
349
+ }
350
+ /**
351
+ * Gets or sets the downsample factor (default: 0) used to create the backface depth texture - used only if enableAutomaticThicknessComputation = true.
352
+ * Use 0 to render the depth at full resolution, 1 to render at half resolution, 2 to render at 1/4 resolution, etc.
353
+ * Note that you will get rendering artefacts when using a value different from 0: it's a tradeoff between image quality and performances.
354
+ */
355
+ get backfaceDepthTextureDownsample() {
356
+ return this._backfaceDepthTextureDownsample;
357
+ }
358
+ set backfaceDepthTextureDownsample(factor) {
359
+ if (this._backfaceDepthTextureDownsample === factor) {
360
+ return;
361
+ }
362
+ this._backfaceDepthTextureDownsample = factor;
594
363
  this._resizeDepthRenderer();
595
- camera.customRenderTargets.push(this._depthRenderer.getDepthMap());
596
- }
597
- }
598
- this.addEffect(new PostProcessRenderEffect(engine, this.SSRRenderEffect, () => {
599
- return this._ssrPostProcess;
600
- }, true));
601
- this._disposeBlurPostProcesses();
602
- if (this._useBlur()) {
603
- this._createBlurAndCombinerPostProcesses();
604
- this.addEffect(new PostProcessRenderEffect(engine, this.SSRBlurRenderEffect, () => {
605
- return [this._blurPostProcessX, this._blurPostProcessY];
606
- }, true));
607
- this.addEffect(new PostProcessRenderEffect(engine, this.SSRCombineRenderEffect, () => {
608
- return this._blurCombinerPostProcess;
609
- }, true));
610
- }
611
- if (this._cameras !== null) {
612
- this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name, this._cameras);
613
- }
614
- }
615
- _resizeDepthRenderer() {
616
- if (!this._depthRenderer) {
617
- return;
618
- }
619
- const textureSize = this._getTextureSize();
620
- const depthRendererSize = this._depthRenderer.getDepthMap().getSize();
621
- const width = Math.floor(textureSize.width / (this.backfaceDepthTextureDownsample + 1));
622
- const height = Math.floor(textureSize.height / (this.backfaceDepthTextureDownsample + 1));
623
- if (depthRendererSize.width !== width || depthRendererSize.height !== height) {
624
- this._depthRenderer.getDepthMap().resize({ width, height });
625
- }
626
- }
627
- _disposeDepthRenderer() {
628
- if (this._depthRenderer) {
629
- if (this._depthRendererCamera) {
630
- const idx = this._depthRendererCamera.customRenderTargets.indexOf(this._depthRenderer.getDepthMap()) ?? -1;
631
- if (idx !== -1) {
632
- this._depthRendererCamera.customRenderTargets.splice(idx, 1);
364
+ }
365
+ /**
366
+ * Gets or sets a boolean (default: true) indicating if the depth of transparent meshes should be written to the backface depth texture (when automatic thickness computation is enabled).
367
+ */
368
+ get backfaceForceDepthWriteTransparentMeshes() {
369
+ return this._backfaceForceDepthWriteTransparentMeshes;
370
+ }
371
+ set backfaceForceDepthWriteTransparentMeshes(force) {
372
+ if (this._backfaceForceDepthWriteTransparentMeshes === force) {
373
+ return;
374
+ }
375
+ this._backfaceForceDepthWriteTransparentMeshes = force;
376
+ if (this._depthRenderer) {
377
+ this._depthRenderer.forceDepthWriteTransparentMeshes = force;
633
378
  }
634
379
  }
635
- this._depthRendererCamera = null;
636
- this._depthRenderer.getDepthMap().dispose();
637
- }
638
- this._depthRenderer = null;
639
- }
640
- _disposeBlurPostProcesses() {
641
- for (let i = 0; i < this._cameras.length; i++) {
642
- const camera = this._cameras[i];
643
- this._blurPostProcessX?.dispose(camera);
644
- this._blurPostProcessY?.dispose(camera);
645
- this._blurCombinerPostProcess?.dispose(camera);
646
- }
647
- this._blurPostProcessX = null;
648
- this._blurPostProcessY = null;
649
- this._blurCombinerPostProcess = null;
650
- }
651
- _disposeSSRPostProcess() {
652
- for (let i = 0; i < this._cameras.length; i++) {
653
- const camera = this._cameras[i];
654
- this._ssrPostProcess?.dispose(camera);
655
- }
656
- this._ssrPostProcess = null;
657
- }
658
- _createSSRPostProcess() {
659
- this._ssrPostProcess = new PostProcess("ssr", ThinSSRPostProcess.FragmentUrl, {
660
- uniformNames: ThinSSRPostProcess.Uniforms,
661
- samplerNames: ThinSSRPostProcess.Samplers,
662
- size: 1.0,
663
- samplingMode: 2,
664
- engine: this._scene.getEngine(),
665
- textureType: this._textureType,
666
- effectWrapper: this._thinSSRRenderingPipeline._ssrPostProcess,
667
- });
668
- this._ssrPostProcess.onApply = (effect) => {
669
- this._resizeDepthRenderer();
670
- const geometryBufferRenderer = this._geometryBufferRenderer;
671
- const prePassRenderer = this._prePassRenderer;
672
- if (!prePassRenderer && !geometryBufferRenderer) {
673
- return;
674
- }
675
- if (geometryBufferRenderer) {
676
- const roughnessIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.REFLECTIVITY_TEXTURE_TYPE);
677
- const normalIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.NORMAL_TEXTURE_TYPE);
678
- effect.setTexture("normalSampler", geometryBufferRenderer.getGBuffer().textures[normalIndex]);
679
- effect.setTexture("reflectivitySampler", geometryBufferRenderer.getGBuffer().textures[roughnessIndex]);
680
- if (this._useScreenspaceDepth) {
681
- const depthIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.SCREENSPACE_DEPTH_TEXTURE_TYPE);
682
- effect.setTexture("depthSampler", geometryBufferRenderer.getGBuffer().textures[depthIndex]);
380
+ /**
381
+ * Gets or sets a boolean indicating if the effect is enabled (default: true).
382
+ */
383
+ get isEnabled() {
384
+ return this._isEnabled;
385
+ }
386
+ set isEnabled(value) {
387
+ if (this._isEnabled === value) {
388
+ return;
389
+ }
390
+ this._isEnabled = value;
391
+ if (!value) {
392
+ if (this._cameras !== null) {
393
+ this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras);
394
+ this._cameras = this._camerasToBeAttached.slice();
395
+ }
683
396
  }
684
- else {
685
- const depthIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.DEPTH_TEXTURE_TYPE);
686
- effect.setTexture("depthSampler", geometryBufferRenderer.getGBuffer().textures[depthIndex]);
397
+ else if (value) {
398
+ if (!this._isDirty) {
399
+ if (this._cameras !== null) {
400
+ this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name, this._cameras);
401
+ }
402
+ }
403
+ else {
404
+ this._buildPipeline();
405
+ }
687
406
  }
688
407
  }
689
- else if (prePassRenderer) {
690
- const depthIndex = prePassRenderer.getIndex(this._useScreenspaceDepth ? 10 : 5);
691
- const roughnessIndex = prePassRenderer.getIndex(3);
692
- const normalIndex = prePassRenderer.getIndex(6);
693
- effect.setTexture("normalSampler", prePassRenderer.getRenderTarget().textures[normalIndex]);
694
- effect.setTexture("depthSampler", prePassRenderer.getRenderTarget().textures[depthIndex]);
695
- effect.setTexture("reflectivitySampler", prePassRenderer.getRenderTarget().textures[roughnessIndex]);
696
- }
697
- if (this.enableAutomaticThicknessComputation && this._depthRenderer) {
698
- effect.setTexture("backDepthSampler", this._depthRenderer.getDepthMap());
699
- effect.setFloat("backSizeFactor", this.backfaceDepthTextureDownsample + 1);
700
- }
701
- const textureSize = this._getTextureSize();
702
- this._thinSSRRenderingPipeline._ssrPostProcess.textureWidth = textureSize.width;
703
- this._thinSSRRenderingPipeline._ssrPostProcess.textureHeight = textureSize.height;
704
- };
705
- this._ssrPostProcess.samples = this.samples;
706
- if (!this._forceGeometryBuffer) {
707
- this._ssrPostProcess._prePassEffectConfiguration = new ScreenSpaceReflections2Configuration(this._useScreenspaceDepth);
708
- }
709
- }
710
- _createBlurAndCombinerPostProcesses() {
711
- const engine = this._scene.getEngine();
712
- this._blurPostProcessX = new PostProcess("SSRblurX", ThinSSRBlurPostProcess.FragmentUrl, {
713
- uniformNames: ThinSSRBlurPostProcess.Uniforms,
714
- samplerNames: ThinSSRBlurPostProcess.Samplers,
715
- size: 1 / (this.ssrDownsample + 1),
716
- samplingMode: 2,
717
- engine,
718
- textureType: this._textureType,
719
- effectWrapper: this._thinSSRRenderingPipeline._ssrBlurXPostProcess,
720
- });
721
- this._blurPostProcessX.autoClear = false;
722
- this._blurPostProcessX.onApplyObservable.add(() => {
723
- this._thinSSRRenderingPipeline._ssrBlurXPostProcess.textureWidth = this._blurPostProcessX?.inputTexture.width ?? this._scene.getEngine().getRenderWidth();
724
- this._thinSSRRenderingPipeline._ssrBlurXPostProcess.textureHeight = 1; // not used
725
- });
726
- this._blurPostProcessY = new PostProcess("SSRblurY", ThinSSRBlurPostProcess.FragmentUrl, {
727
- uniformNames: ThinSSRBlurPostProcess.Uniforms,
728
- samplerNames: ThinSSRBlurPostProcess.Samplers,
729
- size: 1 / (this.blurDownsample + 1),
730
- samplingMode: 2,
731
- engine,
732
- textureType: this._textureType,
733
- effectWrapper: this._thinSSRRenderingPipeline._ssrBlurYPostProcess,
734
- });
735
- this._blurPostProcessY.autoClear = false;
736
- this._blurPostProcessY.onApplyObservable.add(() => {
737
- this._thinSSRRenderingPipeline._ssrBlurYPostProcess.textureWidth = 1; // not used
738
- this._thinSSRRenderingPipeline._ssrBlurYPostProcess.textureHeight = this._blurPostProcessY?.inputTexture.height ?? this._scene.getEngine().getRenderHeight();
739
- });
740
- this._blurCombinerPostProcess = new PostProcess("SSRblurCombiner", ThinSSRBlurCombinerPostProcess.FragmentUrl, {
741
- uniformNames: ThinSSRBlurCombinerPostProcess.Uniforms,
742
- samplerNames: ThinSSRBlurCombinerPostProcess.Samplers,
743
- size: 1 / (this.blurDownsample + 1),
744
- samplingMode: 1,
745
- engine,
746
- textureType: this._textureType,
747
- effectWrapper: this._thinSSRRenderingPipeline._ssrBlurCombinerPostProcess,
748
- });
749
- this._blurCombinerPostProcess.autoClear = false;
750
- this._blurCombinerPostProcess.onApplyObservable.add((effect) => {
751
- const geometryBufferRenderer = this._geometryBufferRenderer;
752
- const prePassRenderer = this._prePassRenderer;
753
- if (!prePassRenderer && !geometryBufferRenderer) {
754
- return;
755
- }
756
- if (prePassRenderer && this._scene.activeCamera?._getFirstPostProcess() === this._ssrPostProcess) {
757
- const renderTarget = prePassRenderer.getRenderTarget();
758
- if (renderTarget && renderTarget.textures) {
759
- effect.setTexture("mainSampler", renderTarget.textures[prePassRenderer.getIndex(4)]);
408
+ /**
409
+ * Gets or sets a boolean defining if the input color texture is in gamma space (default: true)
410
+ * The SSR effect works in linear space, so if the input texture is in gamma space, we must convert the texture to linear space before applying the effect
411
+ */
412
+ get inputTextureColorIsInGammaSpace() {
413
+ return this._thinSSRRenderingPipeline.inputTextureColorIsInGammaSpace;
414
+ }
415
+ set inputTextureColorIsInGammaSpace(gammaSpace) {
416
+ this._thinSSRRenderingPipeline.inputTextureColorIsInGammaSpace = gammaSpace;
417
+ this._buildPipeline();
418
+ }
419
+ /**
420
+ * Gets or sets a boolean defining if the output color texture generated by the SSR pipeline should be in gamma space (default: true)
421
+ * If you have a post-process that comes after the SSR and that post-process needs the input to be in a linear space, you must disable generateOutputInGammaSpace
422
+ */
423
+ get generateOutputInGammaSpace() {
424
+ return this._thinSSRRenderingPipeline.generateOutputInGammaSpace;
425
+ }
426
+ set generateOutputInGammaSpace(gammaSpace) {
427
+ this._thinSSRRenderingPipeline.generateOutputInGammaSpace = gammaSpace;
428
+ this._buildPipeline();
429
+ }
430
+ /**
431
+ * Gets or sets a boolean indicating if the effect should be rendered in debug mode (default: false).
432
+ * In this mode, colors have this meaning:
433
+ * - blue: the ray hit the max distance (we reached maxDistance)
434
+ * - red: the ray ran out of steps (we reached maxSteps)
435
+ * - yellow: the ray went off screen
436
+ * - green: the ray hit a surface. The brightness of the green color is proportional to the distance between the ray origin and the intersection point: A brighter green means more computation than a darker green.
437
+ * In the first 3 cases, the final color is calculated by mixing the skybox color with the pixel color (if environmentTexture is defined), otherwise the pixel color is not modified
438
+ * You should try to get as few blue/red/yellow pixels as possible, as this means that the ray has gone further than if it had hit a surface.
439
+ */
440
+ get debug() {
441
+ return this._thinSSRRenderingPipeline.debug;
442
+ }
443
+ set debug(value) {
444
+ this._thinSSRRenderingPipeline.debug = value;
445
+ this._buildPipeline();
446
+ }
447
+ /**
448
+ * Checks if all the post processes in the pipeline are ready.
449
+ * @returns True if all the post processes in the pipeline are ready
450
+ */
451
+ isReady() {
452
+ return this._thinSSRRenderingPipeline.isReady();
453
+ }
454
+ /**
455
+ * Gets the scene the effect belongs to.
456
+ * @returns the scene the effect belongs to.
457
+ */
458
+ getScene() {
459
+ return this._scene;
460
+ }
461
+ get _geometryBufferRenderer() {
462
+ if (!this._forceGeometryBuffer) {
463
+ return null;
760
464
  }
465
+ return this._scene.geometryBufferRenderer;
761
466
  }
762
- else {
763
- effect.setTextureFromPostProcess("mainSampler", this._ssrPostProcess);
764
- }
765
- if (geometryBufferRenderer) {
766
- const roughnessIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.REFLECTIVITY_TEXTURE_TYPE);
767
- effect.setTexture("reflectivitySampler", geometryBufferRenderer.getGBuffer().textures[roughnessIndex]);
768
- if (this.useFresnel) {
769
- effect.setTexture("normalSampler", geometryBufferRenderer.getGBuffer().textures[1]);
770
- if (this._useScreenspaceDepth) {
771
- const depthIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.SCREENSPACE_DEPTH_TEXTURE_TYPE);
772
- effect.setTexture("depthSampler", geometryBufferRenderer.getGBuffer().textures[depthIndex]);
467
+ get _prePassRenderer() {
468
+ if (this._forceGeometryBuffer) {
469
+ return null;
470
+ }
471
+ return this._scene.prePassRenderer;
472
+ }
473
+ /**
474
+ * Gets active scene
475
+ */
476
+ get scene() {
477
+ return this._scene;
478
+ }
479
+ /**
480
+ * Returns true if SSR is supported by the running hardware
481
+ */
482
+ get isSupported() {
483
+ const caps = this._scene.getEngine().getCaps();
484
+ return caps.drawBuffersExtension && caps.texelFetch;
485
+ }
486
+ /**
487
+ * Constructor of the SSR rendering pipeline
488
+ * @param name The rendering pipeline name
489
+ * @param scene The scene linked to this pipeline
490
+ * @param cameras The array of cameras that the rendering pipeline will be attached to (default: scene.cameras)
491
+ * @param forceGeometryBuffer Set to true if you want to use the legacy geometry buffer renderer (default: false)
492
+ * @param textureType The texture type used by the different post processes created by SSR (default: 0)
493
+ * @param useScreenspaceDepth Indicates if the depth buffer should be linear or screenspace (default: false). This allows sharing the buffer with other effect pipelines that may require the depth to be in screenspace.
494
+ */
495
+ constructor(name, scene, cameras, forceGeometryBuffer = false, textureType = 0, useScreenspaceDepth = false) {
496
+ RegisterPrePassRendererSceneComponent(PrePassRenderer);
497
+ RegisterGeometryBufferRendererSceneComponent(GeometryBufferRenderer);
498
+ super(scene.getEngine(), name);
499
+ /**
500
+ * The SSR PostProcess effect id in the pipeline
501
+ */
502
+ this.SSRRenderEffect = (__runInitializers(this, _instanceExtraInitializers), "SSRRenderEffect");
503
+ /**
504
+ * The blur PostProcess effect id in the pipeline
505
+ */
506
+ this.SSRBlurRenderEffect = "SSRBlurRenderEffect";
507
+ /**
508
+ * The PostProcess effect id in the pipeline that combines the SSR-Blur output with the original scene color
509
+ */
510
+ this.SSRCombineRenderEffect = "SSRCombineRenderEffect";
511
+ this._samples = 1;
512
+ this._backfaceDepthTextureDownsample = __runInitializers(this, __backfaceDepthTextureDownsample_initializers, 0);
513
+ this._backfaceForceDepthWriteTransparentMeshes = (__runInitializers(this, __backfaceDepthTextureDownsample_extraInitializers), __runInitializers(this, __backfaceForceDepthWriteTransparentMeshes_initializers, true));
514
+ this._isEnabled = (__runInitializers(this, __backfaceForceDepthWriteTransparentMeshes_extraInitializers), __runInitializers(this, __isEnabled_initializers, true));
515
+ this._forceGeometryBuffer = (__runInitializers(this, __isEnabled_extraInitializers), false);
516
+ this._isDirty = false;
517
+ this._camerasToBeAttached = [];
518
+ this._thinSSRRenderingPipeline = new ThinSSRRenderingPipeline(name, scene);
519
+ this._thinSSRRenderingPipeline.isSSRSupported = false;
520
+ this._thinSSRRenderingPipeline.useScreenspaceDepth = useScreenspaceDepth;
521
+ this._cameras = cameras || scene.cameras;
522
+ this._cameras = this._cameras.slice();
523
+ this._camerasToBeAttached = this._cameras.slice();
524
+ this._scene = scene;
525
+ this._textureType = textureType;
526
+ this._forceGeometryBuffer = forceGeometryBuffer;
527
+ if (this.isSupported) {
528
+ this._createSSRPostProcess();
529
+ scene.postProcessRenderPipelineManager.addPipeline(this);
530
+ if (this._forceGeometryBuffer) {
531
+ const geometryBufferRenderer = scene.enableGeometryBufferRenderer();
532
+ if (geometryBufferRenderer) {
533
+ geometryBufferRenderer.enableReflectivity = true;
534
+ geometryBufferRenderer.useSpecificClearForDepthTexture = true;
535
+ geometryBufferRenderer.enableScreenspaceDepth = this._useScreenspaceDepth;
536
+ geometryBufferRenderer.enableDepth = !this._useScreenspaceDepth;
537
+ }
773
538
  }
774
539
  else {
775
- effect.setTexture("depthSampler", geometryBufferRenderer.getGBuffer().textures[0]);
540
+ const prePassRenderer = scene.enablePrePassRenderer();
541
+ if (prePassRenderer) {
542
+ prePassRenderer.useSpecificClearForDepthTexture = true;
543
+ prePassRenderer.markAsDirty();
544
+ }
776
545
  }
546
+ this._thinSSRRenderingPipeline.isSSRSupported = !!this._geometryBufferRenderer || !!this._prePassRenderer;
547
+ this._buildPipeline();
777
548
  }
778
549
  }
779
- else if (prePassRenderer) {
780
- const roughnessIndex = prePassRenderer.getIndex(3);
781
- effect.setTexture("reflectivitySampler", prePassRenderer.getRenderTarget().textures[roughnessIndex]);
782
- if (this.useFresnel) {
783
- const depthIndex = prePassRenderer.getIndex(this._useScreenspaceDepth ? 10 : 5);
784
- const normalIndex = prePassRenderer.getIndex(6);
785
- effect.setTexture("normalSampler", prePassRenderer.getRenderTarget().textures[normalIndex]);
786
- effect.setTexture("depthSampler", prePassRenderer.getRenderTarget().textures[depthIndex]);
550
+ /**
551
+ * Get the class name
552
+ * @returns "SSRRenderingPipeline"
553
+ */
554
+ getClassName() {
555
+ return "SSRRenderingPipeline";
556
+ }
557
+ /**
558
+ * Adds a camera to the pipeline
559
+ * @param camera the camera to be added
560
+ */
561
+ addCamera(camera) {
562
+ this._camerasToBeAttached.push(camera);
563
+ this._buildPipeline();
564
+ }
565
+ /**
566
+ * Removes a camera from the pipeline
567
+ * @param camera the camera to remove
568
+ */
569
+ removeCamera(camera) {
570
+ const index = this._camerasToBeAttached.indexOf(camera);
571
+ this._camerasToBeAttached.splice(index, 1);
572
+ this._buildPipeline();
573
+ }
574
+ /**
575
+ * Removes the internal pipeline assets and detaches the pipeline from the scene cameras
576
+ * @param disableGeometryBufferRenderer if the geometry buffer renderer should be disabled
577
+ */
578
+ dispose(disableGeometryBufferRenderer = false) {
579
+ this._disposeDepthRenderer();
580
+ this._disposeSSRPostProcess();
581
+ this._disposeBlurPostProcesses();
582
+ if (disableGeometryBufferRenderer) {
583
+ this._scene.disableGeometryBufferRenderer();
787
584
  }
585
+ this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras);
586
+ this._scene.postProcessRenderPipelineManager.removePipeline(this._name);
587
+ this._thinSSRRenderingPipeline.dispose();
588
+ super.dispose();
788
589
  }
789
- });
790
- }
791
- /**
792
- * Serializes the rendering pipeline (Used when exporting)
793
- * @returns the serialized object
794
- */
795
- serialize() {
796
- const serializationObject = SerializationHelper.Serialize(this);
797
- serializationObject.customType = "SSRRenderingPipeline";
798
- return serializationObject;
799
- }
800
- }
801
- __decorate([
802
- serialize()
803
- ], SSRRenderingPipeline.prototype, "samples", null);
804
- __decorate([
805
- serialize()
806
- ], SSRRenderingPipeline.prototype, "maxDistance", null);
807
- __decorate([
808
- serialize()
809
- ], SSRRenderingPipeline.prototype, "step", null);
810
- __decorate([
811
- serialize()
812
- ], SSRRenderingPipeline.prototype, "thickness", null);
813
- __decorate([
814
- serialize()
815
- ], SSRRenderingPipeline.prototype, "strength", null);
816
- __decorate([
817
- serialize()
818
- ], SSRRenderingPipeline.prototype, "reflectionSpecularFalloffExponent", null);
819
- __decorate([
820
- serialize()
821
- ], SSRRenderingPipeline.prototype, "maxSteps", null);
822
- __decorate([
823
- serialize()
824
- ], SSRRenderingPipeline.prototype, "roughnessFactor", null);
825
- __decorate([
826
- serialize()
827
- ], SSRRenderingPipeline.prototype, "selfCollisionNumSkip", null);
828
- __decorate([
829
- serialize()
830
- ], SSRRenderingPipeline.prototype, "reflectivityThreshold", null);
831
- __decorate([
832
- serialize()
833
- ], SSRRenderingPipeline.prototype, "ssrDownsample", null);
834
- __decorate([
835
- serialize("blurDispersionStrength")
836
- ], SSRRenderingPipeline.prototype, "blurDispersionStrength", null);
837
- __decorate([
838
- serialize("blurDownsample")
839
- ], SSRRenderingPipeline.prototype, "blurDownsample", null);
840
- __decorate([
841
- serialize("enableSmoothReflections")
842
- ], SSRRenderingPipeline.prototype, "enableSmoothReflections", null);
843
- __decorate([
844
- serialize("environmentTexture")
845
- ], SSRRenderingPipeline.prototype, "environmentTexture", null);
846
- __decorate([
847
- serialize("environmentTextureIsProbe")
848
- ], SSRRenderingPipeline.prototype, "environmentTextureIsProbe", null);
849
- __decorate([
850
- serialize("attenuateScreenBorders")
851
- ], SSRRenderingPipeline.prototype, "attenuateScreenBorders", null);
852
- __decorate([
853
- serialize("attenuateIntersectionDistance")
854
- ], SSRRenderingPipeline.prototype, "attenuateIntersectionDistance", null);
855
- __decorate([
856
- serialize("attenuateIntersectionIterations")
857
- ], SSRRenderingPipeline.prototype, "attenuateIntersectionIterations", null);
858
- __decorate([
859
- serialize("attenuateFacingCamera")
860
- ], SSRRenderingPipeline.prototype, "attenuateFacingCamera", null);
861
- __decorate([
862
- serialize("attenuateBackfaceReflection")
863
- ], SSRRenderingPipeline.prototype, "attenuateBackfaceReflection", null);
864
- __decorate([
865
- serialize("clipToFrustum")
866
- ], SSRRenderingPipeline.prototype, "clipToFrustum", null);
867
- __decorate([
868
- serialize("useFresnel")
869
- ], SSRRenderingPipeline.prototype, "useFresnel", null);
870
- __decorate([
871
- serialize("enableAutomaticThicknessComputation")
872
- ], SSRRenderingPipeline.prototype, "enableAutomaticThicknessComputation", null);
873
- __decorate([
874
- serialize("backfaceDepthTextureDownsample")
875
- ], SSRRenderingPipeline.prototype, "_backfaceDepthTextureDownsample", void 0);
876
- __decorate([
877
- serialize("backfaceForceDepthWriteTransparentMeshes")
878
- ], SSRRenderingPipeline.prototype, "_backfaceForceDepthWriteTransparentMeshes", void 0);
879
- __decorate([
880
- serialize("isEnabled")
881
- ], SSRRenderingPipeline.prototype, "_isEnabled", void 0);
882
- __decorate([
883
- serialize("inputTextureColorIsInGammaSpace")
884
- ], SSRRenderingPipeline.prototype, "inputTextureColorIsInGammaSpace", null);
885
- __decorate([
886
- serialize("generateOutputInGammaSpace")
887
- ], SSRRenderingPipeline.prototype, "generateOutputInGammaSpace", null);
888
- __decorate([
889
- serialize("debug")
890
- ], SSRRenderingPipeline.prototype, "debug", null);
590
+ _getTextureSize() {
591
+ const engine = this._scene.getEngine();
592
+ const prePassRenderer = this._prePassRenderer;
593
+ let textureSize = { width: engine.getRenderWidth(), height: engine.getRenderHeight() };
594
+ if (prePassRenderer && this._scene.activeCamera?._getFirstPostProcess() === this._ssrPostProcess) {
595
+ const renderTarget = prePassRenderer.getRenderTarget();
596
+ if (renderTarget && renderTarget.textures) {
597
+ textureSize = renderTarget.textures[prePassRenderer.getIndex(4)].getSize();
598
+ }
599
+ }
600
+ else if (this._ssrPostProcess?.inputTexture) {
601
+ textureSize.width = this._ssrPostProcess.inputTexture.width;
602
+ textureSize.height = this._ssrPostProcess.inputTexture.height;
603
+ }
604
+ return textureSize;
605
+ }
606
+ _buildPipeline() {
607
+ if (!this.isSupported) {
608
+ return;
609
+ }
610
+ if (!this._isEnabled) {
611
+ this._isDirty = true;
612
+ return;
613
+ }
614
+ this._isDirty = false;
615
+ const engine = this._scene.getEngine();
616
+ this._disposeDepthRenderer();
617
+ if (this._cameras !== null) {
618
+ this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras);
619
+ // get back cameras to be used to reattach pipeline
620
+ this._cameras = this._camerasToBeAttached.slice();
621
+ if (this._cameras.length > 0) {
622
+ this._thinSSRRenderingPipeline.camera = this._cameras[0];
623
+ }
624
+ }
625
+ this._reset();
626
+ this._thinSSRRenderingPipeline.normalsAreInWorldSpace = !!(this._geometryBufferRenderer?.generateNormalsInWorldSpace ?? this._prePassRenderer?.generateNormalsInWorldSpace);
627
+ if (this.enableAutomaticThicknessComputation) {
628
+ const camera = this._cameras?.[0];
629
+ if (camera) {
630
+ this._depthRendererCamera = camera;
631
+ this._depthRenderer = new DepthRenderer(this._scene, undefined, undefined, this._useScreenspaceDepth, 1, !this._useScreenspaceDepth, "SSRBackDepth");
632
+ this._depthRenderer.reverseCulling = true; // we generate depth for the back faces
633
+ this._depthRenderer.forceDepthWriteTransparentMeshes = this.backfaceForceDepthWriteTransparentMeshes;
634
+ this._resizeDepthRenderer();
635
+ camera.customRenderTargets.push(this._depthRenderer.getDepthMap());
636
+ }
637
+ }
638
+ this.addEffect(new PostProcessRenderEffect(engine, this.SSRRenderEffect, () => {
639
+ return this._ssrPostProcess;
640
+ }, true));
641
+ this._disposeBlurPostProcesses();
642
+ if (this._useBlur()) {
643
+ this._createBlurAndCombinerPostProcesses();
644
+ this.addEffect(new PostProcessRenderEffect(engine, this.SSRBlurRenderEffect, () => {
645
+ return [this._blurPostProcessX, this._blurPostProcessY];
646
+ }, true));
647
+ this.addEffect(new PostProcessRenderEffect(engine, this.SSRCombineRenderEffect, () => {
648
+ return this._blurCombinerPostProcess;
649
+ }, true));
650
+ }
651
+ if (this._cameras !== null) {
652
+ this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name, this._cameras);
653
+ }
654
+ }
655
+ _resizeDepthRenderer() {
656
+ if (!this._depthRenderer) {
657
+ return;
658
+ }
659
+ const textureSize = this._getTextureSize();
660
+ const depthRendererSize = this._depthRenderer.getDepthMap().getSize();
661
+ const width = Math.floor(textureSize.width / (this.backfaceDepthTextureDownsample + 1));
662
+ const height = Math.floor(textureSize.height / (this.backfaceDepthTextureDownsample + 1));
663
+ if (depthRendererSize.width !== width || depthRendererSize.height !== height) {
664
+ this._depthRenderer.getDepthMap().resize({ width, height });
665
+ }
666
+ }
667
+ _disposeDepthRenderer() {
668
+ if (this._depthRenderer) {
669
+ if (this._depthRendererCamera) {
670
+ const idx = this._depthRendererCamera.customRenderTargets.indexOf(this._depthRenderer.getDepthMap()) ?? -1;
671
+ if (idx !== -1) {
672
+ this._depthRendererCamera.customRenderTargets.splice(idx, 1);
673
+ }
674
+ }
675
+ this._depthRendererCamera = null;
676
+ this._depthRenderer.getDepthMap().dispose();
677
+ }
678
+ this._depthRenderer = null;
679
+ }
680
+ _disposeBlurPostProcesses() {
681
+ for (let i = 0; i < this._cameras.length; i++) {
682
+ const camera = this._cameras[i];
683
+ this._blurPostProcessX?.dispose(camera);
684
+ this._blurPostProcessY?.dispose(camera);
685
+ this._blurCombinerPostProcess?.dispose(camera);
686
+ }
687
+ this._blurPostProcessX = null;
688
+ this._blurPostProcessY = null;
689
+ this._blurCombinerPostProcess = null;
690
+ }
691
+ _disposeSSRPostProcess() {
692
+ for (let i = 0; i < this._cameras.length; i++) {
693
+ const camera = this._cameras[i];
694
+ this._ssrPostProcess?.dispose(camera);
695
+ }
696
+ this._ssrPostProcess = null;
697
+ }
698
+ _createSSRPostProcess() {
699
+ this._ssrPostProcess = new PostProcess("ssr", ThinSSRPostProcess.FragmentUrl, {
700
+ uniformNames: ThinSSRPostProcess.Uniforms,
701
+ samplerNames: ThinSSRPostProcess.Samplers,
702
+ size: 1.0,
703
+ samplingMode: 2,
704
+ engine: this._scene.getEngine(),
705
+ textureType: this._textureType,
706
+ effectWrapper: this._thinSSRRenderingPipeline._ssrPostProcess,
707
+ });
708
+ this._ssrPostProcess.onApply = (effect) => {
709
+ this._resizeDepthRenderer();
710
+ const geometryBufferRenderer = this._geometryBufferRenderer;
711
+ const prePassRenderer = this._prePassRenderer;
712
+ if (!prePassRenderer && !geometryBufferRenderer) {
713
+ return;
714
+ }
715
+ if (geometryBufferRenderer) {
716
+ const roughnessIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.REFLECTIVITY_TEXTURE_TYPE);
717
+ const normalIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.NORMAL_TEXTURE_TYPE);
718
+ effect.setTexture("normalSampler", geometryBufferRenderer.getGBuffer().textures[normalIndex]);
719
+ effect.setTexture("reflectivitySampler", geometryBufferRenderer.getGBuffer().textures[roughnessIndex]);
720
+ if (this._useScreenspaceDepth) {
721
+ const depthIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.SCREENSPACE_DEPTH_TEXTURE_TYPE);
722
+ effect.setTexture("depthSampler", geometryBufferRenderer.getGBuffer().textures[depthIndex]);
723
+ }
724
+ else {
725
+ const depthIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.DEPTH_TEXTURE_TYPE);
726
+ effect.setTexture("depthSampler", geometryBufferRenderer.getGBuffer().textures[depthIndex]);
727
+ }
728
+ }
729
+ else if (prePassRenderer) {
730
+ const depthIndex = prePassRenderer.getIndex(this._useScreenspaceDepth ? 10 : 5);
731
+ const roughnessIndex = prePassRenderer.getIndex(3);
732
+ const normalIndex = prePassRenderer.getIndex(6);
733
+ effect.setTexture("normalSampler", prePassRenderer.getRenderTarget().textures[normalIndex]);
734
+ effect.setTexture("depthSampler", prePassRenderer.getRenderTarget().textures[depthIndex]);
735
+ effect.setTexture("reflectivitySampler", prePassRenderer.getRenderTarget().textures[roughnessIndex]);
736
+ }
737
+ if (this.enableAutomaticThicknessComputation && this._depthRenderer) {
738
+ effect.setTexture("backDepthSampler", this._depthRenderer.getDepthMap());
739
+ effect.setFloat("backSizeFactor", this.backfaceDepthTextureDownsample + 1);
740
+ }
741
+ const textureSize = this._getTextureSize();
742
+ this._thinSSRRenderingPipeline._ssrPostProcess.textureWidth = textureSize.width;
743
+ this._thinSSRRenderingPipeline._ssrPostProcess.textureHeight = textureSize.height;
744
+ };
745
+ this._ssrPostProcess.samples = this.samples;
746
+ if (!this._forceGeometryBuffer) {
747
+ this._ssrPostProcess._prePassEffectConfiguration = new ScreenSpaceReflections2Configuration(this._useScreenspaceDepth);
748
+ }
749
+ }
750
+ _createBlurAndCombinerPostProcesses() {
751
+ const engine = this._scene.getEngine();
752
+ this._blurPostProcessX = new PostProcess("SSRblurX", ThinSSRBlurPostProcess.FragmentUrl, {
753
+ uniformNames: ThinSSRBlurPostProcess.Uniforms,
754
+ samplerNames: ThinSSRBlurPostProcess.Samplers,
755
+ size: 1 / (this.ssrDownsample + 1),
756
+ samplingMode: 2,
757
+ engine,
758
+ textureType: this._textureType,
759
+ effectWrapper: this._thinSSRRenderingPipeline._ssrBlurXPostProcess,
760
+ });
761
+ this._blurPostProcessX.autoClear = false;
762
+ this._blurPostProcessX.onApplyObservable.add(() => {
763
+ this._thinSSRRenderingPipeline._ssrBlurXPostProcess.textureWidth = this._blurPostProcessX?.inputTexture.width ?? this._scene.getEngine().getRenderWidth();
764
+ this._thinSSRRenderingPipeline._ssrBlurXPostProcess.textureHeight = 1; // not used
765
+ });
766
+ this._blurPostProcessY = new PostProcess("SSRblurY", ThinSSRBlurPostProcess.FragmentUrl, {
767
+ uniformNames: ThinSSRBlurPostProcess.Uniforms,
768
+ samplerNames: ThinSSRBlurPostProcess.Samplers,
769
+ size: 1 / (this.blurDownsample + 1),
770
+ samplingMode: 2,
771
+ engine,
772
+ textureType: this._textureType,
773
+ effectWrapper: this._thinSSRRenderingPipeline._ssrBlurYPostProcess,
774
+ });
775
+ this._blurPostProcessY.autoClear = false;
776
+ this._blurPostProcessY.onApplyObservable.add(() => {
777
+ this._thinSSRRenderingPipeline._ssrBlurYPostProcess.textureWidth = 1; // not used
778
+ this._thinSSRRenderingPipeline._ssrBlurYPostProcess.textureHeight = this._blurPostProcessY?.inputTexture.height ?? this._scene.getEngine().getRenderHeight();
779
+ });
780
+ this._blurCombinerPostProcess = new PostProcess("SSRblurCombiner", ThinSSRBlurCombinerPostProcess.FragmentUrl, {
781
+ uniformNames: ThinSSRBlurCombinerPostProcess.Uniforms,
782
+ samplerNames: ThinSSRBlurCombinerPostProcess.Samplers,
783
+ size: 1 / (this.blurDownsample + 1),
784
+ samplingMode: 1,
785
+ engine,
786
+ textureType: this._textureType,
787
+ effectWrapper: this._thinSSRRenderingPipeline._ssrBlurCombinerPostProcess,
788
+ });
789
+ this._blurCombinerPostProcess.autoClear = false;
790
+ this._blurCombinerPostProcess.onApplyObservable.add((effect) => {
791
+ const geometryBufferRenderer = this._geometryBufferRenderer;
792
+ const prePassRenderer = this._prePassRenderer;
793
+ if (!prePassRenderer && !geometryBufferRenderer) {
794
+ return;
795
+ }
796
+ if (prePassRenderer && this._scene.activeCamera?._getFirstPostProcess() === this._ssrPostProcess) {
797
+ const renderTarget = prePassRenderer.getRenderTarget();
798
+ if (renderTarget && renderTarget.textures) {
799
+ effect.setTexture("mainSampler", renderTarget.textures[prePassRenderer.getIndex(4)]);
800
+ }
801
+ }
802
+ else {
803
+ effect.setTextureFromPostProcess("mainSampler", this._ssrPostProcess);
804
+ }
805
+ if (geometryBufferRenderer) {
806
+ const roughnessIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.REFLECTIVITY_TEXTURE_TYPE);
807
+ effect.setTexture("reflectivitySampler", geometryBufferRenderer.getGBuffer().textures[roughnessIndex]);
808
+ if (this.useFresnel) {
809
+ effect.setTexture("normalSampler", geometryBufferRenderer.getGBuffer().textures[1]);
810
+ if (this._useScreenspaceDepth) {
811
+ const depthIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.SCREENSPACE_DEPTH_TEXTURE_TYPE);
812
+ effect.setTexture("depthSampler", geometryBufferRenderer.getGBuffer().textures[depthIndex]);
813
+ }
814
+ else {
815
+ effect.setTexture("depthSampler", geometryBufferRenderer.getGBuffer().textures[0]);
816
+ }
817
+ }
818
+ }
819
+ else if (prePassRenderer) {
820
+ const roughnessIndex = prePassRenderer.getIndex(3);
821
+ effect.setTexture("reflectivitySampler", prePassRenderer.getRenderTarget().textures[roughnessIndex]);
822
+ if (this.useFresnel) {
823
+ const depthIndex = prePassRenderer.getIndex(this._useScreenspaceDepth ? 10 : 5);
824
+ const normalIndex = prePassRenderer.getIndex(6);
825
+ effect.setTexture("normalSampler", prePassRenderer.getRenderTarget().textures[normalIndex]);
826
+ effect.setTexture("depthSampler", prePassRenderer.getRenderTarget().textures[depthIndex]);
827
+ }
828
+ }
829
+ });
830
+ }
831
+ /**
832
+ * Serializes the rendering pipeline (Used when exporting)
833
+ * @returns the serialized object
834
+ */
835
+ serialize() {
836
+ const serializationObject = SerializationHelper.Serialize(this);
837
+ serializationObject.customType = "SSRRenderingPipeline";
838
+ return serializationObject;
839
+ }
840
+ },
841
+ (() => {
842
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
843
+ _get_samples_decorators = [serialize()];
844
+ _get_maxDistance_decorators = [serialize()];
845
+ _get_step_decorators = [serialize()];
846
+ _get_thickness_decorators = [serialize()];
847
+ _get_strength_decorators = [serialize()];
848
+ _get_reflectionSpecularFalloffExponent_decorators = [serialize()];
849
+ _get_maxSteps_decorators = [serialize()];
850
+ _get_roughnessFactor_decorators = [serialize()];
851
+ _get_selfCollisionNumSkip_decorators = [serialize()];
852
+ _get_reflectivityThreshold_decorators = [serialize()];
853
+ _get_ssrDownsample_decorators = [serialize()];
854
+ _get_blurDispersionStrength_decorators = [serialize("blurDispersionStrength")];
855
+ _get_blurDownsample_decorators = [serialize("blurDownsample")];
856
+ _get_enableSmoothReflections_decorators = [serialize("enableSmoothReflections")];
857
+ _get_environmentTexture_decorators = [serialize("environmentTexture")];
858
+ _get_environmentTextureIsProbe_decorators = [serialize("environmentTextureIsProbe")];
859
+ _get_attenuateScreenBorders_decorators = [serialize("attenuateScreenBorders")];
860
+ _get_attenuateIntersectionDistance_decorators = [serialize("attenuateIntersectionDistance")];
861
+ _get_attenuateIntersectionIterations_decorators = [serialize("attenuateIntersectionIterations")];
862
+ _get_attenuateFacingCamera_decorators = [serialize("attenuateFacingCamera")];
863
+ _get_attenuateBackfaceReflection_decorators = [serialize("attenuateBackfaceReflection")];
864
+ _get_clipToFrustum_decorators = [serialize("clipToFrustum")];
865
+ _get_useFresnel_decorators = [serialize("useFresnel")];
866
+ _get_enableAutomaticThicknessComputation_decorators = [serialize("enableAutomaticThicknessComputation")];
867
+ __backfaceDepthTextureDownsample_decorators = [serialize("backfaceDepthTextureDownsample")];
868
+ __backfaceForceDepthWriteTransparentMeshes_decorators = [serialize("backfaceForceDepthWriteTransparentMeshes")];
869
+ __isEnabled_decorators = [serialize("isEnabled")];
870
+ _get_inputTextureColorIsInGammaSpace_decorators = [serialize("inputTextureColorIsInGammaSpace")];
871
+ _get_generateOutputInGammaSpace_decorators = [serialize("generateOutputInGammaSpace")];
872
+ _get_debug_decorators = [serialize("debug")];
873
+ __esDecorate(_a, null, _get_samples_decorators, { kind: "getter", name: "samples", static: false, private: false, access: { has: obj => "samples" in obj, get: obj => obj.samples }, metadata: _metadata }, null, _instanceExtraInitializers);
874
+ __esDecorate(_a, null, _get_maxDistance_decorators, { kind: "getter", name: "maxDistance", static: false, private: false, access: { has: obj => "maxDistance" in obj, get: obj => obj.maxDistance }, metadata: _metadata }, null, _instanceExtraInitializers);
875
+ __esDecorate(_a, null, _get_step_decorators, { kind: "getter", name: "step", static: false, private: false, access: { has: obj => "step" in obj, get: obj => obj.step }, metadata: _metadata }, null, _instanceExtraInitializers);
876
+ __esDecorate(_a, null, _get_thickness_decorators, { kind: "getter", name: "thickness", static: false, private: false, access: { has: obj => "thickness" in obj, get: obj => obj.thickness }, metadata: _metadata }, null, _instanceExtraInitializers);
877
+ __esDecorate(_a, null, _get_strength_decorators, { kind: "getter", name: "strength", static: false, private: false, access: { has: obj => "strength" in obj, get: obj => obj.strength }, metadata: _metadata }, null, _instanceExtraInitializers);
878
+ __esDecorate(_a, null, _get_reflectionSpecularFalloffExponent_decorators, { kind: "getter", name: "reflectionSpecularFalloffExponent", static: false, private: false, access: { has: obj => "reflectionSpecularFalloffExponent" in obj, get: obj => obj.reflectionSpecularFalloffExponent }, metadata: _metadata }, null, _instanceExtraInitializers);
879
+ __esDecorate(_a, null, _get_maxSteps_decorators, { kind: "getter", name: "maxSteps", static: false, private: false, access: { has: obj => "maxSteps" in obj, get: obj => obj.maxSteps }, metadata: _metadata }, null, _instanceExtraInitializers);
880
+ __esDecorate(_a, null, _get_roughnessFactor_decorators, { kind: "getter", name: "roughnessFactor", static: false, private: false, access: { has: obj => "roughnessFactor" in obj, get: obj => obj.roughnessFactor }, metadata: _metadata }, null, _instanceExtraInitializers);
881
+ __esDecorate(_a, null, _get_selfCollisionNumSkip_decorators, { kind: "getter", name: "selfCollisionNumSkip", static: false, private: false, access: { has: obj => "selfCollisionNumSkip" in obj, get: obj => obj.selfCollisionNumSkip }, metadata: _metadata }, null, _instanceExtraInitializers);
882
+ __esDecorate(_a, null, _get_reflectivityThreshold_decorators, { kind: "getter", name: "reflectivityThreshold", static: false, private: false, access: { has: obj => "reflectivityThreshold" in obj, get: obj => obj.reflectivityThreshold }, metadata: _metadata }, null, _instanceExtraInitializers);
883
+ __esDecorate(_a, null, _get_ssrDownsample_decorators, { kind: "getter", name: "ssrDownsample", static: false, private: false, access: { has: obj => "ssrDownsample" in obj, get: obj => obj.ssrDownsample }, metadata: _metadata }, null, _instanceExtraInitializers);
884
+ __esDecorate(_a, null, _get_blurDispersionStrength_decorators, { kind: "getter", name: "blurDispersionStrength", static: false, private: false, access: { has: obj => "blurDispersionStrength" in obj, get: obj => obj.blurDispersionStrength }, metadata: _metadata }, null, _instanceExtraInitializers);
885
+ __esDecorate(_a, null, _get_blurDownsample_decorators, { kind: "getter", name: "blurDownsample", static: false, private: false, access: { has: obj => "blurDownsample" in obj, get: obj => obj.blurDownsample }, metadata: _metadata }, null, _instanceExtraInitializers);
886
+ __esDecorate(_a, null, _get_enableSmoothReflections_decorators, { kind: "getter", name: "enableSmoothReflections", static: false, private: false, access: { has: obj => "enableSmoothReflections" in obj, get: obj => obj.enableSmoothReflections }, metadata: _metadata }, null, _instanceExtraInitializers);
887
+ __esDecorate(_a, null, _get_environmentTexture_decorators, { kind: "getter", name: "environmentTexture", static: false, private: false, access: { has: obj => "environmentTexture" in obj, get: obj => obj.environmentTexture }, metadata: _metadata }, null, _instanceExtraInitializers);
888
+ __esDecorate(_a, null, _get_environmentTextureIsProbe_decorators, { kind: "getter", name: "environmentTextureIsProbe", static: false, private: false, access: { has: obj => "environmentTextureIsProbe" in obj, get: obj => obj.environmentTextureIsProbe }, metadata: _metadata }, null, _instanceExtraInitializers);
889
+ __esDecorate(_a, null, _get_attenuateScreenBorders_decorators, { kind: "getter", name: "attenuateScreenBorders", static: false, private: false, access: { has: obj => "attenuateScreenBorders" in obj, get: obj => obj.attenuateScreenBorders }, metadata: _metadata }, null, _instanceExtraInitializers);
890
+ __esDecorate(_a, null, _get_attenuateIntersectionDistance_decorators, { kind: "getter", name: "attenuateIntersectionDistance", static: false, private: false, access: { has: obj => "attenuateIntersectionDistance" in obj, get: obj => obj.attenuateIntersectionDistance }, metadata: _metadata }, null, _instanceExtraInitializers);
891
+ __esDecorate(_a, null, _get_attenuateIntersectionIterations_decorators, { kind: "getter", name: "attenuateIntersectionIterations", static: false, private: false, access: { has: obj => "attenuateIntersectionIterations" in obj, get: obj => obj.attenuateIntersectionIterations }, metadata: _metadata }, null, _instanceExtraInitializers);
892
+ __esDecorate(_a, null, _get_attenuateFacingCamera_decorators, { kind: "getter", name: "attenuateFacingCamera", static: false, private: false, access: { has: obj => "attenuateFacingCamera" in obj, get: obj => obj.attenuateFacingCamera }, metadata: _metadata }, null, _instanceExtraInitializers);
893
+ __esDecorate(_a, null, _get_attenuateBackfaceReflection_decorators, { kind: "getter", name: "attenuateBackfaceReflection", static: false, private: false, access: { has: obj => "attenuateBackfaceReflection" in obj, get: obj => obj.attenuateBackfaceReflection }, metadata: _metadata }, null, _instanceExtraInitializers);
894
+ __esDecorate(_a, null, _get_clipToFrustum_decorators, { kind: "getter", name: "clipToFrustum", static: false, private: false, access: { has: obj => "clipToFrustum" in obj, get: obj => obj.clipToFrustum }, metadata: _metadata }, null, _instanceExtraInitializers);
895
+ __esDecorate(_a, null, _get_useFresnel_decorators, { kind: "getter", name: "useFresnel", static: false, private: false, access: { has: obj => "useFresnel" in obj, get: obj => obj.useFresnel }, metadata: _metadata }, null, _instanceExtraInitializers);
896
+ __esDecorate(_a, null, _get_enableAutomaticThicknessComputation_decorators, { kind: "getter", name: "enableAutomaticThicknessComputation", static: false, private: false, access: { has: obj => "enableAutomaticThicknessComputation" in obj, get: obj => obj.enableAutomaticThicknessComputation }, metadata: _metadata }, null, _instanceExtraInitializers);
897
+ __esDecorate(_a, null, _get_inputTextureColorIsInGammaSpace_decorators, { kind: "getter", name: "inputTextureColorIsInGammaSpace", static: false, private: false, access: { has: obj => "inputTextureColorIsInGammaSpace" in obj, get: obj => obj.inputTextureColorIsInGammaSpace }, metadata: _metadata }, null, _instanceExtraInitializers);
898
+ __esDecorate(_a, null, _get_generateOutputInGammaSpace_decorators, { kind: "getter", name: "generateOutputInGammaSpace", static: false, private: false, access: { has: obj => "generateOutputInGammaSpace" in obj, get: obj => obj.generateOutputInGammaSpace }, metadata: _metadata }, null, _instanceExtraInitializers);
899
+ __esDecorate(_a, null, _get_debug_decorators, { kind: "getter", name: "debug", static: false, private: false, access: { has: obj => "debug" in obj, get: obj => obj.debug }, metadata: _metadata }, null, _instanceExtraInitializers);
900
+ __esDecorate(null, null, __backfaceDepthTextureDownsample_decorators, { kind: "field", name: "_backfaceDepthTextureDownsample", static: false, private: false, access: { has: obj => "_backfaceDepthTextureDownsample" in obj, get: obj => obj._backfaceDepthTextureDownsample, set: (obj, value) => { obj._backfaceDepthTextureDownsample = value; } }, metadata: _metadata }, __backfaceDepthTextureDownsample_initializers, __backfaceDepthTextureDownsample_extraInitializers);
901
+ __esDecorate(null, null, __backfaceForceDepthWriteTransparentMeshes_decorators, { kind: "field", name: "_backfaceForceDepthWriteTransparentMeshes", static: false, private: false, access: { has: obj => "_backfaceForceDepthWriteTransparentMeshes" in obj, get: obj => obj._backfaceForceDepthWriteTransparentMeshes, set: (obj, value) => { obj._backfaceForceDepthWriteTransparentMeshes = value; } }, metadata: _metadata }, __backfaceForceDepthWriteTransparentMeshes_initializers, __backfaceForceDepthWriteTransparentMeshes_extraInitializers);
902
+ __esDecorate(null, null, __isEnabled_decorators, { kind: "field", name: "_isEnabled", static: false, private: false, access: { has: obj => "_isEnabled" in obj, get: obj => obj._isEnabled, set: (obj, value) => { obj._isEnabled = value; } }, metadata: _metadata }, __isEnabled_initializers, __isEnabled_extraInitializers);
903
+ if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
904
+ })(),
905
+ _a;
906
+ })();
907
+ export { SSRRenderingPipeline };
891
908
  let _Registered = false;
892
909
  /**
893
910
  * Parse the serialized pipeline