@babylonjs/core 7.43.0 → 7.44.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. package/Actions/actionEvent.d.ts +4 -4
  2. package/Buffers/bufferUtils.d.ts +8 -1
  3. package/Buffers/bufferUtils.js +15 -0
  4. package/Buffers/bufferUtils.js.map +1 -1
  5. package/Culling/Helper/boundingInfoHelper.d.ts +2 -9
  6. package/Culling/Helper/boundingInfoHelper.js +2 -9
  7. package/Culling/Helper/boundingInfoHelper.js.map +1 -1
  8. package/Debug/debugLayer.d.ts +4 -0
  9. package/Debug/debugLayer.js +9 -0
  10. package/Debug/debugLayer.js.map +1 -1
  11. package/Engines/Extensions/engine.renderTarget.js +2 -4
  12. package/Engines/Extensions/engine.renderTarget.js.map +1 -1
  13. package/Engines/WebGPU/Extensions/engine.renderTarget.js +2 -4
  14. package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
  15. package/Engines/abstractEngine.d.ts +19 -1
  16. package/Engines/abstractEngine.js +48 -9
  17. package/Engines/abstractEngine.js.map +1 -1
  18. package/Engines/engine.d.ts +6 -3
  19. package/Engines/engine.js +2 -20
  20. package/Engines/engine.js.map +1 -1
  21. package/Engines/renderTargetWrapper.js +2 -2
  22. package/Engines/renderTargetWrapper.js.map +1 -1
  23. package/Engines/thinEngine.js +1 -5
  24. package/Engines/thinEngine.js.map +1 -1
  25. package/Engines/webgpuEngine.js +1 -0
  26. package/Engines/webgpuEngine.js.map +1 -1
  27. package/FlowGraph/flowGraphConnection.d.ts +1 -1
  28. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.d.ts +16 -12
  29. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js +63 -27
  30. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js.map +1 -1
  31. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.d.ts +72 -0
  32. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js +197 -0
  33. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js.map +1 -0
  34. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.d.ts +42 -0
  35. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js +78 -0
  36. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js.map +1 -0
  37. package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.d.ts +3 -19
  38. package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js +3 -49
  39. package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js.map +1 -1
  40. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.d.ts +3 -19
  41. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js +3 -49
  42. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js.map +1 -1
  43. package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.d.ts +3 -19
  44. package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js +3 -49
  45. package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js.map +1 -1
  46. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.d.ts +2 -17
  47. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js +3 -45
  48. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js.map +1 -1
  49. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.d.ts +2 -17
  50. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js +3 -44
  51. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js.map +1 -1
  52. package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.d.ts +3 -19
  53. package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js +3 -49
  54. package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js.map +1 -1
  55. package/FrameGraph/Node/Blocks/PostProcesses/passPostProcessBlock.d.ts +47 -0
  56. package/FrameGraph/Node/Blocks/PostProcesses/passPostProcessBlock.js +65 -0
  57. package/FrameGraph/Node/Blocks/PostProcesses/passPostProcessBlock.js.map +1 -0
  58. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.d.ts +4 -0
  59. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +9 -0
  60. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
  61. package/FrameGraph/Node/Blocks/index.d.ts +2 -0
  62. package/FrameGraph/Node/Blocks/index.js +2 -0
  63. package/FrameGraph/Node/Blocks/index.js.map +1 -1
  64. package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +4 -2
  65. package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +2 -0
  66. package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -1
  67. package/FrameGraph/Node/nodeRenderGraph.d.ts +3 -2
  68. package/FrameGraph/Node/nodeRenderGraph.js +4 -3
  69. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  70. package/FrameGraph/Node/nodeRenderGraphBlock.js +4 -4
  71. package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -1
  72. package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.d.ts +8 -0
  73. package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js +10 -0
  74. package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js.map +1 -1
  75. package/FrameGraph/Node/nodeRenderGraphConnectionPointCustomObject.d.ts +21 -0
  76. package/FrameGraph/Node/nodeRenderGraphConnectionPointCustomObject.js +31 -0
  77. package/FrameGraph/Node/nodeRenderGraphConnectionPointCustomObject.js.map +1 -0
  78. package/FrameGraph/Passes/pass.d.ts +1 -0
  79. package/FrameGraph/Passes/pass.js +4 -1
  80. package/FrameGraph/Passes/pass.js.map +1 -1
  81. package/FrameGraph/Tasks/Layers/baseLayerTask.d.ts +81 -0
  82. package/FrameGraph/Tasks/Layers/baseLayerTask.js +304 -0
  83. package/FrameGraph/Tasks/Layers/baseLayerTask.js.map +1 -0
  84. package/FrameGraph/Tasks/Layers/glowLayerTask.d.ts +3 -40
  85. package/FrameGraph/Tasks/Layers/glowLayerTask.js +4 -158
  86. package/FrameGraph/Tasks/Layers/glowLayerTask.js.map +1 -1
  87. package/FrameGraph/Tasks/Layers/highlightLayerTask.d.ts +21 -0
  88. package/FrameGraph/Tasks/Layers/highlightLayerTask.js +32 -0
  89. package/FrameGraph/Tasks/Layers/highlightLayerTask.js.map +1 -0
  90. package/FrameGraph/Tasks/Misc/executeTask.d.ts +2 -2
  91. package/FrameGraph/Tasks/Misc/executeTask.js +1 -0
  92. package/FrameGraph/Tasks/Misc/executeTask.js.map +1 -1
  93. package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js +1 -1
  94. package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js.map +1 -1
  95. package/FrameGraph/Tasks/PostProcesses/bloomTask.js +1 -1
  96. package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -1
  97. package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js +5 -4
  98. package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js.map +1 -1
  99. package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js +5 -4
  100. package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js.map +1 -1
  101. package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js +2 -4
  102. package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js.map +1 -1
  103. package/FrameGraph/Tasks/PostProcesses/passTask.d.ts +29 -0
  104. package/FrameGraph/Tasks/PostProcesses/passTask.js +31 -0
  105. package/FrameGraph/Tasks/PostProcesses/passTask.js.map +1 -0
  106. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +4 -2
  107. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
  108. package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +2 -2
  109. package/FrameGraph/Tasks/Rendering/objectRendererTask.js +1 -0
  110. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
  111. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.d.ts +2 -2
  112. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js +1 -0
  113. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js.map +1 -1
  114. package/FrameGraph/Tasks/Texture/clearTextureTask.d.ts +2 -2
  115. package/FrameGraph/Tasks/Texture/clearTextureTask.js +1 -0
  116. package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
  117. package/FrameGraph/Tasks/Texture/copyToTextureTask.js +1 -1
  118. package/FrameGraph/Tasks/Texture/copyToTextureTask.js.map +1 -1
  119. package/FrameGraph/frameGraph.d.ts +8 -2
  120. package/FrameGraph/frameGraph.js +31 -5
  121. package/FrameGraph/frameGraph.js.map +1 -1
  122. package/FrameGraph/frameGraphRenderContext.d.ts +10 -0
  123. package/FrameGraph/frameGraphRenderContext.js +14 -0
  124. package/FrameGraph/frameGraphRenderContext.js.map +1 -1
  125. package/FrameGraph/frameGraphTask.d.ts +3 -2
  126. package/FrameGraph/frameGraphTask.js +12 -2
  127. package/FrameGraph/frameGraphTask.js.map +1 -1
  128. package/FrameGraph/frameGraphTextureManager.d.ts +1 -1
  129. package/FrameGraph/frameGraphTypes.d.ts +4 -0
  130. package/FrameGraph/frameGraphTypes.js.map +1 -1
  131. package/FrameGraph/index.d.ts +2 -0
  132. package/FrameGraph/index.js +2 -0
  133. package/FrameGraph/index.js.map +1 -1
  134. package/Gizmos/planeRotationGizmo.js +10 -0
  135. package/Gizmos/planeRotationGizmo.js.map +1 -1
  136. package/Helpers/environmentHelper.js +7 -6
  137. package/Helpers/environmentHelper.js.map +1 -1
  138. package/Inputs/scene.inputManager.js +2 -2
  139. package/Inputs/scene.inputManager.js.map +1 -1
  140. package/Layers/effectLayer.d.ts +1 -1
  141. package/Layers/effectLayer.js.map +1 -1
  142. package/Layers/glowLayer.d.ts +2 -14
  143. package/Layers/glowLayer.js +34 -36
  144. package/Layers/glowLayer.js.map +1 -1
  145. package/Layers/highlightLayer.d.ts +13 -74
  146. package/Layers/highlightLayer.js +123 -309
  147. package/Layers/highlightLayer.js.map +1 -1
  148. package/Layers/index.d.ts +1 -0
  149. package/Layers/index.js +1 -0
  150. package/Layers/index.js.map +1 -1
  151. package/Layers/thinEffectLayer.d.ts +55 -2
  152. package/Layers/thinEffectLayer.js +66 -0
  153. package/Layers/thinEffectLayer.js.map +1 -1
  154. package/Layers/thinGlowLayer.d.ts +3 -6
  155. package/Layers/thinGlowLayer.js +4 -1
  156. package/Layers/thinGlowLayer.js.map +1 -1
  157. package/Layers/thinHighlightLayer.d.ts +197 -0
  158. package/Layers/thinHighlightLayer.js +417 -0
  159. package/Layers/thinHighlightLayer.js.map +1 -0
  160. package/Materials/GreasedLine/greasedLinePluginMaterial.d.ts +6 -2
  161. package/Materials/GreasedLine/greasedLinePluginMaterial.js +8 -2
  162. package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
  163. package/Materials/GreasedLine/greasedLinePluginMaterialShadersWGSL.js +11 -3
  164. package/Materials/GreasedLine/greasedLinePluginMaterialShadersWGSL.js.map +1 -1
  165. package/Materials/GreasedLine/greasedLineSimpleMaterial.d.ts +1 -0
  166. package/Materials/GreasedLine/greasedLineSimpleMaterial.js +1 -0
  167. package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -1
  168. package/Materials/Node/Blocks/PBR/reflectionBlock.js +1 -3
  169. package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
  170. package/Materials/Node/Blocks/PBR/subSurfaceBlock.js +3 -3
  171. package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
  172. package/Materials/Node/nodeMaterial.d.ts +4 -2
  173. package/Materials/Node/nodeMaterial.js +9 -6
  174. package/Materials/Node/nodeMaterial.js.map +1 -1
  175. package/Materials/PBR/pbrBaseMaterial.js +1 -0
  176. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  177. package/Materials/Textures/Filtering/hdrFiltering.js +1 -0
  178. package/Materials/Textures/Filtering/hdrFiltering.js.map +1 -1
  179. package/Materials/Textures/Filtering/hdrIrradianceFiltering.d.ts +69 -0
  180. package/Materials/Textures/Filtering/hdrIrradianceFiltering.js +187 -0
  181. package/Materials/Textures/Filtering/hdrIrradianceFiltering.js.map +1 -0
  182. package/Materials/Textures/hdrCubeTexture.d.ts +5 -1
  183. package/Materials/Textures/hdrCubeTexture.js +29 -3
  184. package/Materials/Textures/hdrCubeTexture.js.map +1 -1
  185. package/Materials/Textures/index.d.ts +4 -0
  186. package/Materials/Textures/index.js +4 -0
  187. package/Materials/Textures/index.js.map +1 -1
  188. package/Materials/effect.d.ts +5 -0
  189. package/Materials/effect.js +15 -0
  190. package/Materials/effect.js.map +1 -1
  191. package/Materials/standardMaterial.d.ts +1 -2
  192. package/Materials/standardMaterial.js +0 -2
  193. package/Materials/standardMaterial.js.map +1 -1
  194. package/Meshes/Builders/planeBuilder.js +2 -2
  195. package/Meshes/Builders/planeBuilder.js.map +1 -1
  196. package/Meshes/Compression/dracoCodec.d.ts +4 -4
  197. package/Meshes/Compression/dracoCodec.js.map +1 -1
  198. package/Meshes/Compression/dracoCompression.d.ts +5 -3
  199. package/Meshes/Compression/dracoCompression.js +24 -11
  200. package/Meshes/Compression/dracoCompression.js.map +1 -1
  201. package/Meshes/Compression/dracoCompressionWorker.d.ts +16 -30
  202. package/Meshes/Compression/dracoCompressionWorker.js +128 -22
  203. package/Meshes/Compression/dracoCompressionWorker.js.map +1 -1
  204. package/Meshes/Compression/dracoDecoder.d.ts +4 -9
  205. package/Meshes/Compression/dracoDecoder.js +5 -5
  206. package/Meshes/Compression/dracoDecoder.js.map +1 -1
  207. package/Meshes/Compression/dracoDecoder.types.d.ts +52 -0
  208. package/Meshes/Compression/dracoDecoder.types.js +2 -0
  209. package/Meshes/Compression/dracoDecoder.types.js.map +1 -0
  210. package/Meshes/Compression/dracoEncoder.d.ts +95 -0
  211. package/Meshes/Compression/dracoEncoder.js +245 -0
  212. package/Meshes/Compression/dracoEncoder.js.map +1 -0
  213. package/Meshes/Compression/dracoEncoder.types.d.ts +82 -0
  214. package/Meshes/Compression/dracoEncoder.types.js +2 -0
  215. package/Meshes/Compression/dracoEncoder.types.js.map +1 -0
  216. package/Meshes/Compression/index.d.ts +1 -0
  217. package/Meshes/Compression/index.js +1 -0
  218. package/Meshes/Compression/index.js.map +1 -1
  219. package/Meshes/Compression/meshoptCompression.js +17 -2
  220. package/Meshes/Compression/meshoptCompression.js.map +1 -1
  221. package/Meshes/Compression/test/integration/draco.test.d.ts +1 -0
  222. package/Meshes/Compression/test/integration/draco.test.js +30 -0
  223. package/Meshes/Compression/test/integration/draco.test.js.map +1 -0
  224. package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +92 -2
  225. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +286 -10
  226. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  227. package/Meshes/GreasedLine/greasedLineBaseMesh.js +4 -2
  228. package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
  229. package/Meshes/GreasedLine/greasedLineRibbonMesh.js +1 -1
  230. package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
  231. package/Meshes/Node/Blocks/Textures/geometryTextureBlock.d.ts +1 -1
  232. package/Meshes/csg.js +4 -0
  233. package/Meshes/csg.js.map +1 -1
  234. package/Meshes/mesh.d.ts +2 -2
  235. package/Meshes/transformNode.d.ts +4 -1
  236. package/Meshes/transformNode.js +6 -1
  237. package/Meshes/transformNode.js.map +1 -1
  238. package/Misc/copyTextureToTexture.js +1 -1
  239. package/Misc/copyTextureToTexture.js.map +1 -1
  240. package/Misc/decorators.serialization.js +2 -0
  241. package/Misc/decorators.serialization.js.map +1 -1
  242. package/Misc/greasedLineTools.d.ts +1 -1
  243. package/Misc/logger.d.ts +2 -1
  244. package/Misc/logger.js +2 -1
  245. package/Misc/logger.js.map +1 -1
  246. package/Misc/screenshotTools.js +58 -5
  247. package/Misc/screenshotTools.js.map +1 -1
  248. package/Misc/tools.d.ts +21 -1
  249. package/Misc/tools.js +33 -0
  250. package/Misc/tools.js.map +1 -1
  251. package/Morph/morphTargetManager.d.ts +1 -0
  252. package/Morph/morphTargetManager.js +6 -1
  253. package/Morph/morphTargetManager.js.map +1 -1
  254. package/Particles/particleHelper.js +2 -1
  255. package/Particles/particleHelper.js.map +1 -1
  256. package/Particles/particleSystemSet.d.ts +1 -0
  257. package/Particles/particleSystemSet.js +1 -0
  258. package/Particles/particleSystemSet.js.map +1 -1
  259. package/Particles/pointsCloudSystem.d.ts +3 -3
  260. package/Particles/webgl2ParticleSystem.d.ts +1 -1
  261. package/Particles/webgl2ParticleSystem.js +1 -2
  262. package/Particles/webgl2ParticleSystem.js.map +1 -1
  263. package/Physics/v2/Plugins/havokPlugin.d.ts +2 -2
  264. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +2 -1
  265. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
  266. package/PostProcesses/index.d.ts +1 -0
  267. package/PostProcesses/index.js +1 -0
  268. package/PostProcesses/index.js.map +1 -1
  269. package/PostProcesses/passPostProcess.d.ts +2 -3
  270. package/PostProcesses/passPostProcess.js +36 -48
  271. package/PostProcesses/passPostProcess.js.map +1 -1
  272. package/PostProcesses/thinPassPostProcess.d.ts +48 -0
  273. package/PostProcesses/thinPassPostProcess.js +113 -0
  274. package/PostProcesses/thinPassPostProcess.js.map +1 -0
  275. package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js +1 -1
  276. package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js.map +1 -1
  277. package/Rendering/depthRenderer.js +1 -1
  278. package/Rendering/depthRenderer.js.map +1 -1
  279. package/Rendering/iblCdfGenerator.d.ts +13 -5
  280. package/Rendering/iblCdfGenerator.js +67 -10
  281. package/Rendering/iblCdfGenerator.js.map +1 -1
  282. package/Rendering/objectRenderer.d.ts +5 -3
  283. package/Rendering/objectRenderer.js +5 -3
  284. package/Rendering/objectRenderer.js.map +1 -1
  285. package/Rendering/renderingManager.d.ts +4 -0
  286. package/Rendering/renderingManager.js +1 -0
  287. package/Rendering/renderingManager.js.map +1 -1
  288. package/Shaders/ShadersInclude/gaussianSplatting.js +6 -6
  289. package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
  290. package/Shaders/ShadersInclude/intersectionFunctions.d.ts +5 -0
  291. package/Shaders/ShadersInclude/intersectionFunctions.js +14 -0
  292. package/Shaders/ShadersInclude/intersectionFunctions.js.map +1 -0
  293. package/Shaders/ShadersInclude/pbrBlockReflection.js +13 -8
  294. package/Shaders/ShadersInclude/pbrBlockReflection.js.map +1 -1
  295. package/Shaders/background.fragment.d.ts +1 -0
  296. package/Shaders/background.fragment.js +3 -5
  297. package/Shaders/background.fragment.js.map +1 -1
  298. package/Shaders/gaussianSplatting.vertex.js +2 -1
  299. package/Shaders/gaussianSplatting.vertex.js.map +1 -1
  300. package/Shaders/hdrIrradianceFiltering.fragment.d.ts +9 -0
  301. package/Shaders/hdrIrradianceFiltering.fragment.js +25 -0
  302. package/Shaders/hdrIrradianceFiltering.fragment.js.map +1 -0
  303. package/Shaders/hdrIrradianceFiltering.vertex.d.ts +5 -0
  304. package/Shaders/hdrIrradianceFiltering.vertex.js +15 -0
  305. package/Shaders/hdrIrradianceFiltering.vertex.js.map +1 -0
  306. package/Shaders/pbr.fragment.js +1 -3
  307. package/Shaders/pbr.fragment.js.map +1 -1
  308. package/ShadersWGSL/ShadersInclude/intersectionFunctions.d.ts +5 -0
  309. package/ShadersWGSL/ShadersInclude/intersectionFunctions.js +14 -0
  310. package/ShadersWGSL/ShadersInclude/intersectionFunctions.js.map +1 -0
  311. package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js +13 -8
  312. package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js.map +1 -1
  313. package/ShadersWGSL/background.fragment.d.ts +1 -0
  314. package/ShadersWGSL/background.fragment.js +3 -5
  315. package/ShadersWGSL/background.fragment.js.map +1 -1
  316. package/ShadersWGSL/greasedLine.fragment.js +9 -3
  317. package/ShadersWGSL/greasedLine.fragment.js.map +1 -1
  318. package/ShadersWGSL/greasedLine.vertex.js +12 -2
  319. package/ShadersWGSL/greasedLine.vertex.js.map +1 -1
  320. package/ShadersWGSL/hdrIrradianceFiltering.fragment.d.ts +9 -0
  321. package/ShadersWGSL/hdrIrradianceFiltering.fragment.js +26 -0
  322. package/ShadersWGSL/hdrIrradianceFiltering.fragment.js.map +1 -0
  323. package/ShadersWGSL/hdrIrradianceFiltering.vertex.d.ts +5 -0
  324. package/ShadersWGSL/hdrIrradianceFiltering.vertex.js +16 -0
  325. package/ShadersWGSL/hdrIrradianceFiltering.vertex.js.map +1 -0
  326. package/ShadersWGSL/outline.fragment.js +1 -1
  327. package/ShadersWGSL/outline.fragment.js.map +1 -1
  328. package/ShadersWGSL/passCube.fragment.js +1 -1
  329. package/ShadersWGSL/passCube.fragment.js.map +1 -1
  330. package/ShadersWGSL/pbr.fragment.js +1 -3
  331. package/ShadersWGSL/pbr.fragment.js.map +1 -1
  332. package/XR/features/WebXRDepthSensing.d.ts +24 -2
  333. package/XR/features/WebXRDepthSensing.js +320 -26
  334. package/XR/features/WebXRDepthSensing.js.map +1 -1
  335. package/XR/features/WebXRHandTracking.js +8 -7
  336. package/XR/features/WebXRHandTracking.js.map +1 -1
  337. package/package.json +1 -1
  338. package/scene.js +9 -5
  339. package/scene.js.map +1 -1
  340. package/types.d.ts +4 -0
  341. package/types.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"blurPost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/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QACxC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;QACxD,IAAI,CAAC,MAAM,GAAG,mBAAmB,CAAC,MAAM,CAAC;QACzC,IAAI,CAAC,kBAAkB,GAAG,mBAAmB,CAAC,kBAAkB,CAAC;IACrE,CAAC;CACJ;AAxFG;IADC,sBAAsB,CAAC,sBAAsB,+CAAuC,YAAY,CAAC;6EAGjG;AAQD;IADC,sBAAsB,CAAC,WAAW,0CAAkC,YAAY,CAAC;oEAGjF;AAQD;IADC,sBAAsB,CAAC,QAAQ,sCAA8B,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;iEAGhG;AAoEL,aAAa,CAAC,6CAA6C,EAAE,mCAAmC,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraphTextureHandle, FrameGraph } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphBlurTask } from \"core/FrameGraph/Tasks/PostProcesses/blurTask\";\r\nimport { ThinBlurPostProcess } from \"core/PostProcesses/thinBlurPostProcess\";\r\nimport { Vector2 } from \"core/Maths/math.vector\";\r\n\r\n/**\r\n * Block that implements the blur post process\r\n */\r\nexport class NodeRenderGraphBlurPostProcessBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphBlurTask;\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 NodeRenderGraphBlurPostProcessBlock\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 */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene) {\r\n super(name, frameGraph, scene);\r\n\r\n this.registerInput(\"source\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this._addDependenciesInput();\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\r\n this.output._typeConnectionSource = () => {\r\n return this.destination.isConnected ? this.destination : this.source;\r\n };\r\n\r\n this._frameGraphTask = new FrameGraphBlurTask(this.name, frameGraph, new ThinBlurPostProcess(name, scene.getEngine(), new Vector2(1, 0), 32));\r\n }\r\n\r\n /** Sampling mode used to sample from the source texture */\r\n @editableInPropertyPage(\"Source sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get sourceSamplingMode() {\r\n return this._frameGraphTask.sourceSamplingMode;\r\n }\r\n\r\n public set sourceSamplingMode(value: number) {\r\n this._frameGraphTask.sourceSamplingMode = value;\r\n }\r\n\r\n /** The direction in which to blur the image */\r\n @editableInPropertyPage(\"Direction\", PropertyTypeForEdition.Vector2, \"PROPERTIES\")\r\n public get direction(): Vector2 {\r\n return this._frameGraphTask.postProcess.direction;\r\n }\r\n\r\n public set direction(value: Vector2) {\r\n this._frameGraphTask.postProcess.direction = value;\r\n }\r\n\r\n /** Length in pixels of the blur sample region */\r\n @editableInPropertyPage(\"Kernel\", PropertyTypeForEdition.Int, \"PROPERTIES\", { min: 1, max: 256 })\r\n public get kernel(): number {\r\n return this._frameGraphTask.postProcess.kernel;\r\n }\r\n\r\n public set kernel(value: number) {\r\n this._frameGraphTask.postProcess.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 \"NodeRenderGraphBlurPostProcessBlock\";\r\n }\r\n\r\n /**\r\n * Gets the source input component\r\n */\r\n public get source(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the destination input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\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; // the value of the output connection point is the \"output\" texture of the task\r\n\r\n this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value as FrameGraphTextureHandle;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.direction = new BABYLON.Vector2(${this.direction.x}, ${this.direction.y});`);\r\n codes.push(`${this._codeVariableName}.kernel = ${this.kernel};`);\r\n codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);\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.direction = this.direction.asArray();\r\n serializationObject.kernel = this.kernel;\r\n serializationObject.sourceSamplingMode = this.sourceSamplingMode;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.direction.fromArray(serializationObject.direction);\r\n this.kernel = serializationObject.kernel;\r\n this.sourceSamplingMode = serializationObject.sourceSamplingMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphBlurPostProcessBlock\", NodeRenderGraphBlurPostProcessBlock);\r\n"]}
