@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
@@ -0,0 +1,185 @@
1
+ import { EffectWrapper } from "../Materials/effectRenderer.js";
2
+ import { Engine } from "../Engines/engine.js";
3
+ import { TmpVectors } from "../Maths/math.vector.js";
4
+ /**
5
+ * @internal
6
+ */
7
+ export class ThinSSRBlurCombinerPostProcess extends EffectWrapper {
8
+ _gatherImports(useWebGPU, list) {
9
+ if (useWebGPU) {
10
+ this._webGPUReady = true;
11
+ list.push(import("../ShadersWGSL/screenSpaceReflection2BlurCombiner.fragment.js"));
12
+ }
13
+ else {
14
+ list.push(import("../Shaders/screenSpaceReflection2BlurCombiner.fragment.js"));
15
+ }
16
+ }
17
+ constructor(name, engine = null, options) {
18
+ super({
19
+ ...options,
20
+ name,
21
+ engine: engine || Engine.LastCreatedEngine,
22
+ useShaderStore: true,
23
+ useAsPostProcess: true,
24
+ fragmentShader: ThinSSRBlurCombinerPostProcess.FragmentUrl,
25
+ uniforms: ThinSSRBlurCombinerPostProcess.Uniforms,
26
+ samplers: ThinSSRBlurCombinerPostProcess.Samplers,
27
+ });
28
+ this.strength = 1;
29
+ this.reflectionSpecularFalloffExponent = 1;
30
+ this.camera = null;
31
+ this._useFresnel = false;
32
+ this._useScreenspaceDepth = false;
33
+ this._inputTextureColorIsInGammaSpace = true;
34
+ this._generateOutputInGammaSpace = true;
35
+ this._debug = false;
36
+ this._reflectivityThreshold = 0.04;
37
+ this._normalsAreInWorldSpace = false;
38
+ this._normalsAreUnsigned = false;
39
+ this._updateEffectDefines();
40
+ }
41
+ get useFresnel() {
42
+ return this._useFresnel;
43
+ }
44
+ set useFresnel(fresnel) {
45
+ if (this._useFresnel === fresnel) {
46
+ return;
47
+ }
48
+ this._useFresnel = fresnel;
49
+ this._updateEffectDefines();
50
+ }
51
+ get useScreenspaceDepth() {
52
+ return this._useScreenspaceDepth;
53
+ }
54
+ set useScreenspaceDepth(value) {
55
+ if (this._useScreenspaceDepth === value) {
56
+ return;
57
+ }
58
+ this._useScreenspaceDepth = value;
59
+ this._updateEffectDefines();
60
+ }
61
+ get inputTextureColorIsInGammaSpace() {
62
+ return this._inputTextureColorIsInGammaSpace;
63
+ }
64
+ set inputTextureColorIsInGammaSpace(gammaSpace) {
65
+ if (this._inputTextureColorIsInGammaSpace === gammaSpace) {
66
+ return;
67
+ }
68
+ this._inputTextureColorIsInGammaSpace = gammaSpace;
69
+ this._updateEffectDefines();
70
+ }
71
+ get generateOutputInGammaSpace() {
72
+ return this._generateOutputInGammaSpace;
73
+ }
74
+ set generateOutputInGammaSpace(gammaSpace) {
75
+ if (this._generateOutputInGammaSpace === gammaSpace) {
76
+ return;
77
+ }
78
+ this._generateOutputInGammaSpace = gammaSpace;
79
+ this._updateEffectDefines();
80
+ }
81
+ get debug() {
82
+ return this._debug;
83
+ }
84
+ set debug(value) {
85
+ if (this._debug === value) {
86
+ return;
87
+ }
88
+ this._debug = value;
89
+ this._updateEffectDefines();
90
+ }
91
+ get reflectivityThreshold() {
92
+ return this._reflectivityThreshold;
93
+ }
94
+ set reflectivityThreshold(threshold) {
95
+ if (threshold === this._reflectivityThreshold) {
96
+ return;
97
+ }
98
+ if ((threshold === 0 && this._reflectivityThreshold !== 0) || (threshold !== 0 && this._reflectivityThreshold === 0)) {
99
+ this._reflectivityThreshold = threshold;
100
+ this._updateEffectDefines();
101
+ }
102
+ else {
103
+ this._reflectivityThreshold = threshold;
104
+ }
105
+ }
106
+ get normalsAreInWorldSpace() {
107
+ return this._normalsAreInWorldSpace;
108
+ }
109
+ set normalsAreInWorldSpace(value) {
110
+ if (this._normalsAreInWorldSpace === value) {
111
+ return;
112
+ }
113
+ this._normalsAreInWorldSpace = value;
114
+ this._updateEffectDefines();
115
+ }
116
+ get normalsAreUnsigned() {
117
+ return this._normalsAreUnsigned;
118
+ }
119
+ set normalsAreUnsigned(value) {
120
+ if (this._normalsAreUnsigned === value) {
121
+ return;
122
+ }
123
+ this._normalsAreUnsigned = value;
124
+ this._updateEffectDefines();
125
+ }
126
+ bind() {
127
+ super.bind();
128
+ const effect = this._drawWrapper.effect;
129
+ effect.setFloat("strength", this.strength);
130
+ effect.setFloat("reflectionSpecularFalloffExponent", this.reflectionSpecularFalloffExponent);
131
+ effect.setFloat("reflectivityThreshold", this.reflectivityThreshold);
132
+ if (this.useFresnel && this.camera) {
133
+ const projectionMatrix = this.camera.getProjectionMatrix();
134
+ projectionMatrix.invertToRef(TmpVectors.Matrix[0]);
135
+ effect.setMatrix("projection", projectionMatrix);
136
+ effect.setMatrix("invProjectionMatrix", TmpVectors.Matrix[0]);
137
+ effect.setMatrix("view", this.camera.getViewMatrix());
138
+ if (this.useScreenspaceDepth) {
139
+ effect.setFloat("nearPlaneZ", this.camera.minZ);
140
+ effect.setFloat("farPlaneZ", this.camera.maxZ);
141
+ }
142
+ }
143
+ }
144
+ _updateEffectDefines() {
145
+ let defines = "";
146
+ if (this._debug) {
147
+ defines += "#define SSRAYTRACE_DEBUG\n";
148
+ }
149
+ if (this._inputTextureColorIsInGammaSpace) {
150
+ defines += "#define SSR_INPUT_IS_GAMMA_SPACE\n";
151
+ }
152
+ if (this._generateOutputInGammaSpace) {
153
+ defines += "#define SSR_OUTPUT_IS_GAMMA_SPACE\n";
154
+ }
155
+ if (this._useFresnel) {
156
+ defines += "#define SSR_BLEND_WITH_FRESNEL\n";
157
+ }
158
+ if (this._useScreenspaceDepth) {
159
+ defines += "#define SSRAYTRACE_SCREENSPACE_DEPTH\n";
160
+ }
161
+ if (this._reflectivityThreshold === 0) {
162
+ defines += "#define SSR_DISABLE_REFLECTIVITY_TEST\n";
163
+ }
164
+ if (this._normalsAreInWorldSpace) {
165
+ defines += "#define SSR_NORMAL_IS_IN_WORLDSPACE\n";
166
+ }
167
+ if (this._normalsAreUnsigned) {
168
+ defines += "#define SSR_DECODE_NORMAL\n";
169
+ }
170
+ this.updateEffect(defines);
171
+ }
172
+ }
173
+ ThinSSRBlurCombinerPostProcess.FragmentUrl = "screenSpaceReflection2BlurCombiner";
174
+ ThinSSRBlurCombinerPostProcess.Uniforms = [
175
+ "strength",
176
+ "reflectionSpecularFalloffExponent",
177
+ "reflectivityThreshold",
178
+ "projection",
179
+ "invProjectionMatrix",
180
+ "nearPlaneZ",
181
+ "farPlaneZ",
182
+ "view",
183
+ ];
184
+ ThinSSRBlurCombinerPostProcess.Samplers = ["textureSampler", "depthSampler", "normalSampler", "mainSampler", "reflectivitySampler"];
185
+ //# sourceMappingURL=thinSSRBlurCombinerPostProcess.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thinSSRBlurCombinerPostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/thinSSRBlurCombinerPostProcess.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD;;GAEG;AACH,MAAM,OAAO,8BAA+B,SAAQ,aAAa;IAgB1C,cAAc,CAAC,SAAkB,EAAE,IAAoB;QACtE,IAAI,SAAS,EAAE,CAAC;YACZ,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;YACzB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,4DAA4D,CAAC,CAAC,CAAC;QACpF,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,wDAAwD,CAAC,CAAC,CAAC;QAChF,CAAC;IACL,CAAC;IAED,YAAY,IAAY,EAAE,SAAmC,IAAI,EAAE,OAAsC;QACrG,KAAK,CAAC;YACF,GAAG,OAAO;YACV,IAAI;YACJ,MAAM,EAAE,MAAM,IAAI,MAAM,CAAC,iBAAkB;YAC3C,cAAc,EAAE,IAAI;YACpB,gBAAgB,EAAE,IAAI;YACtB,cAAc,EAAE,8BAA8B,CAAC,WAAW;YAC1D,QAAQ,EAAE,8BAA8B,CAAC,QAAQ;YACjD,QAAQ,EAAE,8BAA8B,CAAC,QAAQ;SACpD,CAAC,CAAC;QAKA,aAAQ,GAAG,CAAC,CAAC;QAEb,sCAAiC,GAAG,CAAC,CAAC;QAEtC,WAAM,GAAqB,IAAI,CAAC;QAE/B,gBAAW,GAAG,KA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eslint-disable-next-line import/no-internal-modules\r\nimport type { Nullable, AbstractEngine, EffectWrapperCreationOptions, Camera } from \"core/index\";\r\nimport { EffectWrapper } from \"../Materials/effectRenderer\";\r\nimport { Engine } from \"../Engines/engine\";\r\nimport { TmpVectors } from \"../Maths/math.vector\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class ThinSSRBlurCombinerPostProcess extends EffectWrapper {\r\n public static readonly FragmentUrl = \"screenSpaceReflection2BlurCombiner\";\r\n\r\n public static readonly Uniforms = [\r\n \"strength\",\r\n \"reflectionSpecularFalloffExponent\",\r\n \"reflectivityThreshold\",\r\n \"projection\",\r\n \"invProjectionMatrix\",\r\n \"nearPlaneZ\",\r\n \"farPlaneZ\",\r\n \"view\",\r\n ];\r\n\r\n public static readonly Samplers = [\"textureSampler\", \"depthSampler\", \"normalSampler\", \"mainSampler\", \"reflectivitySampler\"];\r\n\r\n protected override _gatherImports(useWebGPU: boolean, list: Promise<any>[]) {\r\n if (useWebGPU) {\r\n this._webGPUReady = true;\r\n list.push(import(\"../ShadersWGSL/screenSpaceReflection2BlurCombiner.fragment\"));\r\n } else {\r\n list.push(import(\"../Shaders/screenSpaceReflection2BlurCombiner.fragment\"));\r\n }\r\n }\r\n\r\n constructor(name: string, engine: Nullable<AbstractEngine> = null, options?: EffectWrapperCreationOptions) {\r\n super({\r\n ...options,\r\n name,\r\n engine: engine || Engine.LastCreatedEngine!,\r\n useShaderStore: true,\r\n useAsPostProcess: true,\r\n fragmentShader: ThinSSRBlurCombinerPostProcess.FragmentUrl,\r\n uniforms: ThinSSRBlurCombinerPostProcess.Uniforms,\r\n samplers: ThinSSRBlurCombinerPostProcess.Samplers,\r\n });\r\n\r\n this._updateEffectDefines();\r\n }\r\n\r\n public strength = 1;\r\n\r\n public reflectionSpecularFalloffExponent = 1;\r\n\r\n public camera: Nullable<Camera> = null;\r\n\r\n private _useFresnel = false;\r\n\r\n public get useFresnel() {\r\n return this._useFresnel;\r\n }\r\n\r\n public set useFresnel(fresnel: boolean) {\r\n if (this._useFresnel === fresnel) {\r\n return;\r\n }\r\n\r\n this._useFresnel = fresnel;\r\n this._updateEffectDefines();\r\n }\r\n\r\n private _useScreenspaceDepth = false;\r\n\r\n public get useScreenspaceDepth() {\r\n return this._useScreenspaceDepth;\r\n }\r\n\r\n public set useScreenspaceDepth(value: boolean) {\r\n if (this._useScreenspaceDepth === value) {\r\n return;\r\n }\r\n\r\n this._useScreenspaceDepth = value;\r\n this._updateEffectDefines();\r\n }\r\n\r\n private _inputTextureColorIsInGammaSpace = true;\r\n\r\n public get inputTextureColorIsInGammaSpace(): boolean {\r\n return this._inputTextureColorIsInGammaSpace;\r\n }\r\n\r\n public set inputTextureColorIsInGammaSpace(gammaSpace: boolean) {\r\n if (this._inputTextureColorIsInGammaSpace === gammaSpace) {\r\n return;\r\n }\r\n\r\n this._inputTextureColorIsInGammaSpace = gammaSpace;\r\n this._updateEffectDefines();\r\n }\r\n\r\n private _generateOutputInGammaSpace = true;\r\n\r\n public get generateOutputInGammaSpace(): boolean {\r\n return this._generateOutputInGammaSpace;\r\n }\r\n\r\n public set generateOutputInGammaSpace(gammaSpace: boolean) {\r\n if (this._generateOutputInGammaSpace === gammaSpace) {\r\n return;\r\n }\r\n\r\n this._generateOutputInGammaSpace = gammaSpace;\r\n this._updateEffectDefines();\r\n }\r\n\r\n private _debug = false;\r\n\r\n public get debug(): boolean {\r\n return this._debug;\r\n }\r\n\r\n public set debug(value: boolean) {\r\n if (this._debug === value) {\r\n return;\r\n }\r\n\r\n this._debug = value;\r\n this._updateEffectDefines();\r\n }\r\n\r\n private _reflectivityThreshold = 0.04;\r\n\r\n public get reflectivityThreshold() {\r\n return this._reflectivityThreshold;\r\n }\r\n\r\n public set reflectivityThreshold(threshold: number) {\r\n if (threshold === this._reflectivityThreshold) {\r\n return;\r\n }\r\n\r\n if ((threshold === 0 && this._reflectivityThreshold !== 0) || (threshold !== 0 && this._reflectivityThreshold === 0)) {\r\n this._reflectivityThreshold = threshold;\r\n this._updateEffectDefines();\r\n } else {\r\n this._reflectivityThreshold = threshold;\r\n }\r\n }\r\n\r\n private _normalsAreInWorldSpace = false;\r\n\r\n public get normalsAreInWorldSpace() {\r\n return this._normalsAreInWorldSpace;\r\n }\r\n\r\n public set normalsAreInWorldSpace(value: boolean) {\r\n if (this._normalsAreInWorldSpace === value) {\r\n return;\r\n }\r\n\r\n this._normalsAreInWorldSpace = value;\r\n this._updateEffectDefines();\r\n }\r\n\r\n private _normalsAreUnsigned = false;\r\n\r\n public get normalsAreUnsigned() {\r\n return this._normalsAreUnsigned;\r\n }\r\n\r\n public set normalsAreUnsigned(value: boolean) {\r\n if (this._normalsAreUnsigned === value) {\r\n return;\r\n }\r\n\r\n this._normalsAreUnsigned = value;\r\n this._updateEffectDefines();\r\n }\r\n\r\n public override bind() {\r\n super.bind();\r\n\r\n const effect = this._drawWrapper.effect!;\r\n\r\n effect.setFloat(\"strength\", this.strength);\r\n effect.setFloat(\"reflectionSpecularFalloffExponent\", this.reflectionSpecularFalloffExponent);\r\n effect.setFloat(\"reflectivityThreshold\", this.reflectivityThreshold);\r\n\r\n if (this.useFresnel && this.camera) {\r\n const projectionMatrix = this.camera.getProjectionMatrix();\r\n\r\n projectionMatrix.invertToRef(TmpVectors.Matrix[0]);\r\n\r\n effect.setMatrix(\"projection\", projectionMatrix);\r\n effect.setMatrix(\"invProjectionMatrix\", TmpVectors.Matrix[0]);\r\n effect.setMatrix(\"view\", this.camera.getViewMatrix());\r\n\r\n if (this.useScreenspaceDepth) {\r\n effect.setFloat(\"nearPlaneZ\", this.camera.minZ);\r\n effect.setFloat(\"farPlaneZ\", this.camera.maxZ);\r\n }\r\n }\r\n }\r\n\r\n private _updateEffectDefines() {\r\n let defines = \"\";\r\n\r\n if (this._debug) {\r\n defines += \"#define SSRAYTRACE_DEBUG\\n\";\r\n }\r\n if (this._inputTextureColorIsInGammaSpace) {\r\n defines += \"#define SSR_INPUT_IS_GAMMA_SPACE\\n\";\r\n }\r\n if (this._generateOutputInGammaSpace) {\r\n defines += \"#define SSR_OUTPUT_IS_GAMMA_SPACE\\n\";\r\n }\r\n if (this._useFresnel) {\r\n defines += \"#define SSR_BLEND_WITH_FRESNEL\\n\";\r\n }\r\n if (this._useScreenspaceDepth) {\r\n defines += \"#define SSRAYTRACE_SCREENSPACE_DEPTH\\n\";\r\n }\r\n if (this._reflectivityThreshold === 0) {\r\n defines += \"#define SSR_DISABLE_REFLECTIVITY_TEST\\n\";\r\n }\r\n if (this._normalsAreInWorldSpace) {\r\n defines += \"#define SSR_NORMAL_IS_IN_WORLDSPACE\\n\";\r\n }\r\n if (this._normalsAreUnsigned) {\r\n defines += \"#define SSR_DECODE_NORMAL\\n\";\r\n }\r\n\r\n this.updateEffect(defines);\r\n }\r\n}\r\n"]}
@@ -0,0 +1,18 @@
1
+ import type { Nullable, AbstractEngine, EffectWrapperCreationOptions } from "../index.js";
2
+ import { EffectWrapper } from "../Materials/effectRenderer";
3
+ import { Vector2 } from "../Maths/math.vector";
4
+ /**
5
+ * @internal
6
+ */
7
+ export declare class ThinSSRBlurPostProcess extends EffectWrapper {
8
+ static readonly FragmentUrl = "screenSpaceReflection2Blur";
9
+ static readonly Uniforms: string[];
10
+ static readonly Samplers: string[];
11
+ protected _gatherImports(useWebGPU: boolean, list: Promise<any>[]): void;
12
+ constructor(name: string, engine?: Nullable<AbstractEngine>, direction?: Vector2, blurStrength?: number, options?: EffectWrapperCreationOptions);
13
+ textureWidth: number;
14
+ textureHeight: number;
15
+ direction: Vector2;
16
+ blurStrength: number;
17
+ bind(): void;
18
+ }
@@ -0,0 +1,47 @@
1
+ import { EffectWrapper } from "../Materials/effectRenderer.js";
2
+ import { Engine } from "../Engines/engine.js";
3
+ import { Vector2 } from "../Maths/math.vector.js";
4
+ /**
5
+ * @internal
6
+ */
7
+ export class ThinSSRBlurPostProcess extends EffectWrapper {
8
+ _gatherImports(useWebGPU, list) {
9
+ if (useWebGPU) {
10
+ this._webGPUReady = true;
11
+ list.push(import("../ShadersWGSL/screenSpaceReflection2Blur.fragment.js"));
12
+ }
13
+ else {
14
+ list.push(import("../Shaders/screenSpaceReflection2Blur.fragment.js"));
15
+ }
16
+ }
17
+ constructor(name, engine = null, direction, blurStrength, options) {
18
+ super({
19
+ ...options,
20
+ name,
21
+ engine: engine || Engine.LastCreatedEngine,
22
+ useShaderStore: true,
23
+ useAsPostProcess: true,
24
+ fragmentShader: ThinSSRBlurPostProcess.FragmentUrl,
25
+ uniforms: ThinSSRBlurPostProcess.Uniforms,
26
+ samplers: ThinSSRBlurPostProcess.Samplers,
27
+ });
28
+ this.textureWidth = 0;
29
+ this.textureHeight = 0;
30
+ this.direction = new Vector2(1, 0);
31
+ this.blurStrength = 0.03;
32
+ if (direction !== undefined) {
33
+ this.direction = direction;
34
+ }
35
+ if (blurStrength !== undefined) {
36
+ this.blurStrength = blurStrength;
37
+ }
38
+ }
39
+ bind() {
40
+ super.bind();
41
+ this._drawWrapper.effect.setFloat2("texelOffsetScale", (1 / this.textureWidth) * this.direction.x * this.blurStrength, (1 / this.textureHeight) * this.direction.y * this.blurStrength);
42
+ }
43
+ }
44
+ ThinSSRBlurPostProcess.FragmentUrl = "screenSpaceReflection2Blur";
45
+ ThinSSRBlurPostProcess.Uniforms = ["texelOffsetScale"];
46
+ ThinSSRBlurPostProcess.Samplers = ["textureSampler"];
47
+ //# sourceMappingURL=thinSSRBlurPostProcess.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thinSSRBlurPostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/thinSSRBlurPostProcess.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,aAAa;IAOlC,cAAc,CAAC,SAA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C9D,CAAC,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,YAAY,CAClE,CAAC;IACN,CAAC;;AApDsB,kCAAW,GAAG,4BAA4B,AAA/B,CAAgC;AAE3C,+BAAQ,GAAG,CAAC,kBAAkB,CAAC,AAAvB,CAAwB;AAEhC,+BAAQ,GAAG,CAAC,gBAAgB,CAAC,AAArB,CAAsB","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { Nullable, AbstractEngine, EffectWrapperCreationOptions } from \"core/index\";\r\nimport { EffectWrapper } from \"../Materials/effectRenderer\";\r\nimport { Engine } from \"../Engines/engine\";\r\nimport { Vector2 } from \"../Maths/math.vector\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class ThinSSRBlurPostProcess extends EffectWrapper {\r\n public static readonly FragmentUrl = \"screenSpaceReflection2Blur\";\r\n\r\n public static readonly Uniforms = [\"texelOffsetScale\"];\r\n\r\n public static readonly Samplers = [\"textureSampler\"];\r\n\r\n protected override _gatherImports(useWebGPU: boolean, list: Promise<any>[]) {\r\n if (useWebGPU) {\r\n this._webGPUReady = true;\r\n list.push(import(\"../ShadersWGSL/screenSpaceReflection2Blur.fragment\"));\r\n } else {\r\n list.push(import(\"../Shaders/screenSpaceReflection2Blur.fragment\"));\r\n }\r\n }\r\n\r\n constructor(name: string, engine: Nullable<AbstractEngine> = null, direction?: Vector2, blurStrength?: number, options?: EffectWrapperCreationOptions) {\r\n super({\r\n ...options,\r\n name,\r\n engine: engine || Engine.LastCreatedEngine!,\r\n useShaderStore: true,\r\n useAsPostProcess: true,\r\n fragmentShader: ThinSSRBlurPostProcess.FragmentUrl,\r\n uniforms: ThinSSRBlurPostProcess.Uniforms,\r\n samplers: ThinSSRBlurPostProcess.Samplers,\r\n });\r\n\r\n if (direction !== undefined) {\r\n this.direction = direction;\r\n }\r\n\r\n if (blurStrength !== undefined) {\r\n this.blurStrength = blurStrength;\r\n }\r\n }\r\n\r\n public textureWidth: number = 0;\r\n\r\n public textureHeight: number = 0;\r\n\r\n public direction = new Vector2(1, 0);\r\n\r\n public blurStrength = 0.03;\r\n\r\n public override bind() {\r\n super.bind();\r\n\r\n this._drawWrapper.effect!.setFloat2(\r\n \"texelOffsetScale\",\r\n (1 / this.textureWidth) * this.direction.x * this.blurStrength,\r\n (1 / this.textureHeight) * this.direction.y * this.blurStrength\r\n );\r\n }\r\n}\r\n"]}
@@ -0,0 +1,94 @@
1
+ import type { Nullable, Scene, CubeTexture, Camera, EffectWrapperCreationOptions } from "../index.js";
2
+ import { EffectWrapper } from "../Materials/effectRenderer.js";
3
+ /**
4
+ * @internal
5
+ */
6
+ export declare class ThinSSRPostProcess extends EffectWrapper {
7
+ /**
8
+ * The fragment shader url
9
+ */
10
+ static readonly FragmentUrl = "screenSpaceReflection2";
11
+ /**
12
+ * The list of uniforms used by the effect
13
+ */
14
+ static readonly Uniforms: string[];
15
+ static readonly Samplers: string[];
16
+ protected _gatherImports(useWebGPU: boolean, list: Promise<any>[]): void;
17
+ isSSRSupported: boolean;
18
+ maxDistance: number;
19
+ step: number;
20
+ thickness: number;
21
+ strength: number;
22
+ reflectionSpecularFalloffExponent: number;
23
+ maxSteps: number;
24
+ roughnessFactor: number;
25
+ selfCollisionNumSkip: number;
26
+ private _reflectivityThreshold;
27
+ get reflectivityThreshold(): number;
28
+ set reflectivityThreshold(threshold: number);
29
+ private _useBlur;
30
+ get useBlur(): boolean;
31
+ set useBlur(blur: boolean);
32
+ private _enableSmoothReflections;
33
+ get enableSmoothReflections(): boolean;
34
+ set enableSmoothReflections(enabled: boolean);
35
+ private _environmentTexture;
36
+ get environmentTexture(): Nullable<CubeTexture>;
37
+ set environmentTexture(texture: Nullable<CubeTexture>);
38
+ private _environmentTextureIsProbe;
39
+ get environmentTextureIsProbe(): boolean;
40
+ set environmentTextureIsProbe(isProbe: boolean);
41
+ private _attenuateScreenBorders;
42
+ get attenuateScreenBorders(): boolean;
43
+ set attenuateScreenBorders(attenuate: boolean);
44
+ private _attenuateIntersectionDistance;
45
+ get attenuateIntersectionDistance(): boolean;
46
+ set attenuateIntersectionDistance(attenuate: boolean);
47
+ private _attenuateIntersectionIterations;
48
+ get attenuateIntersectionIterations(): boolean;
49
+ set attenuateIntersectionIterations(attenuate: boolean);
50
+ private _attenuateFacingCamera;
51
+ get attenuateFacingCamera(): boolean;
52
+ set attenuateFacingCamera(attenuate: boolean);
53
+ private _attenuateBackfaceReflection;
54
+ get attenuateBackfaceReflection(): boolean;
55
+ set attenuateBackfaceReflection(attenuate: boolean);
56
+ private _clipToFrustum;
57
+ get clipToFrustum(): boolean;
58
+ set clipToFrustum(clip: boolean);
59
+ private _useFresnel;
60
+ get useFresnel(): boolean;
61
+ set useFresnel(fresnel: boolean);
62
+ private _enableAutomaticThicknessComputation;
63
+ get enableAutomaticThicknessComputation(): boolean;
64
+ set enableAutomaticThicknessComputation(automatic: boolean);
65
+ private _inputTextureColorIsInGammaSpace;
66
+ get inputTextureColorIsInGammaSpace(): boolean;
67
+ set inputTextureColorIsInGammaSpace(gammaSpace: boolean);
68
+ private _generateOutputInGammaSpace;
69
+ get generateOutputInGammaSpace(): boolean;
70
+ set generateOutputInGammaSpace(gammaSpace: boolean);
71
+ private _debug;
72
+ get debug(): boolean;
73
+ set debug(value: boolean);
74
+ private _textureWidth;
75
+ get textureWidth(): number;
76
+ set textureWidth(width: number);
77
+ private _textureHeight;
78
+ get textureHeight(): number;
79
+ set textureHeight(height: number);
80
+ camera: Nullable<Camera>;
81
+ private _useScreenspaceDepth;
82
+ get useScreenspaceDepth(): boolean;
83
+ set useScreenspaceDepth(value: boolean);
84
+ private _normalsAreInWorldSpace;
85
+ get normalsAreInWorldSpace(): boolean;
86
+ set normalsAreInWorldSpace(value: boolean);
87
+ private _normalsAreUnsigned;
88
+ get normalsAreUnsigned(): boolean;
89
+ set normalsAreUnsigned(value: boolean);
90
+ private _scene;
91
+ constructor(name: string, scene: Scene, options?: EffectWrapperCreationOptions);
92
+ bind(): void;
93
+ private _updateEffectDefines;
94
+ }