@babylonjs/core 7.52.1 → 7.52.3

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 (247) hide show
  1. package/AudioV2/abstractAudio/abstractAudioBus.d.ts +11 -0
  2. package/AudioV2/abstractAudio/abstractAudioBus.js +10 -0
  3. package/AudioV2/abstractAudio/abstractAudioBus.js.map +1 -1
  4. package/AudioV2/abstractAudio/abstractSound.d.ts +11 -5
  5. package/AudioV2/abstractAudio/abstractSound.js +11 -5
  6. package/AudioV2/abstractAudio/abstractSound.js.map +1 -1
  7. package/AudioV2/abstractAudio/audioBus.d.ts +5 -6
  8. package/AudioV2/abstractAudio/audioBus.js +1 -5
  9. package/AudioV2/abstractAudio/audioBus.js.map +1 -1
  10. package/AudioV2/abstractAudio/audioEngineV2.d.ts +1 -2
  11. package/AudioV2/abstractAudio/audioEngineV2.js +1 -5
  12. package/AudioV2/abstractAudio/audioEngineV2.js.map +1 -1
  13. package/AudioV2/abstractAudio/components/spatialAudioAttacherComponent.d.ts +43 -0
  14. package/AudioV2/abstractAudio/components/spatialAudioAttacherComponent.js +71 -0
  15. package/AudioV2/abstractAudio/components/spatialAudioAttacherComponent.js.map +1 -0
  16. package/AudioV2/abstractAudio/mainAudioBus.d.ts +2 -2
  17. package/AudioV2/abstractAudio/mainAudioBus.js.map +1 -1
  18. package/AudioV2/abstractAudio/staticSound.d.ts +6 -6
  19. package/AudioV2/abstractAudio/staticSound.js +5 -5
  20. package/AudioV2/abstractAudio/staticSound.js.map +1 -1
  21. package/AudioV2/abstractAudio/streamingSound.d.ts +2 -2
  22. package/AudioV2/abstractAudio/streamingSound.js +3 -3
  23. package/AudioV2/abstractAudio/streamingSound.js.map +1 -1
  24. package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.d.ts +30 -6
  25. package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.js +44 -21
  26. package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.js.map +1 -1
  27. package/AudioV2/abstractAudio/subNodes/audioAnalyzerSubNode.d.ts +24 -0
  28. package/AudioV2/abstractAudio/subNodes/audioAnalyzerSubNode.js +30 -0
  29. package/AudioV2/abstractAudio/subNodes/audioAnalyzerSubNode.js.map +1 -0
  30. package/AudioV2/abstractAudio/subNodes/audioSubNode.d.ts +1 -0
  31. package/AudioV2/abstractAudio/subNodes/audioSubNode.js +1 -0
  32. package/AudioV2/abstractAudio/subNodes/audioSubNode.js.map +1 -1
  33. package/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.d.ts +15 -0
  34. package/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.js +38 -3
  35. package/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.js.map +1 -1
  36. package/AudioV2/abstractAudio/subNodes/stereoAudioSubNode.js.map +1 -1
  37. package/AudioV2/abstractAudio/subProperties/abstractAudioAnalyzer.d.ts +86 -0
  38. package/AudioV2/abstractAudio/subProperties/abstractAudioAnalyzer.js +29 -0
  39. package/AudioV2/abstractAudio/subProperties/abstractAudioAnalyzer.js.map +1 -0
  40. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.d.ts +29 -8
  41. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.js +1 -0
  42. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.js.map +1 -1
  43. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudioListener.d.ts +28 -1
  44. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudioListener.js +5 -1
  45. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudioListener.js.map +1 -1
  46. package/AudioV2/abstractAudio/subProperties/audioAnalyzer.d.ts +35 -0
  47. package/AudioV2/abstractAudio/subProperties/audioAnalyzer.js +96 -0
  48. package/AudioV2/abstractAudio/subProperties/audioAnalyzer.js.map +1 -0
  49. package/AudioV2/abstractAudio/subProperties/index.d.ts +1 -0
  50. package/AudioV2/abstractAudio/subProperties/index.js +1 -0
  51. package/AudioV2/abstractAudio/subProperties/index.js.map +1 -1
  52. package/AudioV2/abstractAudio/subProperties/spatialAudio.d.ts +16 -1
  53. package/AudioV2/abstractAudio/subProperties/spatialAudio.js +48 -14
  54. package/AudioV2/abstractAudio/subProperties/spatialAudio.js.map +1 -1
  55. package/AudioV2/abstractAudio/subProperties/spatialAudioListener.d.ts +21 -0
  56. package/AudioV2/abstractAudio/subProperties/spatialAudioListener.js +39 -4
  57. package/AudioV2/abstractAudio/subProperties/spatialAudioListener.js.map +1 -1
  58. package/AudioV2/index.d.ts +1 -0
  59. package/AudioV2/index.js +1 -0
  60. package/AudioV2/index.js.map +1 -1
  61. package/AudioV2/spatialAudioAttachmentType.d.ts +5 -0
  62. package/AudioV2/spatialAudioAttachmentType.js +7 -0
  63. package/AudioV2/spatialAudioAttachmentType.js.map +1 -0
  64. package/AudioV2/webAudio/components/spatialWebAudioUpdaterComponent.d.ts +13 -0
  65. package/AudioV2/webAudio/components/spatialWebAudioUpdaterComponent.js +38 -0
  66. package/AudioV2/webAudio/components/spatialWebAudioUpdaterComponent.js.map +1 -0
  67. package/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.d.ts +13 -14
  68. package/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.js +39 -39
  69. package/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.js.map +1 -1
  70. package/AudioV2/webAudio/subNodes/webAudioAnalyzerSubNode.d.ts +37 -0
  71. package/AudioV2/webAudio/subNodes/webAudioAnalyzerSubNode.js +85 -0
  72. package/AudioV2/webAudio/subNodes/webAudioAnalyzerSubNode.js.map +1 -0
  73. package/AudioV2/webAudio/subNodes/webAudioBaseSubGraph.d.ts +5 -3
  74. package/AudioV2/webAudio/subNodes/webAudioBaseSubGraph.js +25 -2
  75. package/AudioV2/webAudio/subNodes/webAudioBaseSubGraph.js.map +1 -1
  76. package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.d.ts +2 -1
  77. package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.js +32 -17
  78. package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.js.map +1 -1
  79. package/AudioV2/webAudio/subProperties/spatialWebAudio.d.ts +6 -2
  80. package/AudioV2/webAudio/subProperties/spatialWebAudio.js +13 -15
  81. package/AudioV2/webAudio/subProperties/spatialWebAudio.js.map +1 -1
  82. package/AudioV2/webAudio/subProperties/spatialWebAudioListener.d.ts +1 -1
  83. package/AudioV2/webAudio/subProperties/spatialWebAudioListener.js +41 -56
  84. package/AudioV2/webAudio/subProperties/spatialWebAudioListener.js.map +1 -1
  85. package/AudioV2/webAudio/webAudioBus.d.ts +3 -0
  86. package/AudioV2/webAudio/webAudioBus.js +23 -2
  87. package/AudioV2/webAudio/webAudioBus.js.map +1 -1
  88. package/AudioV2/webAudio/webAudioEngine.d.ts +3 -1
  89. package/AudioV2/webAudio/webAudioEngine.js +11 -3
  90. package/AudioV2/webAudio/webAudioEngine.js.map +1 -1
  91. package/AudioV2/webAudio/webAudioStaticSound.d.ts +3 -0
  92. package/AudioV2/webAudio/webAudioStaticSound.js +23 -2
  93. package/AudioV2/webAudio/webAudioStaticSound.js.map +1 -1
  94. package/AudioV2/webAudio/webAudioStreamingSound.d.ts +3 -0
  95. package/AudioV2/webAudio/webAudioStreamingSound.js +23 -2
  96. package/AudioV2/webAudio/webAudioStreamingSound.js.map +1 -1
  97. package/Engines/WebGPU/webgpuTextureManager.d.ts +0 -1
  98. package/Engines/WebGPU/webgpuTextureManager.js +2 -57
  99. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
  100. package/Engines/abstractEngine.d.ts +6 -0
  101. package/Engines/abstractEngine.js +3 -3
  102. package/Engines/abstractEngine.js.map +1 -1
  103. package/Engines/engine.common.js +4 -0
  104. package/Engines/engine.common.js.map +1 -1
  105. package/Engines/nativeEngine.d.ts +1 -0
  106. package/Engines/nativeEngine.js +3 -0
  107. package/Engines/nativeEngine.js.map +1 -1
  108. package/Engines/nullEngine.d.ts +1 -0
  109. package/Engines/nullEngine.js +1 -0
  110. package/Engines/nullEngine.js.map +1 -1
  111. package/Engines/thinEngine.d.ts +1 -0
  112. package/Engines/thinEngine.js +7 -4
  113. package/Engines/thinEngine.js.map +1 -1
  114. package/Engines/webgpuEngine.d.ts +2 -1
  115. package/Engines/webgpuEngine.js +12 -9
  116. package/Engines/webgpuEngine.js.map +1 -1
  117. package/FlowGraph/Blocks/Data/flowGraphDataSwitchBlock.d.ts +48 -0
  118. package/FlowGraph/Blocks/Data/flowGraphDataSwitchBlock.js +54 -0
  119. package/FlowGraph/Blocks/Data/flowGraphDataSwitchBlock.js.map +1 -0
  120. package/FlowGraph/Blocks/Data/index.d.ts +1 -0
  121. package/FlowGraph/Blocks/Data/index.js +1 -0
  122. package/FlowGraph/Blocks/Data/index.js.map +1 -1
  123. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.d.ts +1 -0
  124. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +19 -13
  125. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
  126. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js +3 -5
  127. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
  128. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.js +1 -1
  129. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.js.map +1 -1
  130. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.js +2 -4
  131. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.js.map +1 -1
  132. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js +1 -1
  133. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -1
  134. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js +1 -2
  135. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
  136. package/FlowGraph/Blocks/flowGraphBlockFactory.js +2 -0
  137. package/FlowGraph/Blocks/flowGraphBlockFactory.js.map +1 -1
  138. package/FlowGraph/Blocks/flowGraphBlockNames.d.ts +2 -1
  139. package/FlowGraph/Blocks/flowGraphBlockNames.js +1 -0
  140. package/FlowGraph/Blocks/flowGraphBlockNames.js.map +1 -1
  141. package/FlowGraph/CustomTypes/flowGraphInteger.d.ts +1 -0
  142. package/FlowGraph/CustomTypes/flowGraphInteger.js +3 -0
  143. package/FlowGraph/CustomTypes/flowGraphInteger.js.map +1 -1
  144. package/FlowGraph/CustomTypes/flowGraphMatrix.d.ts +2 -0
  145. package/FlowGraph/CustomTypes/flowGraphMatrix.js +6 -0
  146. package/FlowGraph/CustomTypes/flowGraphMatrix.js.map +1 -1
  147. package/FlowGraph/flowGraphExecutionBlock.d.ts +1 -0
  148. package/FlowGraph/flowGraphExecutionBlock.js +4 -0
  149. package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
  150. package/FlowGraph/utils.d.ts +2 -1
  151. package/FlowGraph/utils.js +7 -2
  152. package/FlowGraph/utils.js.map +1 -1
  153. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js +2 -2
  154. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js.map +1 -1
  155. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js +2 -2
  156. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js.map +1 -1
  157. package/FrameGraph/Node/Blocks/PostProcesses/ssrPostProcessBlock.d.ts +126 -0
  158. package/FrameGraph/Node/Blocks/PostProcesses/ssrPostProcessBlock.js +497 -0
  159. package/FrameGraph/Node/Blocks/PostProcesses/ssrPostProcessBlock.js.map +1 -0
  160. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.d.ts +6 -0
  161. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js +30 -4
  162. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js.map +1 -1
  163. package/FrameGraph/Node/Blocks/index.d.ts +1 -0
  164. package/FrameGraph/Node/Blocks/index.js +1 -0
  165. package/FrameGraph/Node/Blocks/index.js.map +1 -1
  166. package/FrameGraph/Node/nodeRenderGraph.js +1 -1
  167. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  168. package/FrameGraph/Tasks/PostProcesses/bloomTask.d.ts +2 -3
  169. package/FrameGraph/Tasks/PostProcesses/bloomTask.js +3 -4
  170. package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -1
  171. package/FrameGraph/Tasks/PostProcesses/blurTask.js +2 -2
  172. package/FrameGraph/Tasks/PostProcesses/blurTask.js.map +1 -1
  173. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.d.ts +2 -3
  174. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js +4 -5
  175. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js.map +1 -1
  176. package/FrameGraph/Tasks/PostProcesses/postProcessTask.d.ts +6 -0
  177. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +14 -0
  178. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
  179. package/FrameGraph/Tasks/PostProcesses/ssrBlurTask.d.ts +11 -0
  180. package/FrameGraph/Tasks/PostProcesses/ssrBlurTask.js +18 -0
  181. package/FrameGraph/Tasks/PostProcesses/ssrBlurTask.js.map +1 -0
  182. package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.d.ts +76 -0
  183. package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js +170 -0
  184. package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js.map +1 -0
  185. package/FrameGraph/Tasks/PostProcesses/ssrTask.d.ts +16 -0
  186. package/FrameGraph/Tasks/PostProcesses/ssrTask.js +45 -0
  187. package/FrameGraph/Tasks/PostProcesses/ssrTask.js.map +1 -0
  188. package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +10 -0
  189. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +29 -0
  190. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
  191. package/FrameGraph/frameGraph.d.ts +7 -3
  192. package/FrameGraph/frameGraph.js +10 -4
  193. package/FrameGraph/frameGraph.js.map +1 -1
  194. package/FrameGraph/frameGraphTextureManager.d.ts +2 -1
  195. package/FrameGraph/frameGraphTextureManager.js +4 -3
  196. package/FrameGraph/frameGraphTextureManager.js.map +1 -1
  197. package/FrameGraph/index.d.ts +1 -0
  198. package/FrameGraph/index.js +1 -0
  199. package/FrameGraph/index.js.map +1 -1
  200. package/Materials/PBR/pbrBaseMaterial.js +1 -1
  201. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  202. package/Materials/effectRenderer.js +1 -1
  203. package/Materials/effectRenderer.js.map +1 -1
  204. package/Materials/material.js +5 -3
  205. package/Materials/material.js.map +1 -1
  206. package/Materials/materialHelper.geometryrendering.d.ts +7 -5
  207. package/Materials/materialHelper.geometryrendering.js +8 -3
  208. package/Materials/materialHelper.geometryrendering.js.map +1 -1
  209. package/Materials/standardMaterial.js +1 -1
  210. package/Materials/standardMaterial.js.map +1 -1
  211. package/Meshes/geometry.js +18 -7
  212. package/Meshes/geometry.js.map +1 -1
  213. package/Meshes/mesh.vertexData.d.ts +1 -1
  214. package/Meshes/mesh.vertexData.js +2 -1
  215. package/Meshes/mesh.vertexData.js.map +1 -1
  216. package/Particles/particleSystemComponent.d.ts +2 -1
  217. package/Particles/particleSystemComponent.js +2 -2
  218. package/Particles/particleSystemComponent.js.map +1 -1
  219. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.d.ts +23 -30
  220. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js +226 -411
  221. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js.map +1 -1
  222. package/PostProcesses/RenderPipeline/Pipelines/thinSSRRenderingPipeline.d.ts +222 -0
  223. package/PostProcesses/RenderPipeline/Pipelines/thinSSRRenderingPipeline.js +373 -0
  224. package/PostProcesses/RenderPipeline/Pipelines/thinSSRRenderingPipeline.js.map +1 -0
  225. package/PostProcesses/thinDepthOfFieldEffect.d.ts +4 -4
  226. package/PostProcesses/thinDepthOfFieldEffect.js.map +1 -1
  227. package/PostProcesses/thinSSRBlurCombinerPostProcess.d.ts +41 -0
  228. package/PostProcesses/thinSSRBlurCombinerPostProcess.js +185 -0
  229. package/PostProcesses/thinSSRBlurCombinerPostProcess.js.map +1 -0
  230. package/PostProcesses/thinSSRBlurPostProcess.d.ts +18 -0
  231. package/PostProcesses/thinSSRBlurPostProcess.js +47 -0
  232. package/PostProcesses/thinSSRBlurPostProcess.js.map +1 -0
  233. package/PostProcesses/thinSSRPostProcess.d.ts +94 -0
  234. package/PostProcesses/thinSSRPostProcess.js +416 -0
  235. package/PostProcesses/thinSSRPostProcess.js.map +1 -0
  236. package/Rendering/IBLShadows/iblShadowsRenderPipeline.d.ts +2 -0
  237. package/Rendering/IBLShadows/iblShadowsRenderPipeline.js +2 -0
  238. package/Rendering/IBLShadows/iblShadowsRenderPipeline.js.map +1 -1
  239. package/Rendering/iblCdfGenerator.js +1 -1
  240. package/Rendering/iblCdfGenerator.js.map +1 -1
  241. package/Shaders/screenSpaceReflection2BlurCombiner.fragment.js +13 -2
  242. package/Shaders/screenSpaceReflection2BlurCombiner.fragment.js.map +1 -1
  243. package/ShadersWGSL/geometry.fragment.js +1 -1
  244. package/ShadersWGSL/geometry.fragment.js.map +1 -1
  245. package/ShadersWGSL/screenSpaceReflection2BlurCombiner.fragment.js +13 -2
  246. package/ShadersWGSL/screenSpaceReflection2BlurCombiner.fragment.js.map +1 -1
  247. package/package.json +1 -1