1
+ {"version":3,"file":"blurPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,kBAAkB,EAAE,iDAAqD;AAClF,OAAO,EAAE,mBAAmB,EAAE,yDAA+C;AAC7E,OAAO,EAAE,OAAO,EAAE,yCAA+B;AACjD,OAAO,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC;AAE7E;;GAEG;AACH,MAAM,OAAO,mCAAoC,SAAQ,mCAAmC;IAGxF;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;OAKG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,KAAY;QACjE,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAE/B,IAAI,CAAC,+BAA+B,EAAE,CAAC;QAEvC,IAAI,CAAC,eAAe,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,mBAAmB,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,EAAE,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAClJ,CAAC;IAED,+CAA+C;IAE/C,IAAW,SAAS;QAChB,OAAO,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,SAAS,CAAC;IACtD,CAAC;IAED,IAAW,SAAS,CAAC,KAAc;QAC/B,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,SAAS,G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;AAQD;IADC,sBAAsB,CAAC,QAAQ,sCAA8B,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;iEAGhG;AAmCL,aAAa,CAAC,6CAA6C,EAAE,mCAAmC,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 { FrameGraphBlurTask } from \"core/FrameGraph/Tasks/PostProcesses/blurTask\";\r\nimport { ThinBlurPostProcess } from \"core/PostProcesses/thinBlurPostProcess\";\r\nimport { Vector2 } from \"core/Maths/math.vector\";\r\nimport { NodeRenderGraphBasePostProcessBlock } from \"./basePostProcessBlock\";\r\n\r\n/**\r\n * Block that implements the blur post process\r\n */\r\nexport class NodeRenderGraphBlurPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {\r\n protected override _frameGraphTask: FrameGraphBlurTask;\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 NodeRenderGraphBlurPostProcessBlock\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 */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene) {\r\n super(name, frameGraph, scene);\r\n\r\n this._finalizeInputOutputRegistering();\r\n\r\n this._frameGraphTask = new FrameGraphBlurTask(this.name, frameGraph, new ThinBlurPostProcess(name, scene.getEngine(), new Vector2(1, 0), 32));\r\n }\r\n\r\n /** The direction in which to blur the image */\r\n @editableInPropertyPage(\"Direction\", PropertyTypeForEdition.Vector2, \"PROPERTIES\")\r\n public get direction(): Vector2 {\r\n return this._frameGraphTask.postProcess.direction;\r\n }\r\n\r\n public set direction(value: Vector2) {\r\n this._frameGraphTask.postProcess.direction = value;\r\n }\r\n\r\n /** Length in pixels of the blur sample region */\r\n @editableInPropertyPage(\"Kernel\", PropertyTypeForEdition.Int, \"PROPERTIES\", { min: 1, max: 256 })\r\n public get kernel(): number {\r\n return this._frameGraphTask.postProcess.kernel;\r\n }\r\n\r\n public set kernel(value: number) {\r\n this._frameGraphTask.postProcess.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 \"NodeRenderGraphBlurPostProcessBlock\";\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.direction = new BABYLON.Vector2(${this.direction.x}, ${this.direction.y});`);\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.direction = this.direction.asArray();\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.direction.fromArray(serializationObject.direction);\r\n this.kernel = serializationObject.kernel;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphBlurPostProcessBlock\", NodeRenderGraphBlurPostProcessBlock);\r\n"]}
@@ -1,10 +1,10 @@
1
1
  import type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraph } from "../../../../index.js";
