@babylonjs/core 7.52.2 → 7.53.0

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 (211) 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 +10 -3
  5. package/AudioV2/abstractAudio/abstractSound.js +10 -0
  6. package/AudioV2/abstractAudio/abstractSound.js.map +1 -1
  7. package/AudioV2/abstractAudio/audioBus.d.ts +4 -4
  8. package/AudioV2/abstractAudio/audioBus.js.map +1 -1
  9. package/AudioV2/abstractAudio/mainAudioBus.d.ts +2 -2
  10. package/AudioV2/abstractAudio/mainAudioBus.js.map +1 -1
  11. package/AudioV2/abstractAudio/staticSound.d.ts +5 -5
  12. package/AudioV2/abstractAudio/staticSound.js +3 -3
  13. package/AudioV2/abstractAudio/staticSound.js.map +1 -1
  14. package/AudioV2/abstractAudio/streamingSound.d.ts +1 -1
  15. package/AudioV2/abstractAudio/streamingSound.js +1 -1
  16. package/AudioV2/abstractAudio/streamingSound.js.map +1 -1
  17. package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.d.ts +30 -9
  18. package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.js +52 -26
  19. package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.js.map +1 -1
  20. package/AudioV2/abstractAudio/subNodes/audioAnalyzerSubNode.d.ts +24 -0
  21. package/AudioV2/abstractAudio/subNodes/audioAnalyzerSubNode.js +30 -0
  22. package/AudioV2/abstractAudio/subNodes/audioAnalyzerSubNode.js.map +1 -0
  23. package/AudioV2/abstractAudio/subNodes/audioSubNode.d.ts +1 -0
  24. package/AudioV2/abstractAudio/subNodes/audioSubNode.js +1 -0
  25. package/AudioV2/abstractAudio/subNodes/audioSubNode.js.map +1 -1
  26. package/AudioV2/abstractAudio/subNodes/stereoAudioSubNode.js.map +1 -1
  27. package/AudioV2/abstractAudio/subProperties/abstractAudioAnalyzer.d.ts +86 -0
  28. package/AudioV2/abstractAudio/subProperties/abstractAudioAnalyzer.js +29 -0
  29. package/AudioV2/abstractAudio/subProperties/abstractAudioAnalyzer.js.map +1 -0
  30. package/AudioV2/abstractAudio/subProperties/audioAnalyzer.d.ts +35 -0
  31. package/AudioV2/abstractAudio/subProperties/audioAnalyzer.js +96 -0
  32. package/AudioV2/abstractAudio/subProperties/audioAnalyzer.js.map +1 -0
  33. package/AudioV2/abstractAudio/subProperties/index.d.ts +1 -0
  34. package/AudioV2/abstractAudio/subProperties/index.js +1 -0
  35. package/AudioV2/abstractAudio/subProperties/index.js.map +1 -1
  36. package/AudioV2/abstractAudio/subProperties/spatialAudio.js +10 -5
  37. package/AudioV2/abstractAudio/subProperties/spatialAudio.js.map +1 -1
  38. package/AudioV2/webAudio/subNodes/webAudioAnalyzerSubNode.d.ts +37 -0
  39. package/AudioV2/webAudio/subNodes/webAudioAnalyzerSubNode.js +85 -0
  40. package/AudioV2/webAudio/subNodes/webAudioAnalyzerSubNode.js.map +1 -0
  41. package/AudioV2/webAudio/subNodes/webAudioBaseSubGraph.d.ts +5 -3
  42. package/AudioV2/webAudio/subNodes/webAudioBaseSubGraph.js +25 -2
  43. package/AudioV2/webAudio/subNodes/webAudioBaseSubGraph.js.map +1 -1
  44. package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.d.ts +2 -1
  45. package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.js +33 -18
  46. package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.js.map +1 -1
  47. package/Engines/WebGPU/webgpuTextureManager.d.ts +0 -1
  48. package/Engines/WebGPU/webgpuTextureManager.js +2 -57
  49. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
  50. package/Engines/abstractEngine.d.ts +6 -0
  51. package/Engines/abstractEngine.js +3 -3
  52. package/Engines/abstractEngine.js.map +1 -1
  53. package/Engines/engine.common.js +4 -0
  54. package/Engines/engine.common.js.map +1 -1
  55. package/Engines/nativeEngine.d.ts +1 -0
  56. package/Engines/nativeEngine.js +3 -0
  57. package/Engines/nativeEngine.js.map +1 -1
  58. package/Engines/nullEngine.d.ts +1 -0
  59. package/Engines/nullEngine.js +1 -0
  60. package/Engines/nullEngine.js.map +1 -1
  61. package/Engines/thinEngine.d.ts +1 -0
  62. package/Engines/thinEngine.js +7 -4
  63. package/Engines/thinEngine.js.map +1 -1
  64. package/Engines/webgpuEngine.d.ts +2 -1
  65. package/Engines/webgpuEngine.js +12 -9
  66. package/Engines/webgpuEngine.js.map +1 -1
  67. package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.d.ts +3 -12
  68. package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.js +16 -36
  69. package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.js.map +1 -1
  70. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.d.ts +5 -1
  71. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js +17 -4
  72. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js.map +1 -1
  73. package/FlowGraph/Blocks/Data/flowGraphDataSwitchBlock.d.ts +48 -0
  74. package/FlowGraph/Blocks/Data/flowGraphDataSwitchBlock.js +54 -0
  75. package/FlowGraph/Blocks/Data/flowGraphDataSwitchBlock.js.map +1 -0
  76. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.d.ts +3 -11
  77. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js +5 -14
  78. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js.map +1 -1
  79. package/FlowGraph/Blocks/Data/index.d.ts +1 -0
  80. package/FlowGraph/Blocks/Data/index.js +1 -0
  81. package/FlowGraph/Blocks/Data/index.js.map +1 -1
  82. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.d.ts +1 -0
  83. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +19 -13
  84. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
  85. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js +3 -5
  86. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
  87. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.js +1 -1
  88. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.js.map +1 -1
  89. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.js +2 -4
  90. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.js.map +1 -1
  91. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js +1 -1
  92. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -1
  93. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js +1 -2
  94. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
  95. package/FlowGraph/Blocks/flowGraphBlockFactory.js +2 -0
  96. package/FlowGraph/Blocks/flowGraphBlockFactory.js.map +1 -1
  97. package/FlowGraph/Blocks/flowGraphBlockNames.d.ts +2 -1
  98. package/FlowGraph/Blocks/flowGraphBlockNames.js +1 -0
  99. package/FlowGraph/Blocks/flowGraphBlockNames.js.map +1 -1
  100. package/FlowGraph/CustomTypes/flowGraphInteger.d.ts +1 -0
  101. package/FlowGraph/CustomTypes/flowGraphInteger.js +3 -0
  102. package/FlowGraph/CustomTypes/flowGraphInteger.js.map +1 -1
  103. package/FlowGraph/CustomTypes/flowGraphMatrix.d.ts +2 -0
  104. package/FlowGraph/CustomTypes/flowGraphMatrix.js +6 -0
  105. package/FlowGraph/CustomTypes/flowGraphMatrix.js.map +1 -1
  106. package/FlowGraph/flowGraphExecutionBlock.d.ts +1 -0
  107. package/FlowGraph/flowGraphExecutionBlock.js +4 -0
  108. package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
  109. package/FlowGraph/utils.d.ts +2 -1
  110. package/FlowGraph/utils.js +7 -2
  111. package/FlowGraph/utils.js.map +1 -1
  112. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js +2 -2
  113. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js.map +1 -1
  114. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js +2 -2
  115. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js.map +1 -1
  116. package/FrameGraph/Node/Blocks/PostProcesses/ssrPostProcessBlock.d.ts +126 -0
  117. package/FrameGraph/Node/Blocks/PostProcesses/ssrPostProcessBlock.js +497 -0
  118. package/FrameGraph/Node/Blocks/PostProcesses/ssrPostProcessBlock.js.map +1 -0
  119. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.d.ts +6 -0
  120. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js +30 -4
  121. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js.map +1 -1
  122. package/FrameGraph/Node/Blocks/index.d.ts +1 -0
  123. package/FrameGraph/Node/Blocks/index.js +1 -0
  124. package/FrameGraph/Node/Blocks/index.js.map +1 -1
  125. package/FrameGraph/Node/nodeRenderGraph.js +1 -1
  126. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  127. package/FrameGraph/Tasks/PostProcesses/bloomTask.d.ts +2 -3
  128. package/FrameGraph/Tasks/PostProcesses/bloomTask.js +3 -4
  129. package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -1
  130. package/FrameGraph/Tasks/PostProcesses/blurTask.js +2 -2
  131. package/FrameGraph/Tasks/PostProcesses/blurTask.js.map +1 -1
  132. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.d.ts +2 -3
  133. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js +4 -5
  134. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js.map +1 -1
  135. package/FrameGraph/Tasks/PostProcesses/postProcessTask.d.ts +6 -0
  136. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +14 -0
  137. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
  138. package/FrameGraph/Tasks/PostProcesses/ssrBlurTask.d.ts +11 -0
  139. package/FrameGraph/Tasks/PostProcesses/ssrBlurTask.js +18 -0
  140. package/FrameGraph/Tasks/PostProcesses/ssrBlurTask.js.map +1 -0
  141. package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.d.ts +76 -0
  142. package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js +170 -0
  143. package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js.map +1 -0
  144. package/FrameGraph/Tasks/PostProcesses/ssrTask.d.ts +16 -0
  145. package/FrameGraph/Tasks/PostProcesses/ssrTask.js +45 -0
  146. package/FrameGraph/Tasks/PostProcesses/ssrTask.js.map +1 -0
  147. package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +10 -0
  148. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +29 -0
  149. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
  150. package/FrameGraph/frameGraph.d.ts +7 -3
  151. package/FrameGraph/frameGraph.js +10 -4
  152. package/FrameGraph/frameGraph.js.map +1 -1
  153. package/FrameGraph/frameGraphTextureManager.d.ts +2 -1
  154. package/FrameGraph/frameGraphTextureManager.js +4 -3
  155. package/FrameGraph/frameGraphTextureManager.js.map +1 -1
  156. package/FrameGraph/index.d.ts +1 -0
  157. package/FrameGraph/index.js +1 -0
  158. package/FrameGraph/index.js.map +1 -1
  159. package/Materials/Node/nodeMaterial.js +3 -0
  160. package/Materials/Node/nodeMaterial.js.map +1 -1
  161. package/Materials/PBR/pbrBaseMaterial.js +1 -1
  162. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  163. package/Materials/effectRenderer.js +1 -1
  164. package/Materials/effectRenderer.js.map +1 -1
  165. package/Materials/material.js +5 -3
  166. package/Materials/material.js.map +1 -1
  167. package/Materials/materialHelper.geometryrendering.d.ts +7 -5
  168. package/Materials/materialHelper.geometryrendering.js +8 -3
  169. package/Materials/materialHelper.geometryrendering.js.map +1 -1
  170. package/Materials/standardMaterial.js +1 -1
  171. package/Materials/standardMaterial.js.map +1 -1
  172. package/Meshes/Builders/shapeBuilder.d.ts +2 -0
  173. package/Meshes/Builders/shapeBuilder.js +7 -4
  174. package/Meshes/Builders/shapeBuilder.js.map +1 -1
  175. package/Meshes/geometry.js +4 -0
  176. package/Meshes/geometry.js.map +1 -1
  177. package/Particles/particleSystemComponent.d.ts +2 -1
  178. package/Particles/particleSystemComponent.js +2 -2
  179. package/Particles/particleSystemComponent.js.map +1 -1
  180. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.d.ts +23 -30
  181. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js +226 -411
  182. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js.map +1 -1
  183. package/PostProcesses/RenderPipeline/Pipelines/thinSSRRenderingPipeline.d.ts +222 -0
  184. package/PostProcesses/RenderPipeline/Pipelines/thinSSRRenderingPipeline.js +373 -0
  185. package/PostProcesses/RenderPipeline/Pipelines/thinSSRRenderingPipeline.js.map +1 -0
  186. package/PostProcesses/postProcess.d.ts +5 -0
  187. package/PostProcesses/postProcess.js +10 -2
  188. package/PostProcesses/postProcess.js.map +1 -1
  189. package/PostProcesses/thinDepthOfFieldEffect.d.ts +4 -4
  190. package/PostProcesses/thinDepthOfFieldEffect.js.map +1 -1
  191. package/PostProcesses/thinSSRBlurCombinerPostProcess.d.ts +41 -0
  192. package/PostProcesses/thinSSRBlurCombinerPostProcess.js +185 -0
  193. package/PostProcesses/thinSSRBlurCombinerPostProcess.js.map +1 -0
  194. package/PostProcesses/thinSSRBlurPostProcess.d.ts +18 -0
  195. package/PostProcesses/thinSSRBlurPostProcess.js +47 -0
  196. package/PostProcesses/thinSSRBlurPostProcess.js.map +1 -0
  197. package/PostProcesses/thinSSRPostProcess.d.ts +94 -0
  198. package/PostProcesses/thinSSRPostProcess.js +416 -0
  199. package/PostProcesses/thinSSRPostProcess.js.map +1 -0
  200. package/Rendering/IBLShadows/iblShadowsRenderPipeline.d.ts +2 -0
  201. package/Rendering/IBLShadows/iblShadowsRenderPipeline.js +2 -0
  202. package/Rendering/IBLShadows/iblShadowsRenderPipeline.js.map +1 -1
  203. package/Rendering/iblCdfGenerator.js +1 -1
  204. package/Rendering/iblCdfGenerator.js.map +1 -1
  205. package/Shaders/screenSpaceReflection2BlurCombiner.fragment.js +13 -2
  206. package/Shaders/screenSpaceReflection2BlurCombiner.fragment.js.map +1 -1
  207. package/ShadersWGSL/geometry.fragment.js +1 -1
  208. package/ShadersWGSL/geometry.fragment.js.map +1 -1
  209. package/ShadersWGSL/screenSpaceReflection2BlurCombiner.fragment.js +13 -2
  210. package/ShadersWGSL/screenSpaceReflection2BlurCombiner.fragment.js.map +1 -1
  211. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/utils.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAW,EAAE,KAAW;IACrD,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,KAAK,IAAI,gBAAgB,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;AACjG,CAAC;AAOD;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,CAAM;IAClC,IAAI,CAAC,CAAC,YAAY,EAAE,CAAC;QACjB,OAAO,CAAC,CAAC,YAAY,EAAE,CAAC;IAC5B,CAAC;IACD,OAAO;AACX,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAiB,EAAE,UAAkB;IACrE,OAAO,SAAS,KAAK,UAAU,IAAI,CAAC,SAAS,2CAA2B,IAAI,SAAS,2CAA2B,IAAI,SAAS,2CAA2B,CAAC,CAAC;AAC9J,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAiB,EAAE,UAAkB;IACrE,OAAO,SAAS,KAAK,UAAU,IAAI,CAAC,SAAS,yCAA0B,IAAI,SAAS,6CAA4B,IAAI,SAAS,6CAA4B,CAAC,CAAC;AAC/J,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,SAAiB,EAAE,UAAkB;IACtE,OAAO,SAAS,KAAK,kBAAkB,IAAI,UAAU,KAAK,kBAAkB,CAAC;AACjF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,CAA6B;IACnD,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAQ,CAAsB,EAAE,KAAK,KAAK,QAAQ,CAAC;AACvF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,CAAkB;IAC9C,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC/C,CAAC","sourcesContent":["import type { Matrix, Quaternion, Vector2, Vector3, Vector4 } from \"core/Maths/math.vector\";\r\nimport type { Node } from \"../node\";\r\nimport type { FlowGraphInteger } from \"./CustomTypes/flowGraphInteger\";\r\nimport type { FlowGraphMatrix2D, FlowGraphMatrix3D } from \"./CustomTypes/flowGraphMatrix\";\r\nimport { FlowGraphTypes } from \"./flowGraphRichTypes\";\r\n\r\n/**\r\n * @internal\r\n * Returns if mesh1 is a descendant of mesh2\r\n * @param mesh1\r\n * @param mesh2\r\n * @returns\r\n */\r\nexport function _isADescendantOf(mesh1: Node, mesh2: Node): boolean {\r\n return !!(mesh1.parent && (mesh1.parent === mesh2 || _isADescendantOf(mesh1.parent, mesh2)));\r\n}\r\n\r\nexport type FlowGraphNumber = number | FlowGraphInteger;\r\nexport type FlowGraphVector = Vector2 | Vector3 | Vector4 | Quaternion;\r\nexport type FlowGraphMatrix = Matrix | FlowGraphMatrix2D | FlowGraphMatrix3D;\r\nexport type FlowGraphMathOperationType = FlowGraphNumber | FlowGraphVector | FlowGraphMatrix | boolean;\r\n\r\n/**\r\n * @internal\r\n */\r\nexport function _getClassNameOf(v: any) {\r\n if (v.getClassName) {\r\n return v.getClassName();\r\n }\r\n return;\r\n}\r\n\r\n/**\r\n * @internal\r\n * Check if two classname are the same and are vector classes.\r\n * @param className the first class name\r\n * @param className2 the second class name\r\n * @returns whether the two class names are the same and are vector classes.\r\n */\r\nexport function _areSameVectorClass(className: string, className2: string) {\r\n return className === className2 && (className === FlowGraphTypes.Vector2 || className === FlowGraphTypes.Vector3 || className === FlowGraphTypes.Vector4);\r\n}\r\n\r\n/**\r\n * @internal\r\n * Check if two classname are the same and are matrix classes.\r\n * @param className the first class name\r\n * @param className2 the second class name\r\n * @returns whether the two class names are the same and are matrix classes.\r\n */\r\nexport function _areSameMatrixClass(className: string, className2: string) {\r\n return className === className2 && (className === FlowGraphTypes.Matrix || className === FlowGraphTypes.Matrix2D || className === FlowGraphTypes.Matrix3D);\r\n}\r\n\r\n/**\r\n * @internal\r\n * Check if two classname are the same and are integer classes.\r\n * @param className the first class name\r\n * @param className2 the second class name\r\n * @returns whether the two class names are the same and are integer classes.\r\n */\r\nexport function _areSameIntegerClass(className: string, className2: string) {\r\n return className === \"FlowGraphInteger\" && className2 === \"FlowGraphInteger\";\r\n}\r\n\r\n/**\r\n * Check if an object has a numeric value.\r\n * @param a the object to check if it is a number.\r\n * @returns whether a is a FlowGraphNumber (Integer or number).\r\n */\r\nexport function isNumeric(a: FlowGraphMathOperationType): a is FlowGraphNumber {\r\n return typeof a === \"number\" || typeof (a as FlowGraphInteger)?.value === \"number\";\r\n}\r\n\r\n/**\r\n * Get the numeric value of a FlowGraphNumber.\r\n * @param a the object to get the numeric value from.\r\n * @returns the numeric value.\r\n */\r\nexport function getNumericValue(a: FlowGraphNumber): number {\r\n return typeof a === \"number\" ? a : a.value;\r\n}\r\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/utils.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAW,EAAE,KAAW;IACrD,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,KAAK,IAAI,gBAAgB,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;AACjG,CAAC;AAOD;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,CAAM;IAClC,IAAI,CAAC,CAAC,YAAY,EAAE,CAAC;QACjB,OAAO,CAAC,CAAC,YAAY,EAAE,CAAC;IAC5B,CAAC;IACD,OAAO;AACX,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAiB,EAAE,UAAkB;IACrE,OAAO,SAAS,KAAK,UAAU,IAAI,CAAC,SAAS,2CAA2B,IAAI,SAAS,2CAA2B,IAAI,SAAS,2CAA2B,CAAC,CAAC;AAC9J,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAiB,EAAE,UAAkB;IACrE,OAAO,SAAS,KAAK,UAAU,IAAI,CAAC,SAAS,yCAA0B,IAAI,SAAS,6CAA4B,IAAI,SAAS,6CAA4B,CAAC,CAAC;AAC/J,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,SAAiB,EAAE,UAAkB;IACtE,OAAO,SAAS,KAAK,kBAAkB,IAAI,UAAU,KAAK,kBAAkB,CAAC;AACjF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,CAA6B,EAAE,UAAoB;IACzE,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAQ,CAAsB,EAAE,KAAK,KAAK,QAAQ,CAAC;IAC9F,IAAI,SAAS,IAAI,CAAC,UAAU,EAAE,CAAC;QAC3B,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,CAAoB,CAAC,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,CAAkB;IAC9C,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC/C,CAAC","sourcesContent":["import type { Matrix, Quaternion, Vector2, Vector3, Vector4 } from \"core/Maths/math.vector\";\r\nimport type { Node } from \"../node\";\r\nimport type { FlowGraphInteger } from \"./CustomTypes/flowGraphInteger\";\r\nimport type { FlowGraphMatrix2D, FlowGraphMatrix3D } from \"./CustomTypes/flowGraphMatrix\";\r\nimport { FlowGraphTypes } from \"./flowGraphRichTypes\";\r\n\r\n/**\r\n * @internal\r\n * Returns if mesh1 is a descendant of mesh2\r\n * @param mesh1\r\n * @param mesh2\r\n * @returns\r\n */\r\nexport function _isADescendantOf(mesh1: Node, mesh2: Node): boolean {\r\n return !!(mesh1.parent && (mesh1.parent === mesh2 || _isADescendantOf(mesh1.parent, mesh2)));\r\n}\r\n\r\nexport type FlowGraphNumber = number | FlowGraphInteger;\r\nexport type FlowGraphVector = Vector2 | Vector3 | Vector4 | Quaternion;\r\nexport type FlowGraphMatrix = Matrix | FlowGraphMatrix2D | FlowGraphMatrix3D;\r\nexport type FlowGraphMathOperationType = FlowGraphNumber | FlowGraphVector | FlowGraphMatrix | boolean;\r\n\r\n/**\r\n * @internal\r\n */\r\nexport function _getClassNameOf(v: any) {\r\n if (v.getClassName) {\r\n return v.getClassName();\r\n }\r\n return;\r\n}\r\n\r\n/**\r\n * @internal\r\n * Check if two classname are the same and are vector classes.\r\n * @param className the first class name\r\n * @param className2 the second class name\r\n * @returns whether the two class names are the same and are vector classes.\r\n */\r\nexport function _areSameVectorClass(className: string, className2: string) {\r\n return className === className2 && (className === FlowGraphTypes.Vector2 || className === FlowGraphTypes.Vector3 || className === FlowGraphTypes.Vector4);\r\n}\r\n\r\n/**\r\n * @internal\r\n * Check if two classname are the same and are matrix classes.\r\n * @param className the first class name\r\n * @param className2 the second class name\r\n * @returns whether the two class names are the same and are matrix classes.\r\n */\r\nexport function _areSameMatrixClass(className: string, className2: string) {\r\n return className === className2 && (className === FlowGraphTypes.Matrix || className === FlowGraphTypes.Matrix2D || className === FlowGraphTypes.Matrix3D);\r\n}\r\n\r\n/**\r\n * @internal\r\n * Check if two classname are the same and are integer classes.\r\n * @param className the first class name\r\n * @param className2 the second class name\r\n * @returns whether the two class names are the same and are integer classes.\r\n */\r\nexport function _areSameIntegerClass(className: string, className2: string) {\r\n return className === \"FlowGraphInteger\" && className2 === \"FlowGraphInteger\";\r\n}\r\n\r\n/**\r\n * Check if an object has a numeric value.\r\n * @param a the object to check if it is a number.\r\n * @param validIfNaN whether to consider NaN as a valid number.\r\n * @returns whether a is a FlowGraphNumber (Integer or number).\r\n */\r\nexport function isNumeric(a: FlowGraphMathOperationType, validIfNaN?: boolean): a is FlowGraphNumber {\r\n const isNumeric = typeof a === \"number\" || typeof (a as FlowGraphInteger)?.value === \"number\";\r\n if (isNumeric && !validIfNaN) {\r\n return !isNaN(getNumericValue(a as FlowGraphNumber));\r\n }\r\n return isNumeric;\r\n}\r\n\r\n/**\r\n * Get the numeric value of a FlowGraphNumber.\r\n * @param a the object to get the numeric value from.\r\n * @returns the numeric value.\r\n */\r\nexport function getNumericValue(a: FlowGraphNumber): number {\r\n return typeof a === \"number\" ? a : a.value;\r\n}\r\n"]}