@@ -17,9 +17,10 @@ declare module "../Engines/abstractEngine" {
17
17
  * @param onError defines a function to call when the effect creation has failed
18
18
  * @param particleSystem the particle system you want to create the effect for
19
19
  * @param shaderLanguage defines the shader language to use
20
+ * @param vertexName defines the vertex base name of the effect (The name of file without .vertex.fx)
20
21
  * @returns the new Effect
21
22
  */
22
- createEffectForParticles(fragmentName: string, uniformsNames: string[], samplers: string[], defines: string, fallbacks?: EffectFallbacks, onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void, particleSystem?: IParticleSystem, shaderLanguage?: ShaderLanguage): Effect;
23
+ createEffectForParticles(fragmentName: string, uniformsNames: string[], samplers: string[], defines: string, fallbacks?: EffectFallbacks, onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void, particleSystem?: IParticleSystem, shaderLanguage?: ShaderLanguage, vertexName?: string): Effect;
23
24
  }
24
25
  }
25
26
  declare module "../Meshes/mesh" {
@@ -28,7 +28,7 @@ AddIndividualParser(SceneComponentConstants.NAME_PARTICLESYSTEM, (parsedParticle
28
28
  return ps;
29
29
  }
30
30
  });
31
- AbstractEngine.prototype.createEffectForParticles = function (fragmentName, uniformsNames = [], samplers = [], defines = "", fallbacks, onCompiled, onError, particleSystem, shaderLanguage = 0 /* ShaderLanguage.GLSL */) {
31
+ AbstractEngine.prototype.createEffectForParticles = function (fragmentName, uniformsNames = [], samplers = [], defines = "", fallbacks, onCompiled, onError, particleSystem, shaderLanguage = 0 /* ShaderLanguage.GLSL */, vertexName) {
32
32
  let attributesNamesOrOptions = [];
33
33
  let effectCreationOption = [];
34
34
  const allSamplers = [];
@@ -51,7 +51,7 @@ AbstractEngine.prototype.createEffectForParticles = function (fragmentName, unif
51
51
  samplers.push("diffuseSampler");
52
52
  }
53
53
  return this.createEffect({
54
- vertex: particleSystem?.vertexShaderName ?? "particles",
54
+ vertex: vertexName ?? particleSystem?.vertexShaderName ?? "particles",
55
55
  fragmentElement: fragmentName,
56
56
  }, attributesNamesOrOptions, effectCreationOption.concat(uniformsNames), allSamplers.concat(samplers), defines, fallbacks, onCompiled, onError, undefined, shaderLanguage, async () => {
57
57
  if (shaderLanguage === 0 /* ShaderLanguage.GLSL */) {
@@ -1 +1 @@
1
- {"version":3,"file":"particleSystemComponent.js","sourceRoot":"","sources":["../../../../dev/core/src/Particles/particleSystemComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAG5D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,yDAAwD;AAEtH,yCAAyC;AACzC,SAAS,CAAC,uBAAuB,CAAC,mBAAmB,EAAE,CAAC,UAAe,EAAE,KAAY,EAAE,SAAyB,EAAE,OAAe,EAAE,EAAE;IACjI,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,uBAAuB,CAAC,mBAAmB,CAAC,CAAC;IAE1F,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACpB,OAAO;IACX,CAAC;IAED,oBAAoB;IACpB,IAAI,UAAU,CAAC,eAAe,KAAK,SAAS,IAAI,UAAU,CAAC,eAAe,KAAK,IAAI,EAAE,CAAC;QAClF,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,UAAU,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,GAAG,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC;YACpF,MAAM,oBAAoB,GAAG,UAAU,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;YAC/D,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,gBAAgB,CAAC,oBAAoB,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;QAC3F,CAAC;IACL,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,mBAAmB,CAAC,uBAAuB,CAAC,mBAAmB,EAAE,CAAC,oBAAyB,EAAE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WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;IAC1C,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEvB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;QAC1E,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QAC9D,MAAM,OAAO,GAAQ,cAAc,CAAC,OAAO,CAAC;QAE5C,IAAI,OAAO,CAAC,QAAQ,IAAI,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;YAC1D,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACjC,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC","sourcesContent":["import { Mesh } from \"../Meshes/mesh\";\r\nimport type { IParticleSystem } from \"./IParticleSystem\";\r\nimport { GPUParticleSystem } from \"./gpuParticleSystem\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport { ParticleSystem } from \"./particleSystem\";\r\nimport type { Scene } from \"../scene\";\r\nimport { SceneComponentConstants } from \"../sceneComponent\";\r\nimport type { AssetContainer } from \"../assetContainer\";\r\nimport type { EffectFallbacks } from \"../Materials/effectFallbacks\";\r\nimport { AbstractEngine } from \"../Engines/abstractEngine\";\r\nimport { ShaderLanguage } from \"core/Materials/shaderLanguage\";\r\nimport { AddParser, AddIndividualParser, GetIndividualParser } from \"core/Loading/Plugins/babylonFileParser.function\";\r\n\r\n// Adds the parsers to the scene parsers.\r\nAddParser(SceneComponentConstants.NAME_PARTICLESYSTEM, (parsedData: any, scene: Scene, container: AssetContainer, rootUrl: string) => {\r\n const individualParser = GetIndividualParser(SceneComponentConstants.NAME_PARTICLESYSTEM);\r\n\r\n if (!individualParser) {\r\n return;\r\n }\r\n\r\n // Particles Systems\r\n if (parsedData.particleSystems !== undefined && parsedData.particleSystems !== null) {\r\n for (let index = 0, cache = parsedData.particleSystems.length; index < cache; index++) {\r\n const parsedParticleSystem = parsedData.particleSystems[index];\r\n container.particleSystems.push(individualParser(parsedParticleSystem, scene, rootUrl));\r\n }\r\n }\r\n});\r\n\r\nAddIndividualParser(SceneComponentConstants.NAME_PARTICLESYSTEM, (parsedParticleSystem: any, scene: Scene, rootUrl: string) => {\r\n if (parsedParticleSystem.activeParticleCount) {\r\n const ps = GPUParticleSystem.Parse(parsedParticleSystem, scene, rootUrl);\r\n return ps;\r\n } else {\r\n const ps = ParticleSystem.Parse(parsedParticleSystem, scene, rootUrl);\r\n return ps;\r\n }\r\n});\r\n\r\ndeclare module \"../Engines/abstractEngine\" {\r\n export interface AbstractEngine {\r\n /**\r\n * Create an effect to use with particle systems.\r\n * Please note that some parameters like animation sheets or not being billboard are not supported in this configuration, except if you pass\r\n * the particle system for which you want to create a custom effect in the last parameter\r\n * @param fragmentName defines the base name of the effect (The name of file without .fragment.fx)\r\n * @param uniformsNames defines a list of attribute names\r\n * @param samplers defines an array of string used to represent textures\r\n * @param defines defines the string containing the defines to use to compile the shaders\r\n * @param fallbacks defines the list of potential fallbacks to use if shader compilation fails\r\n * @param onCompiled defines a function to call when the effect creation is successful\r\n * @param onError defines a function to call when the effect creation has failed\r\n * @param particleSystem the particle system you want to create the effect for\r\n * @param shaderLanguage defines the shader language to use\r\n * @returns the new Effect\r\n */\r\n createEffectForParticles(\r\n fragmentName: string,\r\n uniformsNames: string[],\r\n samplers: string[],\r\n defines: string,\r\n fallbacks?: EffectFallbacks,\r\n onCompiled?: (effect: Effect) => void,\r\n onError?: (effect: Effect, errors: string) => void,\r\n particleSystem?: IParticleSystem,\r\n shaderLanguage?: ShaderLanguage\r\n ): Effect;\r\n }\r\n}\r\n\r\nAbstractEngine.prototype.createEffectForParticles = function (\r\n fragmentName: string,\r\n uniformsNames: string[] = [],\r\n samplers: string[] = [],\r\n defines = \"\",\r\n fallbacks?: EffectFallbacks,\r\n onCompiled?: (effect: Effect) => void,\r\n onError?: (effect: Effect, errors: string) => void,\r\n particleSystem?: IParticleSystem,\r\n shaderLanguage = ShaderLanguage.GLSL\r\n): Effect {\r\n let attributesNamesOrOptions: Array<string> = [];\r\n let effectCreationOption: Array<string> = [];\r\n const allSamplers: Array<string> = [];\r\n\r\n if (particleSystem) {\r\n particleSystem.fillUniformsAttributesAndSamplerNames(effectCreationOption, attributesNamesOrOptions, allSamplers);\r\n } else {\r\n attributesNamesOrOptions = ParticleSystem._GetAttributeNamesOrOptions();\r\n effectCreationOption = ParticleSystem._GetEffectCreationOptions();\r\n }\r\n\r\n if (defines.indexOf(\" BILLBOARD\") === -1) {\r\n defines += \"\\n#define BILLBOARD\\n\";\r\n }\r\n\r\n if (particleSystem?.isAnimationSheetEnabled) {\r\n if (defines.indexOf(\" ANIMATESHEET\") === -1) {\r\n defines += \"\\n#define ANIMATESHEET\\n\";\r\n }\r\n }\r\n\r\n if (samplers.indexOf(\"diffuseSampler\") === -1) {\r\n samplers.push(\"diffuseSampler\");\r\n }\r\n\r\n return this.createEffect(\r\n {\r\n vertex: particleSystem?.vertexShaderName ?? \"particles\",\r\n fragmentElement: fragmentName,\r\n },\r\n attributesNamesOrOptions,\r\n effectCreationOption.concat(uniformsNames),\r\n allSamplers.concat(samplers),\r\n defines,\r\n fallbacks,\r\n onCompiled,\r\n onError,\r\n undefined,\r\n shaderLanguage,\r\n async () => {\r\n if (shaderLanguage === ShaderLanguage.GLSL) {\r\n await import(\"../Shaders/particles.vertex\");\r\n } else {\r\n await import(\"../ShadersWGSL/particles.vertex\");\r\n }\r\n }\r\n );\r\n};\r\n\r\ndeclare module \"../Meshes/mesh\" {\r\n export interface Mesh {\r\n /**\r\n * Returns an array populated with IParticleSystem objects whose the mesh is the emitter\r\n * @returns an array of IParticleSystem\r\n */\r\n getEmittedParticleSystems(): IParticleSystem[];\r\n\r\n /**\r\n * Returns an array populated with IParticleSystem objects whose the mesh or its children are the emitter\r\n * @returns an array of IParticleSystem\r\n */\r\n getHierarchyEmittedParticleSystems(): IParticleSystem[];\r\n }\r\n}\r\n\r\nMesh.prototype.getEmittedParticleSystems = function (): IParticleSystem[] {\r\n const results: IParticleSystem[] = [];\r\n for (let index = 0; index < this.getScene().particleSystems.length; index++) {\r\n const particleSystem = this.getScene().particleSystems[index];\r\n if (particleSystem.emitter === this) {\r\n results.push(particleSystem);\r\n }\r\n }\r\n return results;\r\n};\r\n\r\nMesh.prototype.getHierarchyEmittedParticleSystems = function (): IParticleSystem[] {\r\n const results: IParticleSystem[] = [];\r\n const descendants = this.getDescendants();\r\n descendants.push(this);\r\n\r\n for (let index = 0; index < this.getScene().particleSystems.length; index++) {\r\n const particleSystem = this.getScene().particleSystems[index];\r\n const emitter: any = particleSystem.emitter;\r\n\r\n if (emitter.position && descendants.indexOf(emitter) !== -1) {\r\n results.push(particleSystem);\r\n }\r\n }\r\n\r\n return results;\r\n};\r\n"]}
1
+ {"version":3,"file":"particleSystemComponent.js","sourceRoot":"","sources":["../../../../dev/core/src/Particles/particleSystemComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAG5D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,yDAAwD;AAEtH,yCAAyC;AACzC,SAAS,CAAC,uBAAuB,CAAC,mBAAmB,EAAE,CAAC,UAAe,EAAE,KAAY,EAAE,SAAyB,EAAE,OAAe,EAAE,EAAE;IACjI,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,uBAAuB,CAAC,mBAAmB,C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from \"../Meshes/mesh\";\r\nimport type { IParticleSystem } from \"./IParticleSystem\";\r\nimport { GPUParticleSystem } from \"./gpuParticleSystem\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport { ParticleSystem } from \"./particleSystem\";\r\nimport type { Scene } from \"../scene\";\r\nimport { SceneComponentConstants } from \"../sceneComponent\";\r\nimport type { AssetContainer } from \"../assetContainer\";\r\nimport type { EffectFallbacks } from \"../Materials/effectFallbacks\";\r\nimport { AbstractEngine } from \"../Engines/abstractEngine\";\r\nimport { ShaderLanguage } from \"core/Materials/shaderLanguage\";\r\nimport { AddParser, AddIndividualParser, GetIndividualParser } from \"core/Loading/Plugins/babylonFileParser.function\";\r\n\r\n// Adds the parsers to the scene parsers.\r\nAddParser(SceneComponentConstants.NAME_PARTICLESYSTEM, (parsedData: any, scene: Scene, container: AssetContainer, rootUrl: string) => {\r\n const individualParser = GetIndividualParser(SceneComponentConstants.NAME_PARTICLESYSTEM);\r\n\r\n if (!individualParser) {\r\n return;\r\n }\r\n\r\n // Particles Systems\r\n if (parsedData.particleSystems !== undefined && parsedData.particleSystems !== null) {\r\n for (let index = 0, cache = parsedData.particleSystems.length; index < cache; index++) {\r\n const parsedParticleSystem = parsedData.particleSystems[index];\r\n container.particleSystems.push(individualParser(parsedParticleSystem, scene, rootUrl));\r\n }\r\n }\r\n});\r\n\r\nAddIndividualParser(SceneComponentConstants.NAME_PARTICLESYSTEM, (parsedParticleSystem: any, scene: Scene, rootUrl: string) => {\r\n if (parsedParticleSystem.activeParticleCount) {\r\n const ps = GPUParticleSystem.Parse(parsedParticleSystem, scene, rootUrl);\r\n return ps;\r\n } else {\r\n const ps = ParticleSystem.Parse(parsedParticleSystem, scene, rootUrl);\r\n return ps;\r\n }\r\n});\r\n\r\ndeclare module \"../Engines/abstractEngine\" {\r\n export interface AbstractEngine {\r\n /**\r\n * Create an effect to use with particle systems.\r\n * Please note that some parameters like animation sheets or not being billboard are not supported in this configuration, except if you pass\r\n * the particle system for which you want to create a custom effect in the last parameter\r\n * @param fragmentName defines the base name of the effect (The name of file without .fragment.fx)\r\n * @param uniformsNames defines a list of attribute names\r\n * @param samplers defines an array of string used to represent textures\r\n * @param defines defines the string containing the defines to use to compile the shaders\r\n * @param fallbacks defines the list of potential fallbacks to use if shader compilation fails\r\n * @param onCompiled defines a function to call when the effect creation is successful\r\n * @param onError defines a function to call when the effect creation has failed\r\n * @param particleSystem the particle system you want to create the effect for\r\n * @param shaderLanguage defines the shader language to use\r\n * @param vertexName defines the vertex base name of the effect (The name of file without .vertex.fx)\r\n * @returns the new Effect\r\n */\r\n createEffectForParticles(\r\n fragmentName: string,\r\n uniformsNames: string[],\r\n samplers: string[],\r\n defines: string,\r\n fallbacks?: EffectFallbacks,\r\n onCompiled?: (effect: Effect) => void,\r\n onError?: (effect: Effect, errors: string) => void,\r\n particleSystem?: IParticleSystem,\r\n shaderLanguage?: ShaderLanguage,\r\n vertexName?: string\r\n ): Effect;\r\n }\r\n}\r\n\r\nAbstractEngine.prototype.createEffectForParticles = function (\r\n fragmentName: string,\r\n uniformsNames: string[] = [],\r\n samplers: string[] = [],\r\n defines = \"\",\r\n fallbacks?: EffectFallbacks,\r\n onCompiled?: (effect: Effect) => void,\r\n onError?: (effect: Effect, errors: string) => void,\r\n particleSystem?: IParticleSystem,\r\n shaderLanguage = ShaderLanguage.GLSL,\r\n vertexName?: string\r\n): Effect {\r\n let attributesNamesOrOptions: Array<string> = [];\r\n let effectCreationOption: Array<string> = [];\r\n const allSamplers: Array<string> = [];\r\n\r\n if (particleSystem) {\r\n particleSystem.fillUniformsAttributesAndSamplerNames(effectCreationOption, attributesNamesOrOptions, allSamplers);\r\n } else {\r\n attributesNamesOrOptions = ParticleSystem._GetAttributeNamesOrOptions();\r\n effectCreationOption = ParticleSystem._GetEffectCreationOptions();\r\n }\r\n\r\n if (defines.indexOf(\" BILLBOARD\") === -1) {\r\n defines += \"\\n#define BILLBOARD\\n\";\r\n }\r\n\r\n if (particleSystem?.isAnimationSheetEnabled) {\r\n if (defines.indexOf(\" ANIMATESHEET\") === -1) {\r\n defines += \"\\n#define ANIMATESHEET\\n\";\r\n }\r\n }\r\n\r\n if (samplers.indexOf(\"diffuseSampler\") === -1) {\r\n samplers.push(\"diffuseSampler\");\r\n }\r\n\r\n return this.createEffect(\r\n {\r\n vertex: vertexName ?? particleSystem?.vertexShaderName ?? \"particles\",\r\n fragmentElement: fragmentName,\r\n },\r\n attributesNamesOrOptions,\r\n effectCreationOption.concat(uniformsNames),\r\n allSamplers.concat(samplers),\r\n defines,\r\n fallbacks,\r\n onCompiled,\r\n onError,\r\n undefined,\r\n shaderLanguage,\r\n async () => {\r\n if (shaderLanguage === ShaderLanguage.GLSL) {\r\n await import(\"../Shaders/particles.vertex\");\r\n } else {\r\n await import(\"../ShadersWGSL/particles.vertex\");\r\n }\r\n }\r\n );\r\n};\r\n\r\ndeclare module \"../Meshes/mesh\" {\r\n export interface Mesh {\r\n /**\r\n * Returns an array populated with IParticleSystem objects whose the mesh is the emitter\r\n * @returns an array of IParticleSystem\r\n */\r\n getEmittedParticleSystems(): IParticleSystem[];\r\n\r\n /**\r\n * Returns an array populated with IParticleSystem objects whose the mesh or its children are the emitter\r\n * @returns an array of IParticleSystem\r\n */\r\n getHierarchyEmittedParticleSystems(): IParticleSystem[];\r\n }\r\n}\r\n\r\nMesh.prototype.getEmittedParticleSystems = function (): IParticleSystem[] {\r\n const results: IParticleSystem[] = [];\r\n for (let index = 0; index < this.getScene().particleSystems.length; index++) {\r\n const particleSystem = this.getScene().particleSystems[index];\r\n if (particleSystem.emitter === this) {\r\n results.push(particleSystem);\r\n }\r\n }\r\n return results;\r\n};\r\n\r\nMesh.prototype.getHierarchyEmittedParticleSystems = function (): IParticleSystem[] {\r\n const results: IParticleSystem[] = [];\r\n const descendants = this.getDescendants();\r\n descendants.push(this);\r\n\r\n for (let index = 0; index < this.getScene().particleSystems.length; index++) {\r\n const particleSystem = this.getScene().particleSystems[index];\r\n const emitter: any = particleSystem.emitter;\r\n\r\n if (emitter.position && descendants.indexOf(emitter) !== -1) {\r\n results.push(particleSystem);\r\n }\r\n }\r\n\r\n return results;\r\n};\r\n"]}
@@ -4,6 +4,7 @@ import type { Scene } from "../../../scene";
4
4
  import type { Nullable } from "../../../types";
5
5
  import type { CubeTexture } from "../../../Materials/Textures/cubeTexture";
6
6
  import { DepthRenderer } from "../../../Rendering/depthRenderer";
7
+ import { ThinSSRRenderingPipeline } from "./thinSSRRenderingPipeline";
7
8
  import "../postProcessRenderPipelineManagerSceneComponent";
8
9
  /**
9
10
  * Render pipeline to produce Screen Space Reflections (SSR) effect
@@ -31,6 +32,8 @@ export declare class SSRRenderingPipeline extends PostProcessRenderPipeline {
31
32
  * The PostProcess effect id in the pipeline that combines the SSR-Blur output with the original scene color
32
33
  */
33
34
  SSRCombineRenderEffect: string;
35
+ /** @internal */
36
+ _thinSSRRenderingPipeline: ThinSSRRenderingPipeline;
34
37
  private _samples;
35
38
  /**
36
39
  * MSAA sample count, setting this to 4 will provide 4x anti aliasing. (default: 1)
@@ -41,50 +44,56 @@ export declare class SSRRenderingPipeline extends PostProcessRenderPipeline {
41
44
  * Gets or sets the maxDistance used to define how far we look for reflection during the ray-marching on the reflected ray (default: 1000).
42
45
  * Note that this value is a view (camera) space distance (not pixels!).
43
46
  */
44
- maxDistance: number;
47
+ get maxDistance(): number;
48
+ set maxDistance(distance: number);
45
49
  /**
46
50
  * 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).
47
51
  * Use higher values to improve performances (but at the expense of quality).
48
52
  */
49
- step: number;
53
+ get step(): number;
54
+ set step(step: number);
50
55
  /**
51
56
  * Gets or sets the thickness value used as tolerance when computing the intersection between the reflected ray and the scene (default: 0.5).
52
57
  * If setting "enableAutomaticThicknessComputation" to true, you can use lower values for "thickness" (even 0), as the geometry thickness
53
58
  * is automatically computed thank to the regular depth buffer + the backface depth buffer
54
59
  */
55
- thickness: number;
60
+ get thickness(): number;
61
+ set thickness(thickness: number);
56
62
  /**
57
63
  * Gets or sets the current reflection strength. 1.0 is an ideal value but can be increased/decreased for particular results (default: 1).
58
64
  */
59
- strength: number;
65
+ get strength(): number;
66
+ set strength(strength: number);
60
67
  /**
61
68
  * Gets or sets the falloff exponent used to compute the reflection strength. Higher values lead to fainter reflections (default: 1).
62
69
  */
63
- reflectionSpecularFalloffExponent: number;
70
+ get reflectionSpecularFalloffExponent(): number;
71
+ set reflectionSpecularFalloffExponent(exponent: number);
64
72
  /**
65
73
  * Maximum number of steps during the ray marching process after which we consider an intersection could not be found (default: 1000).
66
74
  * Should be an integer value.
67
75
  */
68
- maxSteps: number;
76
+ get maxSteps(): number;
77
+ set maxSteps(steps: number);
69
78
  /**
70
79
  * Gets or sets the factor applied when computing roughness. Default value is 0.2.
71
80
  * When blurring based on roughness is enabled (meaning blurDispersionStrength \> 0), roughnessFactor is used as a global roughness factor applied on all objects.
72
81
  * If you want to disable this global roughness set it to 0.
73
82
  */
74
- roughnessFactor: number;
83
+ get roughnessFactor(): number;
84
+ set roughnessFactor(factor: number);
75
85
  /**
76
86
  * Number of steps to skip at start when marching the ray to avoid self collisions (default: 1)
77
87
  * 1 should normally be a good value, depending on the scene you may need to use a higher value (2 or 3)
78
88
  */
79
- selfCollisionNumSkip: number;
80
- private _reflectivityThreshold;
89
+ get selfCollisionNumSkip(): number;
90
+ set selfCollisionNumSkip(skip: number);
81
91
  /**
82
92
  * Gets or sets the minimum value for one of the reflectivity component of the material to consider it for SSR (default: 0.04).
83
93
  * 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.
84
94
  */
85
95
  get reflectivityThreshold(): number;
86
96
  set reflectivityThreshold(threshold: number);
87
- private _ssrDownsample;
88
97
  /**
89
98
  * Gets or sets the downsample factor used to reduce the size of the texture used to compute the SSR contribution (default: 0).
90
99
  * Use 0 to render the SSR contribution at full resolution, 1 to render at half resolution, 2 to render at 1/3 resolution, etc.
@@ -92,23 +101,20 @@ export declare class SSRRenderingPipeline extends PostProcessRenderPipeline {
92
101
  */
93
102
  get ssrDownsample(): number;
94
103
  set ssrDownsample(downsample: number);
95
- private _blurDispersionStrength;
96
104
  /**
97
- * Gets or sets the blur dispersion strength. Set this value to 0 to disable blurring (default: 0.05)
105
+ * Gets or sets the blur dispersion strength. Set this value to 0 to disable blurring (default: 0.03)
98
106
  * 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.
99
107
  * blurDispersionStrength allows to increase or decrease this effect.
100
108
  */
101
109
  get blurDispersionStrength(): number;
102
110
  set blurDispersionStrength(strength: number);
103
111
  private _useBlur;
104
- private _blurDownsample;
105
112
  /**
106
113
  * Gets or sets the downsample factor used to reduce the size of the textures used to blur the reflection effect (default: 0).
107
114
  * Use 0 to blur at full resolution, 1 to render at half resolution, 2 to render at 1/3 resolution, etc.
108
115
  */
109
116
  get blurDownsample(): number;
110
117
  set blurDownsample(downsample: number);
111
- private _enableSmoothReflections;
112
118
  /**
113
119
  * Gets or sets whether or not smoothing reflections is enabled (default: false)
114
120
  * Enabling smoothing will require more GPU power.
@@ -116,65 +122,55 @@ export declare class SSRRenderingPipeline extends PostProcessRenderPipeline {
116
122
  */
117
123
  get enableSmoothReflections(): boolean;
118
124
  set enableSmoothReflections(enabled: boolean);
119
- private _useScreenspaceDepth;
120
- private _environmentTexture;
125
+ private get _useScreenspaceDepth();
121
126
  /**
122
127
  * 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.
123
128
  */
124
129
  get environmentTexture(): Nullable<CubeTexture>;
125
130
  set environmentTexture(texture: Nullable<CubeTexture>);
126
- private _environmentTextureIsProbe;
127
131
  /**
128
132
  * Gets or sets the boolean defining if the environment texture is a standard cubemap (false) or a probe (true). Default value is false.
129
133
  * Note: a probe cube texture is treated differently than an ordinary cube texture because the Y axis is reversed.
130
134
  */
131
135
  get environmentTextureIsProbe(): boolean;
132
136
  set environmentTextureIsProbe(isProbe: boolean);
133
- private _attenuateScreenBorders;
134
137
  /**
135
138
  * Gets or sets a boolean indicating if the reflections should be attenuated at the screen borders (default: true).
136
139
  */
137
140
  get attenuateScreenBorders(): boolean;
138
141
  set attenuateScreenBorders(attenuate: boolean);
139
- private _attenuateIntersectionDistance;
140
142
  /**
141
143
  * Gets or sets a boolean indicating if the reflections should be attenuated according to the distance of the intersection (default: true).
142
144
  */
143
145
  get attenuateIntersectionDistance(): boolean;
144
146
  set attenuateIntersectionDistance(attenuate: boolean);
145
- private _attenuateIntersectionIterations;
146
147
  /**
147
148
  * 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).
148
149
  */
149
150
  get attenuateIntersectionIterations(): boolean;
150
151
  set attenuateIntersectionIterations(attenuate: boolean);
151
- private _attenuateFacingCamera;
152
152
  /**
153
153
  * 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).
154
154
  */
155
155
  get attenuateFacingCamera(): boolean;
156
156
  set attenuateFacingCamera(attenuate: boolean);
157
- private _attenuateBackfaceReflection;
158
157
  /**
159
158
  * Gets or sets a boolean indicating if the backface reflections should be attenuated (default: false).
160
159
  */
161
160
  get attenuateBackfaceReflection(): boolean;
162
161
  set attenuateBackfaceReflection(attenuate: boolean);
163
- private _clipToFrustum;
164
162
  /**
165
163
  * Gets or sets a boolean indicating if the ray should be clipped to the frustum (default: true).
166
164
  * 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
167
165
  */
168
166
  get clipToFrustum(): boolean;
169
167
  set clipToFrustum(clip: boolean);
170
- private _useFresnel;
171
168
  /**
172
169
  * 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).
173
170
  * 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).
174
171
  */
175
172
  get useFresnel(): boolean;
176
173
  set useFresnel(fresnel: boolean);
177
- private _enableAutomaticThicknessComputation;
178
174
  /**
179
175
  * Gets or sets a boolean defining if geometry thickness should be computed automatically (default: false).
180
176
  * 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).
@@ -208,21 +204,18 @@ export declare class SSRRenderingPipeline extends PostProcessRenderPipeline {
208
204
  */
209
205
  get isEnabled(): boolean;
210
206
  set isEnabled(value: boolean);
211
- private _inputTextureColorIsInGammaSpace;
212
207
  /**
213
208
  * Gets or sets a boolean defining if the input color texture is in gamma space (default: true)
214
209
  * 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
215
210
  */
216
211
  get inputTextureColorIsInGammaSpace(): boolean;
217
212
  set inputTextureColorIsInGammaSpace(gammaSpace: boolean);
218
- private _generateOutputInGammaSpace;
219
213
  /**
220
214
  * Gets or sets a boolean defining if the output color texture generated by the SSR pipeline should be in gamma space (default: true)
221
215
  * 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
222
216
  */
223
217
  get generateOutputInGammaSpace(): boolean;
224
218
  set generateOutputInGammaSpace(gammaSpace: boolean);
225
- private _debug;
226
219
  /**
227
220
  * Gets or sets a boolean indicating if the effect should be rendered in debug mode (default: false).
228
221
  * In this mode, colors have this meaning:
@@ -292,11 +285,11 @@ export declare class SSRRenderingPipeline extends PostProcessRenderPipeline {
292
285
  */
293
286
  dispose(disableGeometryBufferRenderer?: boolean): void;
294
287
  private _getTextureSize;
295
- private _updateEffectDefines;
296
288
  private _buildPipeline;
297
289
  private _resizeDepthRenderer;
298
290
  private _disposeDepthRenderer;
299
- private _disposePostProcesses;
291
+ private _disposeBlurPostProcesses;
292
+ private _disposeSSRPostProcess;
300
293
  private _createSSRPostProcess;
301
294
  private _createBlurAndCombinerPostProcesses;
302
295
  /**