2
- import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock";
3
2
  import { FrameGraphCircleOfConfusionTask } from "../../../Tasks/PostProcesses/circleOfConfusionTask.js";
3
+ import { NodeRenderGraphBasePostProcessBlock } from "./basePostProcessBlock";
4
4
  /**
5
5
  * Block that implements the circle of confusion post process
6
6
  */
7
- export declare class NodeRenderGraphCircleOfConfusionPostProcessBlock extends NodeRenderGraphBlock {
7
+ export declare class NodeRenderGraphCircleOfConfusionPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {
8
8
  protected _frameGraphTask: FrameGraphCircleOfConfusionTask;
9
9
  /**
10
10
  * Gets the frame graph task associated with this block
@@ -17,9 +17,6 @@ export declare class NodeRenderGraphCircleOfConfusionPostProcessBlock extends No
17
17
  * @param scene defines the hosting scene
18
18
  */
19
19
  constructor(name: string, frameGraph: FrameGraph, scene: Scene);
20
- /** Sampling mode used to sample from the source texture */
21
- get sourceSamplingMode(): number;
22
- set sourceSamplingMode(value: number);
23
20
  /** Sampling mode used to sample from the depth texture */
24
21
  get depthSamplingMode(): number;
25
22
  set depthSamplingMode(value: number);
@@ -40,26 +37,14 @@ export declare class NodeRenderGraphCircleOfConfusionPostProcessBlock extends No
40
37
  * @returns the class name
41
38
  */
42
39
  getClassName(): string;
43
- /**
44
- * Gets the source input component
45
- */
46
- get source(): NodeRenderGraphConnectionPoint;
47
40
  /**
48
41
  * Gets the geometry view depth input component
49
42
  */
50
43
  get geomViewDepth(): NodeRenderGraphConnectionPoint;
51
- /**
52
- * Gets the destination input component
53
- */
54
- get destination(): NodeRenderGraphConnectionPoint;
55
44
  /**
56
45
  * Gets the camera input component
57
46
  */
58
47
  get camera(): NodeRenderGraphConnectionPoint;
59
- /**
60
- * Gets the output component
61
- */
62
- get output(): NodeRenderGraphConnectionPoint;
63
48
  protected _buildBlock(state: NodeRenderGraphBuildState): void;
64
49
  protected _dumpPropertiesCode(): string;
65
50
  serialize(): any;
@@ -1,14 +1,14 @@
1
1
  import { __decorate } from "../../../../tslib.es6.js";
2
- import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock.js";
3
2
  import { RegisterClass } from "../../../../Misc/typeStore.js";
4
3
  import { NodeRenderGraphBlockConnectionPointTypes } from "../../Types/nodeRenderGraphTypes.js";
5
4
  import { editableInPropertyPage } from "../../../../Decorators/nodeDecorator.js";
6
5
  import { FrameGraphCircleOfConfusionTask } from "../../../Tasks/PostProcesses/circleOfConfusionTask.js";
7
6
  import { ThinCircleOfConfusionPostProcess } from "../../../../PostProcesses/thinCircleOfConfusionPostProcess.js";
7
+ import { NodeRenderGraphBasePostProcessBlock } from "./basePostProcessBlock.js";
8
8
  /**
9
9
  * Block that implements the circle of confusion post process
10
10
  */
11
- export class NodeRenderGraphCircleOfConfusionPostProcessBlock extends NodeRenderGraphBlock {
11
+ export class NodeRenderGraphCircleOfConfusionPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {
12
12
  /**
13
13
  * Gets the frame graph task associated with this block
14
14
  */
@@ -23,26 +23,11 @@ export class NodeRenderGraphCircleOfConfusionPostProcessBlock extends NodeRender
23
23
  */
24
24
  constructor(name, frameGraph, scene) {
25
25
  super(name, frameGraph, scene);
26
- this.registerInput("source", NodeRenderGraphBlockConnectionPointTypes.Texture);
27
26
  this.registerInput("geomViewDepth", NodeRenderGraphBlockConnectionPointTypes.TextureViewDepth);
28
- this.registerInput("destination", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
29
27
  this.registerInput("camera", NodeRenderGraphBlockConnectionPointTypes.Camera);
30
- this._addDependenciesInput();
31
- this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
32
- this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
33
- this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);
34
- this.output._typeConnectionSource = () => {
35
- return this.destination.isConnected ? this.destination : this.source;
36
- };
28
+ this._finalizeInputOutputRegistering();
37
29
  this._frameGraphTask = new FrameGraphCircleOfConfusionTask(this.name, frameGraph, new ThinCircleOfConfusionPostProcess(name, scene.getEngine(), { depthNotNormalized: true }));
38
30
  }
39
- /** Sampling mode used to sample from the source texture */
40
- get sourceSamplingMode() {
41
- return this._frameGraphTask.sourceSamplingMode;
42
- }
43
- set sourceSamplingMode(value) {
44
- this._frameGraphTask.sourceSamplingMode = value;
45
- }
46
31
  /** Sampling mode used to sample from the depth texture */
47
32
  get depthSamplingMode() {
48
33
  return this._frameGraphTask.depthSamplingMode;
@@ -85,22 +70,10 @@ export class NodeRenderGraphCircleOfConfusionPostProcessBlock extends NodeRender
85
70
  getClassName() {
86
71
  return "NodeRenderGraphCircleOfConfusionPostProcessBlock";
87
72
  }
88
- /**
89
- * Gets the source input component
90
- */
91
- get source() {
92
- return this._inputs[0];
93
- }
94
73
  /**
95
74
  * Gets the geometry view depth input component
96
75
  */
97
76
  get geomViewDepth() {
98
- return this._inputs[1];
99
- }
100
- /**
101
- * Gets the destination input component
102
- */
103
- get destination() {
104
77
  return this._inputs[2];
105
78
  }
106
79
  /**
@@ -109,18 +82,9 @@ export class NodeRenderGraphCircleOfConfusionPostProcessBlock extends NodeRender
109
82
  get camera() {
110
83
  return this._inputs[3];
111
84
  }
112
- /**
113
- * Gets the output component
114
- */
115
- get output() {
116
- return this._outputs[0];
117
- }
118
85
  _buildBlock(state) {
119
86
  super._buildBlock(state);
120
- this.output.value = this._frameGraphTask.outputTexture;
121
- this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value;
122
87
  this._frameGraphTask.depthTexture = this.geomViewDepth.connectedPoint?.value;
123
- this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value;
124
88
  this._frameGraphTask.camera = this.camera.connectedPoint?.value;
125
89
  }
126
90
  _dumpPropertiesCode() {
@@ -129,7 +93,6 @@ export class NodeRenderGraphCircleOfConfusionPostProcessBlock extends NodeRender
129
93
  codes.push(`${this._codeVariableName}.fStop = ${this.fStop};`);
130
94
  codes.push(`${this._codeVariableName}.focusDistance = ${this.focusDistance};`);
131
95
  codes.push(`${this._codeVariableName}.focalLength = ${this.focalLength};`);
132
- codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);
133
96
  codes.push(`${this._codeVariableName}.depthSamplingMode = ${this.depthSamplingMode};`);
134
97
  return super._dumpPropertiesCode() + codes.join("\n");
135
98
  }
@@ -139,7 +102,6 @@ export class NodeRenderGraphCircleOfConfusionPostProcessBlock extends NodeRender
139
102
  serializationObject.fStop = this.fStop;
140
103
  serializationObject.focusDistance = this.focusDistance;
141
104
  serializationObject.focalLength = this.focalLength;
142
- serializationObject.sourceSamplingMode = this.sourceSamplingMode;
143
105
  serializationObject.depthSamplingMode = this.depthSamplingMode;
144
106
  return serializationObject;
145
107
  }
@@ -149,13 +111,9 @@ export class NodeRenderGraphCircleOfConfusionPostProcessBlock extends NodeRender
149
111
  this.fStop = serializationObject.fStop;
150
112
  this.focusDistance = serializationObject.focusDistance;
151
113
  this.focalLength = serializationObject.focalLength;
152
- this.sourceSamplingMode = serializationObject.sourceSamplingMode;
153
114
  this.depthSamplingMode = serializationObject.depthSamplingMode;
154
115
  }
155
116
  }
156
- __decorate([
157
- editableInPropertyPage("Source sampling mode", 6 /* PropertyTypeForEdition.SamplingMode */, "PROPERTIES")
158
- ], NodeRenderGraphCircleOfConfusionPostProcessBlock.prototype, "sourceSamplingMode", null);
159
117
  __decorate([
160
118
  editableInPropertyPage("Depth sampling mode", 6 /* PropertyTypeForEdition.SamplingMode */, "PROPERTIES")
161
119
  ], NodeRenderGraphCircleOfConfusionPostProcessBlock.prototype, "depthSamplingMode", null);
@@ -1 +1 @@
1
- {"version":3,"file":"circleOfConfusionPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,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,+BAA+B,EAAE,8DAAkE;AAC5G,OAAO,EAAE,gCAAgC,EAAE,sEAA4D;AAEvG;;GAEG;AACH,MAAM,OAAO,gDAAiD,SAAQ,oBAAoB;IAGtF;;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KAAK,CAAC;QACvC,IAAI,CAAC,aAAa,GAAG,mBAAmB,CAAC,aAAa,CAAC;QACvD,IAAI,CAAC,WAAW,GAAG,mBAAmB,CAAC,WAAW,CAAC;QACnD,IAAI,CAAC,kBAAkB,GAAG,mBAAmB,CAAC,kBAAkB,CAAC;QACjE,IAAI,CAAC,iBAAiB,GAAG,mBAAmB,CAAC,iBAAiB,CAAC;IACnE,CAAC;CACJ;AA/IG;IADC,sBAAsB,CAAC,sBAAsB,+CAAuC,YAAY,CAAC;0FAGjG;AAQD;IADC,sBAAsB,CAAC,qBAAqB,+CAAuC,YAAY,CAAC;yFAGhG;AAQD;IADC,sBAAsB,CAAC,WAAW,wCAAgC,YAAY,CAAC;gFAG/E;AAQD;IADC,sBAAsB,CAAC,QAAQ,wCAAgC,YAAY,CAAC;6EAG5E;AAQD;IADC,sBAAsB,CAAC,gBAAgB,wCAAgC,YAAY,CAAC;qFAGpF;AAQD;IADC,sBAAsB,CAAC,cAAc,wCAAgC,YAAY,CAAC;mFAGlF;AA6FL,aAAa,CAAC,0DAA0D,EAAE,gDAAgD,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 { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphCircleOfConfusionTask } from \"core/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask\";\r\nimport { ThinCircleOfConfusionPostProcess } from \"core/PostProcesses/thinCircleOfConfusionPostProcess\";\r\n\r\n/**\r\n * Block that implements the circle of confusion post process\r\n */\r\nexport class NodeRenderGraphCircleOfConfusionPostProcessBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphCircleOfConfusionTask;\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 NodeRenderGraphCircleOfConfusionPostProcessBlock\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 */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene) {\r\n super(name, frameGraph, scene);\r\n\r\n this.registerInput(\"source\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"geomViewDepth\", NodeRenderGraphBlockConnectionPointTypes.TextureViewDepth);\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this.registerInput(\"camera\", NodeRenderGraphBlockConnectionPointTypes.Camera);\r\n this._addDependenciesInput();\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\r\n this.output._typeConnectionSource = () => {\r\n return this.destination.isConnected ? this.destination : this.source;\r\n };\r\n\r\n this._frameGraphTask = new FrameGraphCircleOfConfusionTask(\r\n this.name,\r\n frameGraph,\r\n new ThinCircleOfConfusionPostProcess(name, scene.getEngine(), { depthNotNormalized: true })\r\n );\r\n }\r\n\r\n /** Sampling mode used to sample from the source texture */\r\n @editableInPropertyPage(\"Source sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get sourceSamplingMode() {\r\n return this._frameGraphTask.sourceSamplingMode;\r\n }\r\n\r\n public set sourceSamplingMode(value: number) {\r\n this._frameGraphTask.sourceSamplingMode = 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 /** 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.postProcess.lensSize;\r\n }\r\n\r\n public set lensSize(value: number) {\r\n this._frameGraphTask.postProcess.lensSize = 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.postProcess.fStop;\r\n }\r\n\r\n public set fStop(value: number) {\r\n this._frameGraphTask.postProcess.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.postProcess.focusDistance;\r\n }\r\n\r\n public set focusDistance(value: number) {\r\n this._frameGraphTask.postProcess.focusDistance = value;\r\n }\r\n\r\n /** Focal length of the effect's camera 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.postProcess.focalLength;\r\n }\r\n\r\n public set focalLength(value: number) {\r\n this._frameGraphTask.postProcess.focalLength = 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 \"NodeRenderGraphCircleOfConfusionPostProcessBlock\";\r\n }\r\n\r\n /**\r\n * Gets the source input component\r\n */\r\n public get source(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\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[1];\r\n }\r\n\r\n /**\r\n * Gets the destination input component\r\n */\r\n public get destination(): 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 /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\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.sourceTexture = this.source.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.depthTexture = this.geomViewDepth.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.destinationTexture = this.destination.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}.sourceSamplingMode = ${this.sourceSamplingMode};`);\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.sourceSamplingMode = this.sourceSamplingMode;\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.sourceSamplingMode = serializationObject.sourceSamplingMode;\r\n this.depthSamplingMode = serializationObject.depthSamplingMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphCircleOfConfusionPostProcessBlock\", NodeRenderGraphCircleOfConfusionPostProcessBlock);\r\n"]}
1
+ {"version":3,"file":"circleOfConfusionPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.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,+BAA+B,EAAE,8DAAkE;AAC5G,OAAO,EAAE,gCAAgC,EAAE,sEAA4D;AACvG,OAAO,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC;AAE7E;;GAEG;AACH,MAAM,OAAO,gDAAiD,SAAQ,mCAAmC;IAGrG;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;OAKG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,KAAY;QACjE,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAE/B,IAAI,CAAC,aAAa,CAAC,eAAe,EAAE,wCAAwC,CA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Aa,CAAC,0DAA0D,EAAE,gDAAgD,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 { FrameGraphCircleOfConfusionTask } from \"core/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask\";\r\nimport { ThinCircleOfConfusionPostProcess } from \"core/PostProcesses/thinCircleOfConfusionPostProcess\";\r\nimport { NodeRenderGraphBasePostProcessBlock } from \"./basePostProcessBlock\";\r\n\r\n/**\r\n * Block that implements the circle of confusion post process\r\n */\r\nexport class NodeRenderGraphCircleOfConfusionPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {\r\n protected override _frameGraphTask: FrameGraphCircleOfConfusionTask;\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 NodeRenderGraphCircleOfConfusionPostProcessBlock\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 */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene) {\r\n super(name, frameGraph, scene);\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 FrameGraphCircleOfConfusionTask(\r\n this.name,\r\n frameGraph,\r\n new ThinCircleOfConfusionPostProcess(name, scene.getEngine(), { depthNotNormalized: true })\r\n );\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 /** 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.postProcess.lensSize;\r\n }\r\n\r\n public set lensSize(value: number) {\r\n this._frameGraphTask.postProcess.lensSize = 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.postProcess.fStop;\r\n }\r\n\r\n public set fStop(value: number) {\r\n this._frameGraphTask.postProcess.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.postProcess.focusDistance;\r\n }\r\n\r\n public set focusDistance(value: number) {\r\n this._frameGraphTask.postProcess.focusDistance = value;\r\n }\r\n\r\n /** Focal length of the effect's camera 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.postProcess.focalLength;\r\n }\r\n\r\n public set focalLength(value: number) {\r\n this._frameGraphTask.postProcess.focalLength = 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 \"NodeRenderGraphCircleOfConfusionPostProcessBlock\";\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._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.NodeRenderGraphCircleOfConfusionPostProcessBlock\", NodeRenderGraphCircleOfConfusionPostProcessBlock);\r\n"]}
@@ -1,11 +1,11 @@
1
1
  import type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraph } from "../../../../index.js";