@@ -25,7 +25,7 @@ export class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBasePos
25
25
  super(name, frameGraph, scene);
26
26
  this._additionalConstructionParameters = [hdr, bloomScale];
27
27
  this._finalizeInputOutputRegistering();
28
- this._frameGraphTask = new FrameGraphBloomTask(this.name, frameGraph, scene.getEngine(), 0.75, 64, 0.2, hdr, bloomScale);
28
+ this._frameGraphTask = new FrameGraphBloomTask(this.name, frameGraph, 0.75, 64, 0.2, hdr, bloomScale);
29
29
  }
30
30
  _createTask(bloomScale, hdr) {
31
31
  const sourceSamplingMode = this._frameGraphTask.sourceSamplingMode;
@@ -33,7 +33,7 @@ export class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBasePos
33
33
  const weight = this._frameGraphTask.bloom.weight;
34
34
  const kernel = this._frameGraphTask.bloom.kernel;
35
35
  this._frameGraphTask.dispose();
36
- this._frameGraphTask = new FrameGraphBloomTask(this.name, this._frameGraph, this._scene.getEngine(), weight, kernel, threshold, hdr, bloomScale);
36
+ this._frameGraphTask = new FrameGraphBloomTask(this.name, this._frameGraph, weight, kernel, threshold, hdr, bloomScale);
37
37
  this._frameGraphTask.sourceSamplingMode = sourceSamplingMode;
38
38
  this._additionalConstructionParameters = [hdr, bloomScale];
39
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"bloomPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC;AAE7E;;GAEG;AACH,MAAM,OAAO,oCAAqC,SAAQ,mCAAmC;IAGzF;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;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,CAAC;kEAGhG;AAQD;IADC,sBAAsB,CAAC,QAAQ,sCAA8B,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;kEAGhG;AAsCL,aAAa,CAAC,8CAA8C,EAAE,oCAAoC,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { Scene, FrameGraph } from \"core/index\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphBloomTask } from \"../../../Tasks/PostProcesses/bloomTask\";\r\nimport { NodeRenderGraphBasePostProcessBlock } from \"./basePostProcessBlock\";\r\n\r\n/**\r\n * Block that implements the bloom post process\r\n */\r\nexport class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {\r\n protected override _frameGraphTask: FrameGraphBloomTask;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphBloomPostProcessBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n * @param hdr If high dynamic range textures should be used (default: false)\r\n * @param bloomScale The scale of the bloom effect (default: 0.5)\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene, hdr = false, bloomScale = 0.5) {\r\n super(name, frameGraph, scene);\r\n\r\n this._additionalConstructionParameters = [hdr, bloomScale];\r\n\r\n this._finalizeInputOutputRegistering();\r\n\r\n this._frameGraphTask = new FrameGraphBloomTask(this.name, frameGraph, scene.getEngine(), 0.75, 64, 0.2, hdr, bloomScale);\r\n }\r\n\r\n private _createTask(bloomScale: number, hdr: boolean) {\r\n const sourceSamplingMode = this._frameGraphTask.sourceSamplingMode;\r\n const threshold = this._frameGraphTask.bloom.threshold;\r\n const weight = this._frameGraphTask.bloom.weight;\r\n const kernel = this._frameGraphTask.bloom.kernel;\r\n\r\n this._frameGraphTask.dispose();\r\n\r\n this._frameGraphTask = new FrameGraphBloomTask(this.name, this._frameGraph, this._scene.getEngine(), weight, kernel, threshold, hdr, bloomScale);\r\n this._frameGraphTask.sourceSamplingMode = sourceSamplingMode;\r\n\r\n this._additionalConstructionParameters = [hdr, bloomScale];\r\n }\r\n\r\n /** The quality of the blur effect */\r\n @editableInPropertyPage(\"Bloom scale\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get bloomScale() {\r\n return this._frameGraphTask.bloom.scale;\r\n }\r\n\r\n public set bloomScale(value: number) {\r\n this._createTask(value, this._frameGraphTask.hdr);\r\n }\r\n\r\n /** If high dynamic range textures should be used */\r\n @editableInPropertyPage(\"HDR\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get hdr(): boolean {\r\n return this._frameGraphTask.hdr;\r\n }\r\n\r\n public set hdr(value: boolean) {\r\n this._createTask(this._frameGraphTask.bloom.scale, value);\r\n }\r\n\r\n /** The luminance threshold to find bright areas of the image to bloom. */\r\n @editableInPropertyPage(\"Threshold\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 2 })\r\n public get threshold(): number {\r\n return this._frameGraphTask.bloom.threshold;\r\n }\r\n\r\n public set threshold(value: number) {\r\n this._frameGraphTask.bloom.threshold = value;\r\n }\r\n\r\n /** The strength of the bloom. */\r\n @editableInPropertyPage(\"Weight\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 3 })\r\n public get weight(): number {\r\n return this._frameGraphTask.bloom.weight;\r\n }\r\n\r\n public set weight(value: number) {\r\n this._frameGraphTask.bloom.weight = value;\r\n }\r\n\r\n /** Specifies the size of the bloom blur kernel, relative to the final output size */\r\n @editableInPropertyPage(\"Kernel\", PropertyTypeForEdition.Int, \"PROPERTIES\", { min: 1, max: 128 })\r\n public get kernel(): number {\r\n return this._frameGraphTask.bloom.kernel;\r\n }\r\n\r\n public set kernel(value: number) {\r\n this._frameGraphTask.bloom.kernel = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphBloomPostProcessBlock\";\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.threshold = ${this.threshold};`);\r\n codes.push(`${this._codeVariableName}.weight = ${this.weight};`);\r\n codes.push(`${this._codeVariableName}.kernel = ${this.kernel};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.threshold = this.threshold;\r\n serializationObject.weight = this.weight;\r\n serializationObject.kernel = this.kernel;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.threshold = serializationObject.threshold;\r\n this.weight = serializationObject.weight;\r\n this.kernel = serializationObject.kernel;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphBloomPostProcessBlock\", NodeRenderGraphBloomPostProcessBlock);\r\n"]}
1
+ {"version":3,"file":"bloomPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC;AAE7E;;GAEG;AACH,MAAM,OAAO,oCAAqC,SAAQ,mCAAmC;IAGzF;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;;;OAOG;IACH,YAAmB,IAAY,EAAE,UAAsB,E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G,EAAE,CAAC;kEAGhG;AAsCL,aAAa,CAAC,8CAA8C,EAAE,oCAAoC,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { Scene, FrameGraph } from \"core/index\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphBloomTask } from \"../../../Tasks/PostProcesses/bloomTask\";\r\nimport { NodeRenderGraphBasePostProcessBlock } from \"./basePostProcessBlock\";\r\n\r\n/**\r\n * Block that implements the bloom post process\r\n */\r\nexport class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {\r\n protected override _frameGraphTask: FrameGraphBloomTask;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphBloomPostProcessBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n * @param hdr If high dynamic range textures should be used (default: false)\r\n * @param bloomScale The scale of the bloom effect (default: 0.5)\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene, hdr = false, bloomScale = 0.5) {\r\n super(name, frameGraph, scene);\r\n\r\n this._additionalConstructionParameters = [hdr, bloomScale];\r\n\r\n this._finalizeInputOutputRegistering();\r\n\r\n this._frameGraphTask = new FrameGraphBloomTask(this.name, frameGraph, 0.75, 64, 0.2, hdr, bloomScale);\r\n }\r\n\r\n private _createTask(bloomScale: number, hdr: boolean) {\r\n const sourceSamplingMode = this._frameGraphTask.sourceSamplingMode;\r\n const threshold = this._frameGraphTask.bloom.threshold;\r\n const weight = this._frameGraphTask.bloom.weight;\r\n const kernel = this._frameGraphTask.bloom.kernel;\r\n\r\n this._frameGraphTask.dispose();\r\n\r\n this._frameGraphTask = new FrameGraphBloomTask(this.name, this._frameGraph, weight, kernel, threshold, hdr, bloomScale);\r\n this._frameGraphTask.sourceSamplingMode = sourceSamplingMode;\r\n\r\n this._additionalConstructionParameters = [hdr, bloomScale];\r\n }\r\n\r\n /** The quality of the blur effect */\r\n @editableInPropertyPage(\"Bloom scale\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get bloomScale() {\r\n return this._frameGraphTask.bloom.scale;\r\n }\r\n\r\n public set bloomScale(value: number) {\r\n this._createTask(value, this._frameGraphTask.hdr);\r\n }\r\n\r\n /** If high dynamic range textures should be used */\r\n @editableInPropertyPage(\"HDR\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get hdr(): boolean {\r\n return this._frameGraphTask.hdr;\r\n }\r\n\r\n public set hdr(value: boolean) {\r\n this._createTask(this._frameGraphTask.bloom.scale, value);\r\n }\r\n\r\n /** The luminance threshold to find bright areas of the image to bloom. */\r\n @editableInPropertyPage(\"Threshold\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 2 })\r\n public get threshold(): number {\r\n return this._frameGraphTask.bloom.threshold;\r\n }\r\n\r\n public set threshold(value: number) {\r\n this._frameGraphTask.bloom.threshold = value;\r\n }\r\n\r\n /** The strength of the bloom. */\r\n @editableInPropertyPage(\"Weight\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 3 })\r\n public get weight(): number {\r\n return this._frameGraphTask.bloom.weight;\r\n }\r\n\r\n public set weight(value: number) {\r\n this._frameGraphTask.bloom.weight = value;\r\n }\r\n\r\n /** Specifies the size of the bloom blur kernel, relative to the final output size */\r\n @editableInPropertyPage(\"Kernel\", PropertyTypeForEdition.Int, \"PROPERTIES\", { min: 1, max: 128 })\r\n public get kernel(): number {\r\n return this._frameGraphTask.bloom.kernel;\r\n }\r\n\r\n public set kernel(value: number) {\r\n this._frameGraphTask.bloom.kernel = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphBloomPostProcessBlock\";\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.threshold = ${this.threshold};`);\r\n codes.push(`${this._codeVariableName}.weight = ${this.weight};`);\r\n codes.push(`${this._codeVariableName}.kernel = ${this.kernel};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.threshold = this.threshold;\r\n serializationObject.weight = this.weight;\r\n serializationObject.kernel = this.kernel;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.threshold = serializationObject.threshold;\r\n this.weight = serializationObject.weight;\r\n this.kernel = serializationObject.kernel;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphBloomPostProcessBlock\", NodeRenderGraphBloomPostProcessBlock);\r\n"]}
@@ -28,7 +28,7 @@ export class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRenderGraph
28
28
  this.registerInput("geomViewDepth", NodeRenderGraphBlockConnectionPointTypes.TextureViewDepth);