2
- import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock";
3
2
  import { FrameGraphDepthOfFieldTask } from "../../../Tasks/PostProcesses/depthOfFieldTask";
4
3
  import { ThinDepthOfFieldEffectBlurLevel } from "../../../../PostProcesses/thinDepthOfFieldEffect.js";
4
+ import { NodeRenderGraphBasePostProcessBlock } from "./basePostProcessBlock";
5
5
  /**
6
6
  * Block that implements the depth of field post process
7
7
  */
8
- export declare class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRenderGraphBlock {
8
+ export declare class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {
9
9
  protected _frameGraphTask: FrameGraphDepthOfFieldTask;
10
10
  /**
11
11
  * Gets the frame graph task associated with this block
@@ -27,9 +27,6 @@ export declare class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRen
27
27
  /** If high dynamic range textures should be used */
28
28
  get hdr(): boolean;
29
29
  set hdr(value: boolean);
30
- /** Sampling mode used to sample from the source texture */
31
- get sourceSamplingMode(): number;
32
- set sourceSamplingMode(value: number);
33
30
  /** Sampling mode used to sample from the depth texture */
34
31
  get depthSamplingMode(): number;
35
32
  set depthSamplingMode(value: number);
@@ -50,26 +47,14 @@ export declare class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRen
50
47
  * @returns the class name
51
48
  */
52
49
  getClassName(): string;
53
- /**
54
- * Gets the source input component
55
- */
56
- get source(): NodeRenderGraphConnectionPoint;
57
50
  /**
58
51
  * Gets the geometry view depth input component
59
52
  */
60
53
  get geomViewDepth(): NodeRenderGraphConnectionPoint;
61
- /**
62
- * Gets the destination input component
63
- */
64
- get destination(): NodeRenderGraphConnectionPoint;
65
54
  /**
66
55
  * Gets the camera input component
67
56
  */
68
57
  get camera(): NodeRenderGraphConnectionPoint;
69
- /**
70
- * Gets the output component
71
- */
72
- get output(): NodeRenderGraphConnectionPoint;
73
58
  protected _buildBlock(state: NodeRenderGraphBuildState): void;
74
59
  protected _dumpPropertiesCode(): string;
75
60
  serialize(): any;
@@ -1,13 +1,13 @@
1
1
  import { __decorate } from "../../../../tslib.es6.js";
2
- import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock.js";
3
2
  import { RegisterClass } from "../../../../Misc/typeStore.js";
4
3
  import { NodeRenderGraphBlockConnectionPointTypes } from "../../Types/nodeRenderGraphTypes.js";
5
4
  import { editableInPropertyPage } from "../../../../Decorators/nodeDecorator.js";
6
5
  import { FrameGraphDepthOfFieldTask } from "../../../Tasks/PostProcesses/depthOfFieldTask.js";
6
+ import { NodeRenderGraphBasePostProcessBlock } from "./basePostProcessBlock.js";
7
7
  /**
8
8
  * Block that implements the depth of field post process
9
9
  */
10
- export class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRenderGraphBlock {
10
+ export class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {
11
11
  /**
12
12
  * Gets the frame graph task associated with this block
13
13
  */
@@ -25,17 +25,9 @@ export class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRenderGraph
25
25
  constructor(name, frameGraph, scene, blurLevel = 0 /* ThinDepthOfFieldEffectBlurLevel.Low */, hdr = false) {
26
26
  super(name, frameGraph, scene);
27
27
  this._additionalConstructionParameters = [blurLevel, hdr];
28
- this.registerInput("source", NodeRenderGraphBlockConnectionPointTypes.Texture);
29
28
  this.registerInput("geomViewDepth", NodeRenderGraphBlockConnectionPointTypes.TextureViewDepth);
30
- this.registerInput("destination", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
31
29
  this.registerInput("camera", NodeRenderGraphBlockConnectionPointTypes.Camera);
32
- this._addDependenciesInput();
33
- this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
34
- this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
35
- this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);
36
- this.output._typeConnectionSource = () => {
37
- return this.destination.isConnected ? this.destination : this.source;
38
- };
30
+ this._finalizeInputOutputRegistering();
39
31
  this._frameGraphTask = new FrameGraphDepthOfFieldTask(this.name, frameGraph, scene.getEngine(), blurLevel, hdr);
40
32
  }
41
33
  _createTask(blurLevel, hdr) {
@@ -69,13 +61,6 @@ export class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRenderGraph
69
61
  set hdr(value) {
70
62
  this._createTask(this._frameGraphTask.depthOfField.blurLevel, value);
71
63
  }
72
- /** Sampling mode used to sample from the source texture */
73
- get sourceSamplingMode() {
74
- return this._frameGraphTask.sourceSamplingMode;
75
- }
76
- set sourceSamplingMode(value) {
77
- this._frameGraphTask.sourceSamplingMode = value;
78
- }
79
64
  /** Sampling mode used to sample from the depth texture */
80
65
  get depthSamplingMode() {
81
66
  return this._frameGraphTask.depthSamplingMode;
@@ -118,22 +103,10 @@ export class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRenderGraph
118
103
  getClassName() {
119
104
  return "NodeRenderGraphDepthOfFieldPostProcessBlock";
120
105
  }
121
- /**
122
- * Gets the source input component
123
- */
124
- get source() {
125
- return this._inputs[0];
126
- }
127
106
  /**
128
107
  * Gets the geometry view depth input component
129
108
  */
130
109
  get geomViewDepth() {
131
- return this._inputs[1];
132
- }
133
- /**
134
- * Gets the destination input component
135
- */
136
- get destination() {
137
110
  return this._inputs[2];
138
111
  }
139
112
  /**
@@ -142,18 +115,10 @@ export class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRenderGraph
142
115
  get camera() {
143
116
  return this._inputs[3];
144
117
  }
145
- /**
146
- * Gets the output component
147
- */
148
- get output() {
149
- return this._outputs[0];
150
- }
151
118
  _buildBlock(state) {
152
119
  super._buildBlock(state);
153
120
  this.output.value = this._frameGraphTask.outputTexture;
154
- this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value;
155
121
  this._frameGraphTask.depthTexture = this.geomViewDepth.connectedPoint?.value;
156
- this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value;
157
122
  this._frameGraphTask.camera = this.camera.connectedPoint?.value;
158
123
  }
159
124
  _dumpPropertiesCode() {
@@ -162,7 +127,6 @@ export class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRenderGraph
162
127
  codes.push(`${this._codeVariableName}.fStop = ${this.fStop};`);
163
128
  codes.push(`${this._codeVariableName}.focusDistance = ${this.focusDistance};`);
164
129
  codes.push(`${this._codeVariableName}.focalLength = ${this.focalLength};`);
165
- codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);
166
130
  codes.push(`${this._codeVariableName}.depthSamplingMode = ${this.depthSamplingMode};`);
167
131
  return super._dumpPropertiesCode() + codes.join("\n");
168
132
  }
@@ -172,7 +136,6 @@ export class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRenderGraph
172
136
  serializationObject.fStop = this.fStop;
173
137
  serializationObject.focusDistance = this.focusDistance;
174
138
  serializationObject.focalLength = this.focalLength;
175
- serializationObject.sourceSamplingMode = this.sourceSamplingMode;
176
139
  serializationObject.depthSamplingMode = this.depthSamplingMode;
177
140
  return serializationObject;
178
141
  }
@@ -182,7 +145,6 @@ export class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRenderGraph
182
145
  this.fStop = serializationObject.fStop;
183
146
  this.focusDistance = serializationObject.focusDistance;
184
147
  this.focalLength = serializationObject.focalLength;
185
- this.sourceSamplingMode = serializationObject.sourceSamplingMode;
186
148
  this.depthSamplingMode = serializationObject.depthSamplingMode;
187
149
  }
188
150
  }
@@ -198,9 +160,6 @@ __decorate([
198
160
  __decorate([
199
161
  editableInPropertyPage("HDR", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
200
162
  ], NodeRenderGraphDepthOfFieldPostProcessBlock.prototype, "hdr", null);
201
- __decorate([
202
- editableInPropertyPage("Source sampling mode", 6 /* PropertyTypeForEdition.SamplingMode */, "PROPERTIES")
203
- ], NodeRenderGraphDepthOfFieldPostProcessBlock.prototype, "sourceSamplingMode", null);
204
163
  __decorate([
205
164
  editableInPropertyPage("Depth sampling mode", 6 /* PropertyTypeForEdition.SamplingMode */, "PROPERTIES")
206
165
  ], NodeRenderGraphDepthOfFieldPostProcessBlock.prototype, "depthSamplingMode", null);
@@ -1 +1 @@
1
- {"version":3,"file":"depthOfFieldPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,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;AAG3F;;GAEG;AACH,MAAM,OAAO,2CAA4C,SAAQ,oBAAoB;IAGjF;;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,QAAQ,EAAE,wCAAwC,CAAC,OAAO,CAAC,CAAC;QAC/E,IAAI,CAAC,aAAa,CAAC,eAAe,EAAE,wCAAwC,CAAC,gBAAgB,CAAC,CAAC;QAC/F,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,wCAAwC,CAAC,OAAO,EAAE,IAAI,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GAAG,mBAAmB,CAAC,WAAW,CAAC;QACnD,IAAI,CAAC,kBAAkB,GAAG,mBAAmB,CAAC,kBAAkB,CAAC;QACjE,IAAI,CAAC,iBAAiB,GAAG,mBAAmB,CAAC,iBAAiB,CAAC;IACnE,CAAC;CACJ;AAnKG;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,sBAAsB,+CAAuC,YAAY,CAAC;qFAGjG;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;AA6FL,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 { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\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\n\r\n/**\r\n * Block that implements the depth of field post process\r\n */\r\nexport class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRenderGraphBlock {\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(\"source\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"geomViewDepth\", NodeRenderGraphBlockConnectionPointTypes.TextureViewDepth);\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this.registerInput(\"camera\", NodeRenderGraphBlockConnectionPointTypes.Camera);\r\n this._addDependenciesInput();\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\r\n this.output._typeConnectionSource = () => {\r\n return this.destination.isConnected ? this.destination : this.source;\r\n };\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 source texture */\r\n @editableInPropertyPage(\"Source sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get sourceSamplingMode() {\r\n return this._frameGraphTask.sourceSamplingMode;\r\n }\r\n\r\n public set sourceSamplingMode(value: number) {\r\n this._frameGraphTask.sourceSamplingMode = 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 source input component\r\n */\r\n public get source(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\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[1];\r\n }\r\n\r\n /**\r\n * Gets the destination input component\r\n */\r\n public get destination(): 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 /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\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.sourceTexture = this.source.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.depthTexture = this.geomViewDepth.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.destinationTexture = this.destination.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}.sourceSamplingMode = ${this.sourceSamplingMode};`);\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.sourceSamplingMode = this.sourceSamplingMode;\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.sourceSamplingMode = serializationObject.sourceSamplingMode;\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,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C;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,10 +1,10 @@
1
- import type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraph } from "../../../../index.js";
2
- import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock";
1
+ import type { Scene, FrameGraph } from "../../../../index.js";
3
2
  import { FrameGraphExtractHighlightsTask } from "../../../Tasks/PostProcesses/extractHighlightsTask.js";
3
+ import { NodeRenderGraphBasePostProcessBlock } from "./basePostProcessBlock";
4
4
  /**
5
5
  * Block that implements the extract highlights post process
6
6
  */
7
- export declare class NodeRenderGraphExtractHighlightsPostProcessBlock extends NodeRenderGraphBlock {
7
+ export declare class NodeRenderGraphExtractHighlightsPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {
8
8
  protected _frameGraphTask: FrameGraphExtractHighlightsTask;
9
9
  /**
10
10
  * Gets the frame graph task associated with this block
@@ -17,9 +17,6 @@ export declare class NodeRenderGraphExtractHighlightsPostProcessBlock extends No
17
17
  * @param scene defines the hosting scene
18
18
  */
19
19
  constructor(name: string, frameGraph: FrameGraph, scene: Scene);
20
- /** Sampling mode used to sample from the source texture */
21
- get sourceSamplingMode(): number;
22
- set sourceSamplingMode(value: number);
23
20
  /** The luminance threshold, pixels below this value will be set to black. */
24
21
  get threshold(): number;
25
22
  set threshold(value: number);
@@ -28,19 +25,6 @@ export declare class NodeRenderGraphExtractHighlightsPostProcessBlock extends No
28
25
  * @returns the class name
29
26
  */
30
27
  getClassName(): string;
31
- /**
32
- * Gets the source input component
33
- */
34
- get source(): NodeRenderGraphConnectionPoint;
35
- /**
36
- * Gets the destination input component
37
- */
38
- get destination(): NodeRenderGraphConnectionPoint;
39
- /**
40
- * Gets the output component
41
- */
42
- get output(): NodeRenderGraphConnectionPoint;
43
- protected _buildBlock(state: NodeRenderGraphBuildState): void;
44
28
  protected _dumpPropertiesCode(): string;
45
29
  serialize(): any;
46
30
  _deserialize(serializationObject: any): void;