29
29
  this.registerInput("camera", NodeRenderGraphBlockConnectionPointTypes.Camera);
30
30
  this._finalizeInputOutputRegistering();
31
- this._frameGraphTask = new FrameGraphDepthOfFieldTask(this.name, frameGraph, scene.getEngine(), blurLevel, hdr);
31
+ this._frameGraphTask = new FrameGraphDepthOfFieldTask(this.name, frameGraph, blurLevel, hdr);
32
32
  }
33
33
  _createTask(blurLevel, hdr) {
34
34
  const sourceSamplingMode = this._frameGraphTask.sourceSamplingMode;
@@ -38,7 +38,7 @@ export class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRenderGraph
38
38
  const focusDistance = this._frameGraphTask.depthOfField.focusDistance;
39
39
  const lensSize = this._frameGraphTask.depthOfField.lensSize;
40
40
  this._frameGraphTask.dispose();
41
- this._frameGraphTask = new FrameGraphDepthOfFieldTask(this.name, this._frameGraph, this._scene.getEngine(), blurLevel, hdr);
41
+ this._frameGraphTask = new FrameGraphDepthOfFieldTask(this.name, this._frameGraph, blurLevel, hdr);
42
42
  this._frameGraphTask.sourceSamplingMode = sourceSamplingMode;
43
43
  this._frameGraphTask.depthSamplingMode = depthSamplingMode;
44
44
  this._frameGraphTask.depthOfField.focalLength = focalLength;
@@ -1 +1 @@
1
- {"version":3,"file":"depthOfFieldPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAE3F,OAAO,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC;AAE7E;;GAEG;AACH,MAAM,OAAO,2CAA4C,SAAQ,mCAAmC;IAGhG;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;;;OAOG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,KAAY,EAAE,uDAAgF,EAAE,GAAG,GAAG,KAAK;QAChK,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAE/B,IAAI,CAAC,iCAAiC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;QAE1D,IAAI,CAAC,aAAa,CAAC,eAAe,EAAE,wCAAwC,CAAC,gBAAgB,CAAC,CAAC;QAC/F,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,wCAAwC,CAAC,MAAM,CAAC,CAAC;QAE9E,IAAI,CAAC,+BAA+B,EAAE,CAAC;QAEvC,IAAI,CAAC,eAAe,GAAG,IAAI,0BAA0B,CAAC,IAAI,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,KAAK,6CAAqC,EAAE;YAC5D,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,gDAAwC,EAAE;YAClE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,8CAAsC,EAAE;SACjE;KACJ,CAAC;4EAGD;AAQD;IADC,sBAAsB,CAAC,KAAK,0CAAkC,YAAY,CAAC;sEAG3E;AAQD;IADC,sBAAsB,CAAC,qBAAqB,+CAAuC,YAAY,CAAC;oFAGhG;AAQD;IADC,sBAAsB,CAAC,cAAc,wCAAgC,YAAY,CAAC;8EAGlF;AAQD;IADC,sBAAsB,CAAC,QAAQ,wCAAgC,YAAY,CAAC;wEAG5E;AAQD;IADC,sBAAsB,CAAC,gBAAgB,wCAAgC,YAAY,CAAC;gFAGpF;AAQD;IADC,sBAAsB,CAAC,WAAW,wCAAgC,YAAY,CAAC;2EAG/E;AAmEL,aAAa,CAAC,qDAAqD,EAAE,2CAA2C,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraphTextureHandle, FrameGraph, Camera } from \"core/index\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphDepthOfFieldTask } from \"../../../Tasks/PostProcesses/depthOfFieldTask\";\r\nimport { ThinDepthOfFieldEffectBlurLevel } from \"core/PostProcesses/thinDepthOfFieldEffect\";\r\nimport { NodeRenderGraphBasePostProcessBlock } from \"./basePostProcessBlock\";\r\n\r\n/**\r\n * Block that implements the depth of field post process\r\n */\r\nexport class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {\r\n protected override _frameGraphTask: FrameGraphDepthOfFieldTask;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphDepthOfFieldPostProcessBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n * @param blurLevel The quality of the depth of field effect (default: ThinDepthOfFieldEffectBlurLevel.Low)\r\n * @param hdr If high dynamic range textures should be used (default: false)\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene, blurLevel: ThinDepthOfFieldEffectBlurLevel = ThinDepthOfFieldEffectBlurLevel.Low, hdr = false) {\r\n super(name, frameGraph, scene);\r\n\r\n this._additionalConstructionParameters = [blurLevel, hdr];\r\n\r\n this.registerInput(\"geomViewDepth\", NodeRenderGraphBlockConnectionPointTypes.TextureViewDepth);\r\n this.registerInput(\"camera\", NodeRenderGraphBlockConnectionPointTypes.Camera);\r\n\r\n this._finalizeInputOutputRegistering();\r\n\r\n this._frameGraphTask = new FrameGraphDepthOfFieldTask(this.name, frameGraph, scene.getEngine(), blurLevel, hdr);\r\n }\r\n\r\n private _createTask(blurLevel: ThinDepthOfFieldEffectBlurLevel, hdr: boolean) {\r\n const sourceSamplingMode = this._frameGraphTask.sourceSamplingMode;\r\n const depthSamplingMode = this._frameGraphTask.depthSamplingMode;\r\n const focalLength = this._frameGraphTask.depthOfField.focalLength;\r\n const fStop = this._frameGraphTask.depthOfField.fStop;\r\n const focusDistance = this._frameGraphTask.depthOfField.focusDistance;\r\n const lensSize = this._frameGraphTask.depthOfField.lensSize;\r\n\r\n this._frameGraphTask.dispose();\r\n\r\n this._frameGraphTask = new FrameGraphDepthOfFieldTask(this.name, this._frameGraph, this._scene.getEngine(), blurLevel, hdr);\r\n this._frameGraphTask.sourceSamplingMode = sourceSamplingMode;\r\n this._frameGraphTask.depthSamplingMode = depthSamplingMode;\r\n this._frameGraphTask.depthOfField.focalLength = focalLength;\r\n this._frameGraphTask.depthOfField.fStop = fStop;\r\n this._frameGraphTask.depthOfField.focusDistance = focusDistance;\r\n this._frameGraphTask.depthOfField.lensSize = lensSize;\r\n\r\n this._additionalConstructionParameters = [blurLevel, hdr];\r\n }\r\n\r\n /** The quality of the blur effect */\r\n @editableInPropertyPage(\"Blur level\", PropertyTypeForEdition.List, \"PROPERTIES\", {\r\n options: [\r\n { label: \"Low\", value: ThinDepthOfFieldEffectBlurLevel.Low },\r\n { label: \"Medium\", value: ThinDepthOfFieldEffectBlurLevel.Medium },\r\n { label: \"High\", value: ThinDepthOfFieldEffectBlurLevel.High },\r\n ],\r\n })\r\n public get blurLevel(): ThinDepthOfFieldEffectBlurLevel {\r\n return this._frameGraphTask.depthOfField.blurLevel;\r\n }\r\n\r\n public set blurLevel(value: ThinDepthOfFieldEffectBlurLevel) {\r\n this._createTask(value, this._frameGraphTask.hdr);\r\n }\r\n\r\n /** If high dynamic range textures should be used */\r\n @editableInPropertyPage(\"HDR\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get hdr(): boolean {\r\n return this._frameGraphTask.hdr;\r\n }\r\n\r\n public set hdr(value: boolean) {\r\n this._createTask(this._frameGraphTask.depthOfField.blurLevel, value);\r\n }\r\n\r\n /** Sampling mode used to sample from the depth texture */\r\n @editableInPropertyPage(\"Depth sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get depthSamplingMode() {\r\n return this._frameGraphTask.depthSamplingMode;\r\n }\r\n\r\n public set depthSamplingMode(value: number) {\r\n this._frameGraphTask.depthSamplingMode = value;\r\n }\r\n\r\n /** The focal the length of the camera used in the effect in scene units/1000 (eg. millimeter). */\r\n @editableInPropertyPage(\"Focal length\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get focalLength(): number {\r\n return this._frameGraphTask.depthOfField.focalLength;\r\n }\r\n\r\n public set focalLength(value: number) {\r\n this._frameGraphTask.depthOfField.focalLength = value;\r\n }\r\n\r\n /** F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop. */\r\n @editableInPropertyPage(\"F-Stop\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get fStop(): number {\r\n return this._frameGraphTask.depthOfField.fStop;\r\n }\r\n\r\n public set fStop(value: number) {\r\n this._frameGraphTask.depthOfField.fStop = value;\r\n }\r\n\r\n /** Distance away from the camera to focus on in scene units/1000 (eg. millimeter). */\r\n @editableInPropertyPage(\"Focus distance\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get focusDistance(): number {\r\n return this._frameGraphTask.depthOfField.focusDistance;\r\n }\r\n\r\n public set focusDistance(value: number) {\r\n this._frameGraphTask.depthOfField.focusDistance = value;\r\n }\r\n\r\n /** Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. The diameter of the resulting aperture can be computed by lensSize/fStop. */\r\n @editableInPropertyPage(\"Lens size\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get lensSize(): number {\r\n return this._frameGraphTask.depthOfField.lensSize;\r\n }\r\n\r\n public set lensSize(value: number) {\r\n this._frameGraphTask.depthOfField.lensSize = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphDepthOfFieldPostProcessBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry view depth input component\r\n */\r\n public get geomViewDepth(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the camera input component\r\n */\r\n public get camera(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this.output.value = this._frameGraphTask.outputTexture;\r\n\r\n this._frameGraphTask.depthTexture = this.geomViewDepth.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.camera = this.camera.connectedPoint?.value as Camera;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.lensSize = ${this.lensSize};`);\r\n codes.push(`${this._codeVariableName}.fStop = ${this.fStop};`);\r\n codes.push(`${this._codeVariableName}.focusDistance = ${this.focusDistance};`);\r\n codes.push(`${this._codeVariableName}.focalLength = ${this.focalLength};`);\r\n codes.push(`${this._codeVariableName}.depthSamplingMode = ${this.depthSamplingMode};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.lensSize = this.lensSize;\r\n serializationObject.fStop = this.fStop;\r\n serializationObject.focusDistance = this.focusDistance;\r\n serializationObject.focalLength = this.focalLength;\r\n serializationObject.depthSamplingMode = this.depthSamplingMode;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.lensSize = serializationObject.lensSize;\r\n this.fStop = serializationObject.fStop;\r\n this.focusDistance = serializationObject.focusDistance;\r\n this.focalLength = serializationObject.focalLength;\r\n this.depthSamplingMode = serializationObject.depthSamplingMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphDepthOfFieldPostProcessBlock\", NodeRenderGraphDepthOfFieldPostProcessBlock);\r\n"]}
1
+ {"version":3,"file":"depthOfFieldPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAE3F,OAAO,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC;AAE7E;;GAEG;AACH,MAAM,OAAO,2CAA4C,SAAQ,mCAAmC;IAGhG;;OAEG;IACH,IAAoB,IA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KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QACxC,IAAI,CAAC,QAAQ,GAAG,mBAAmB,CAAC,QAAQ,CAAC;QAC7C,IAAI,CAAC,KAAK,GAAG,mBAAmB,CAAC,KAAK,CAAC;QACvC,IAAI,CAAC,aAAa,GAAG,mBAAmB,CAAC,aAAa,CAAC;QACvD,IAAI,CAAC,WAAW,GAAG,mBAAmB,CAAC,WAAW,CAAC;QACnD,IAAI,CAAC,iBAAiB,GAAG,mBAAmB,CAAC,iBAAiB,CAAC;IACnE,CAAC;CACJ;AA/HG;IAPC,sBAAsB,CAAC,YAAY,uCAA+B,YAAY,EAAE;QAC7E,OAAO,EAAE;YACL,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,6CAAqC,EAAE;YAC5D,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,gDAAwC,EAAE;YAClE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,8CAAsC,EAAE;SACjE;KACJ,CAAC;4EAGD;AAQD;IADC,sBAAsB,CAAC,KAAK,0CAAkC,YAAY,CAAC;sEAG3E;AAQD;IADC,sBAAsB,CAAC,qBAAqB,+CAAuC,YAAY,CAAC;oFAGhG;AAQD;IADC,sBAAsB,CAAC,cAAc,wCAAgC,YAAY,CAAC;8EAGlF;AAQD;IADC,sBAAsB,CAAC,QAAQ,wCAAgC,YAAY,CAAC;wEAG5E;AAQD;IADC,sBAAsB,CAAC,gBAAgB,wCAAgC,YAAY,CAAC;gFAGpF;AAQD;IADC,sBAAsB,CAAC,WAAW,wCAAgC,YAAY,CAAC;2EAG/E;AAmEL,aAAa,CAAC,qDAAqD,EAAE,2CAA2C,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraphTextureHandle, FrameGraph, Camera } from \"core/index\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphDepthOfFieldTask } from \"../../../Tasks/PostProcesses/depthOfFieldTask\";\r\nimport { ThinDepthOfFieldEffectBlurLevel } from \"core/PostProcesses/thinDepthOfFieldEffect\";\r\nimport { NodeRenderGraphBasePostProcessBlock } from \"./basePostProcessBlock\";\r\n\r\n/**\r\n * Block that implements the depth of field post process\r\n */\r\nexport class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {\r\n protected override _frameGraphTask: FrameGraphDepthOfFieldTask;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphDepthOfFieldPostProcessBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n * @param blurLevel The quality of the depth of field effect (default: ThinDepthOfFieldEffectBlurLevel.Low)\r\n * @param hdr If high dynamic range textures should be used (default: false)\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene, blurLevel: ThinDepthOfFieldEffectBlurLevel = ThinDepthOfFieldEffectBlurLevel.Low, hdr = false) {\r\n super(name, frameGraph, scene);\r\n\r\n this._additionalConstructionParameters = [blurLevel, hdr];\r\n\r\n this.registerInput(\"geomViewDepth\", NodeRenderGraphBlockConnectionPointTypes.TextureViewDepth);\r\n this.registerInput(\"camera\", NodeRenderGraphBlockConnectionPointTypes.Camera);\r\n\r\n this._finalizeInputOutputRegistering();\r\n\r\n this._frameGraphTask = new FrameGraphDepthOfFieldTask(this.name, frameGraph, blurLevel, hdr);\r\n }\r\n\r\n private _createTask(blurLevel: ThinDepthOfFieldEffectBlurLevel, hdr: boolean) {\r\n const sourceSamplingMode = this._frameGraphTask.sourceSamplingMode;\r\n const depthSamplingMode = this._frameGraphTask.depthSamplingMode;\r\n const focalLength = this._frameGraphTask.depthOfField.focalLength;\r\n const fStop = this._frameGraphTask.depthOfField.fStop;\r\n const focusDistance = this._frameGraphTask.depthOfField.focusDistance;\r\n const lensSize = this._frameGraphTask.depthOfField.lensSize;\r\n\r\n this._frameGraphTask.dispose();\r\n\r\n this._frameGraphTask = new FrameGraphDepthOfFieldTask(this.name, this._frameGraph, blurLevel, hdr);\r\n this._frameGraphTask.sourceSamplingMode = sourceSamplingMode;\r\n this._frameGraphTask.depthSamplingMode = depthSamplingMode;\r\n this._frameGraphTask.depthOfField.focalLength = focalLength;\r\n this._frameGraphTask.depthOfField.fStop = fStop;\r\n this._frameGraphTask.depthOfField.focusDistance = focusDistance;\r\n this._frameGraphTask.depthOfField.lensSize = lensSize;\r\n\r\n this._additionalConstructionParameters = [blurLevel, hdr];\r\n }\r\n\r\n /** The quality of the blur effect */\r\n @editableInPropertyPage(\"Blur level\", PropertyTypeForEdition.List, \"PROPERTIES\", {\r\n options: [\r\n { label: \"Low\", value: ThinDepthOfFieldEffectBlurLevel.Low },\r\n { label: \"Medium\", value: ThinDepthOfFieldEffectBlurLevel.Medium },\r\n { label: \"High\", value: ThinDepthOfFieldEffectBlurLevel.High },\r\n ],\r\n })\r\n public get blurLevel(): ThinDepthOfFieldEffectBlurLevel {\r\n return this._frameGraphTask.depthOfField.blurLevel;\r\n }\r\n\r\n public set blurLevel(value: ThinDepthOfFieldEffectBlurLevel) {\r\n this._createTask(value, this._frameGraphTask.hdr);\r\n }\r\n\r\n /** If high dynamic range textures should be used */\r\n @editableInPropertyPage(\"HDR\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get hdr(): boolean {\r\n return this._frameGraphTask.hdr;\r\n }\r\n\r\n public set hdr(value: boolean) {\r\n this._createTask(this._frameGraphTask.depthOfField.blurLevel, value);\r\n }\r\n\r\n /** Sampling mode used to sample from the depth texture */\r\n @editableInPropertyPage(\"Depth sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get depthSamplingMode() {\r\n return this._frameGraphTask.depthSamplingMode;\r\n }\r\n\r\n public set depthSamplingMode(value: number) {\r\n this._frameGraphTask.depthSamplingMode = value;\r\n }\r\n\r\n /** The focal the length of the camera used in the effect in scene units/1000 (eg. millimeter). */\r\n @editableInPropertyPage(\"Focal length\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get focalLength(): number {\r\n return this._frameGraphTask.depthOfField.focalLength;\r\n }\r\n\r\n public set focalLength(value: number) {\r\n this._frameGraphTask.depthOfField.focalLength = value;\r\n }\r\n\r\n /** F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop. */\r\n @editableInPropertyPage(\"F-Stop\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get fStop(): number {\r\n return this._frameGraphTask.depthOfField.fStop;\r\n }\r\n\r\n public set fStop(value: number) {\r\n this._frameGraphTask.depthOfField.fStop = value;\r\n }\r\n\r\n /** Distance away from the camera to focus on in scene units/1000 (eg. millimeter). */\r\n @editableInPropertyPage(\"Focus distance\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get focusDistance(): number {\r\n return this._frameGraphTask.depthOfField.focusDistance;\r\n }\r\n\r\n public set focusDistance(value: number) {\r\n this._frameGraphTask.depthOfField.focusDistance = value;\r\n }\r\n\r\n /** Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. The diameter of the resulting aperture can be computed by lensSize/fStop. */\r\n @editableInPropertyPage(\"Lens size\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get lensSize(): number {\r\n return this._frameGraphTask.depthOfField.lensSize;\r\n }\r\n\r\n public set lensSize(value: number) {\r\n this._frameGraphTask.depthOfField.lensSize = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphDepthOfFieldPostProcessBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry view depth input component\r\n */\r\n public get geomViewDepth(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the camera input component\r\n */\r\n public get camera(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this.output.value = this._frameGraphTask.outputTexture;\r\n\r\n this._frameGraphTask.depthTexture = this.geomViewDepth.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.camera = this.camera.connectedPoint?.value as Camera;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.lensSize = ${this.lensSize};`);\r\n codes.push(`${this._codeVariableName}.fStop = ${this.fStop};`);\r\n codes.push(`${this._codeVariableName}.focusDistance = ${this.focusDistance};`);\r\n codes.push(`${this._codeVariableName}.focalLength = ${this.focalLength};`);\r\n codes.push(`${this._codeVariableName}.depthSamplingMode = ${this.depthSamplingMode};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.lensSize = this.lensSize;\r\n serializationObject.fStop = this.fStop;\r\n serializationObject.focusDistance = this.focusDistance;\r\n serializationObject.focalLength = this.focalLength;\r\n serializationObject.depthSamplingMode = this.depthSamplingMode;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.lensSize = serializationObject.lensSize;\r\n this.fStop = serializationObject.fStop;\r\n this.focusDistance = serializationObject.focusDistance;\r\n this.focalLength = serializationObject.focalLength;\r\n this.depthSamplingMode = serializationObject.depthSamplingMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphDepthOfFieldPostProcessBlock\", NodeRenderGraphDepthOfFieldPostProcessBlock);\r\n"]}
@@ -0,0 +1,126 @@
1
+ import type { Scene, FrameGraph, NodeRenderGraphConnectionPoint, NodeRenderGraphBuildState } from "../../../../index.js";
2
+ import { FrameGraphSSRRenderingPipelineTask } from "../../../Tasks/PostProcesses/ssrRenderingPipelineTask";
3
+ import { NodeRenderGraphBasePostProcessBlock } from "./basePostProcessBlock";
4
+ /**
5
+ * Block that implements the SSR post process
6
+ */
7
+ export declare class NodeRenderGraphSSRPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {
8
+ protected _frameGraphTask: FrameGraphSSRRenderingPipelineTask;
9
+ /**
10
+ * Gets the frame graph task associated with this block
11
+ */
12
+ get task(): FrameGraphSSRRenderingPipelineTask;
13
+ /**
14
+ * Create a new NodeRenderGraphSSRPostProcessBlock
15
+ * @param name defines the block name
16
+ * @param frameGraph defines the hosting frame graph
17
+ * @param scene defines the hosting scene
18
+ * @param textureType The texture type used by the different post processes created by SSR (default: Constants.TEXTURETYPE_UNSIGNED_BYTE)
19
+ */
20
+ constructor(name: string, frameGraph: FrameGraph, scene: Scene, textureType?: number);
21
+ private _createTask;
22
+ /** The texture type used by the different post processes created by SSR */
23
+ get textureType(): number;
24
+ set textureType(value: number);
25
+ /** Gets or sets a boolean indicating if the effect should be rendered in debug mode */
26
+ get debug(): boolean;
27
+ set debug(value: boolean);
28
+ /** Gets or sets the current reflection strength. 1.0 is an ideal value but can be increased/decreased for particular results */
29
+ get strength(): number;
30
+ set strength(value: number);
31
+ /** Gets or sets the falloff exponent used to compute the reflection strength. Higher values lead to fainter reflections */
32
+ get reflectionSpecularFalloffExponent(): number;
33
+ set reflectionSpecularFalloffExponent(value: number);
34
+ /** Gets or sets the minimum value for one of the reflectivity component of the material to consider it for SSR */
35
+ get reflectivityThreshold(): number;
36
+ set reflectivityThreshold(value: number);
37
+ /** Gets or sets the thickness value used as tolerance when computing the intersection between the reflected ray and the scene */
38
+ get thickness(): number;
39
+ set thickness(value: number);
40
+ /** Gets or sets the step size used to iterate until the effect finds the color of the reflection's pixel */
41
+ get step(): number;
42
+ set step(value: number);
43
+ /** Gets or sets whether or not smoothing reflections is enabled */
44
+ get enableSmoothReflections(): boolean;
45
+ set enableSmoothReflections(value: boolean);
46
+ /** Maximum number of steps during the ray marching process after which we consider an intersection could not be found */
47
+ get maxSteps(): number;
48
+ set maxSteps(value: number);
49
+ /** Gets or sets the max distance used to define how far we look for reflection during the ray-marching on the reflected ray */
50
+ get maxDistance(): number;
51
+ set maxDistance(value: number);
52
+ /** Gets or sets the factor applied when computing roughness */
53
+ get roughnessFactor(): number;
54
+ set roughnessFactor(value: number);
55
+ /** Number of steps to skip at start when marching the ray to avoid self collisions */
56
+ get selfCollisionNumSkip(): number;
57
+ set selfCollisionNumSkip(value: number);
58
+ /** Gets or sets the downsample factor used to reduce the size of the texture used to compute the SSR contribution */
59
+ get ssrDownsample(): number;
60
+ set ssrDownsample(value: number);
61
+ /** Gets or sets a boolean indicating if the ray should be clipped to the frustum */
62
+ get clipToFrustum(): boolean;
63
+ set clipToFrustum(value: boolean);
64
+ /** Gets or sets a boolean defining if geometry thickness should be computed automatically */
65
+ get enableAutomaticThicknessComputation(): boolean;
66
+ set enableAutomaticThicknessComputation(value: boolean);
67
+ /** 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 */
68
+ get useFresnel(): boolean;
69
+ set useFresnel(value: boolean);
70
+ /** Gets or sets the blur dispersion strength. Set this value to 0 to disable blurring */
71
+ get blurDispersionStrength(): number;
72
+ set blurDispersionStrength(value: number);
73
+ /** Gets or sets the downsample factor used to reduce the size of the textures used to blur the reflection effect */
74
+ get blurDownsample(): number;
75
+ set blurDownsample(value: number);
76
+ /** Gets or sets a boolean indicating if the reflections should be attenuated at the screen borders */
77
+ get attenuateScreenBorders(): boolean;
78
+ set attenuateScreenBorders(value: boolean);
79
+ /** Gets or sets a boolean indicating if the reflections should be attenuated according to the distance of the intersection */
80
+ get attenuateIntersectionDistance(): boolean;
81
+ set attenuateIntersectionDistance(value: boolean);
82
+ /** Gets or sets a boolean indicating if the reflections should be attenuated according to the number of iterations performed to find the intersection */
83
+ get attenuateIntersectionIterations(): boolean;
84
+ set attenuateIntersectionIterations(value: boolean);
85
+ /** Gets or sets a boolean indicating if the reflections should be attenuated when the reflection ray is facing the camera (the view direction) */
86
+ get attenuateFacingCamera(): boolean;
87
+ set attenuateFacingCamera(value: boolean);
88
+ /** Gets or sets a boolean indicating if the backface reflections should be attenuated */
89
+ get attenuateBackfaceReflection(): boolean;
90
+ set attenuateBackfaceReflection(value: boolean);
91
+ /** Gets or sets a boolean defining if the input color texture is in gamma space */
92
+ get inputTextureColorIsInGammaSpace(): boolean;
93
+ set inputTextureColorIsInGammaSpace(value: boolean);
94
+ /** Gets or sets a boolean defining if the output color texture generated by the SSR pipeline should be in gamma space */
95
+ get generateOutputInGammaSpace(): boolean;
96
+ set generateOutputInGammaSpace(value: boolean);
97
+ /**
98
+ * Gets the current class name
99
+ * @returns the class name
100
+ */
101
+ getClassName(): string;
102
+ /**
103
+ * Gets the camera input component
104
+ */
105
+ get camera(): NodeRenderGraphConnectionPoint;
106
+ /**
107
+ * Gets the geometry depth input component
108
+ */
109
+ get geomDepth(): NodeRenderGraphConnectionPoint;
110
+ /**
111
+ * Gets the geometry normal input component
112
+ */
113
+ get geomNormal(): NodeRenderGraphConnectionPoint;
114
+ /**
115
+ * Gets the geometry reflectivity input component
116
+ */
117
+ get geomReflectivity(): NodeRenderGraphConnectionPoint;
118
+ /**
119
+ * Gets the geometry back depth input component
120
+ */
121
+ get geomBackDepth(): NodeRenderGraphConnectionPoint;
122
+ protected _buildBlock(state: NodeRenderGraphBuildState): void;
123
+ protected _dumpPropertiesCode(): string;
124
+ serialize(): any;
125
+ _deserialize(serializationObject: any): void;
126
+ }