@babylonjs/core 7.31.2 → 7.32.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 (367) hide show
  1. package/Behaviors/Cameras/autoRotationBehavior.js +1 -0
  2. package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
  3. package/Cameras/camera.d.ts +5 -2
  4. package/Cameras/camera.js +1 -0
  5. package/Cameras/camera.js.map +1 -1
  6. package/Decorators/nodeDecorator.d.ts +9 -1
  7. package/Decorators/nodeDecorator.js +8 -0
  8. package/Decorators/nodeDecorator.js.map +1 -1
  9. package/Engines/Extensions/engine.multiRender.js +40 -53
  10. package/Engines/Extensions/engine.multiRender.js.map +1 -1
  11. package/Engines/Extensions/engine.renderTarget.js +20 -8
  12. package/Engines/Extensions/engine.renderTarget.js.map +1 -1
  13. package/Engines/WebGPU/Extensions/engine.debugging.js +16 -7
  14. package/Engines/WebGPU/Extensions/engine.debugging.js.map +1 -1
  15. package/Engines/WebGPU/Extensions/engine.multiRender.js +43 -44
  16. package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
  17. package/Engines/WebGPU/Extensions/engine.renderTarget.js +8 -6
  18. package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
  19. package/Engines/WebGPU/webgpuHardwareTexture.d.ts +3 -3
  20. package/Engines/WebGPU/webgpuHardwareTexture.js +12 -9
  21. package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
  22. package/Engines/WebGPU/webgpuTextureHelper.js +25 -19
  23. package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
  24. package/Engines/WebGPU/webgpuTextureManager.d.ts +1 -1
  25. package/Engines/WebGPU/webgpuTextureManager.js +5 -3
  26. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
  27. package/Engines/abstractEngine.d.ts +6 -1
  28. package/Engines/abstractEngine.js +2 -2
  29. package/Engines/abstractEngine.js.map +1 -1
  30. package/Engines/constants.d.ts +6 -1
  31. package/Engines/constants.js +6 -1
  32. package/Engines/constants.js.map +1 -1
  33. package/Engines/renderTargetWrapper.d.ts +7 -0
  34. package/Engines/renderTargetWrapper.js +15 -0
  35. package/Engines/renderTargetWrapper.js.map +1 -1
  36. package/Engines/webgpuEngine.d.ts +3 -1
  37. package/Engines/webgpuEngine.js +9 -8
  38. package/Engines/webgpuEngine.js.map +1 -1
  39. package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.d.ts +47 -0
  40. package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js +113 -0
  41. package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js.map +1 -0
  42. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.d.ts +62 -0
  43. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js +171 -0
  44. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js.map +1 -0
  45. package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.d.ts +51 -0
  46. package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js +127 -0
  47. package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js.map +1 -0
  48. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.d.ts +67 -0
  49. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js +187 -0
  50. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js.map +1 -0
  51. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.d.ts +77 -0
  52. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js +232 -0
  53. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js.map +1 -0
  54. package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.d.ts +47 -0
  55. package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js +113 -0
  56. package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js.map +1 -0
  57. package/FrameGraph/Node/Blocks/Rendering/cullObjectsBlock.d.ts +41 -0
  58. package/FrameGraph/Node/Blocks/Rendering/cullObjectsBlock.js +79 -0
  59. package/FrameGraph/Node/Blocks/Rendering/cullObjectsBlock.js.map +1 -0
  60. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.d.ts +119 -0
  61. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js +451 -0
  62. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js.map +1 -0
  63. package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.d.ts +63 -0
  64. package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js +154 -0
  65. package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js.map +1 -0
  66. package/FrameGraph/Node/Blocks/Teleport/teleportInBlock.d.ts +59 -0
  67. package/FrameGraph/Node/Blocks/Teleport/teleportInBlock.js +131 -0
  68. package/FrameGraph/Node/Blocks/Teleport/teleportInBlock.js.map +1 -0
  69. package/FrameGraph/Node/Blocks/Teleport/teleportOutBlock.d.ts +49 -0
  70. package/FrameGraph/Node/Blocks/Teleport/teleportOutBlock.js +107 -0
  71. package/FrameGraph/Node/Blocks/Teleport/teleportOutBlock.js.map +1 -0
  72. package/FrameGraph/Node/Blocks/Textures/clearBlock.d.ts +50 -0
  73. package/FrameGraph/Node/Blocks/Textures/clearBlock.js +125 -0
  74. package/FrameGraph/Node/Blocks/Textures/clearBlock.js.map +1 -0
  75. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.d.ts +38 -0
  76. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js +71 -0
  77. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js.map +1 -0
  78. package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.d.ts +34 -0
  79. package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js +59 -0
  80. package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js.map +1 -0
  81. package/FrameGraph/Node/Blocks/elbowBlock.d.ts +28 -0
  82. package/FrameGraph/Node/Blocks/elbowBlock.js +47 -0
  83. package/FrameGraph/Node/Blocks/elbowBlock.js.map +1 -0
  84. package/FrameGraph/Node/Blocks/index.d.ts +17 -0
  85. package/FrameGraph/Node/Blocks/index.js +18 -0
  86. package/FrameGraph/Node/Blocks/index.js.map +1 -0
  87. package/FrameGraph/Node/Blocks/inputBlock.d.ts +94 -0
  88. package/FrameGraph/Node/Blocks/inputBlock.js +270 -0
  89. package/FrameGraph/Node/Blocks/inputBlock.js.map +1 -0
  90. package/FrameGraph/Node/Blocks/outputBlock.d.ts +30 -0
  91. package/FrameGraph/Node/Blocks/outputBlock.js +51 -0
  92. package/FrameGraph/Node/Blocks/outputBlock.js.map +1 -0
  93. package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +110 -0
  94. package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +78 -0
  95. package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -0
  96. package/FrameGraph/Node/nodeRenderGraph.d.ts +196 -0
  97. package/FrameGraph/Node/nodeRenderGraph.js +614 -0
  98. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -0
  99. package/FrameGraph/Node/nodeRenderGraphBlock.d.ts +190 -0
  100. package/FrameGraph/Node/nodeRenderGraphBlock.js +495 -0
  101. package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -0
  102. package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.d.ts +143 -0
  103. package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js +275 -0
  104. package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js.map +1 -0
  105. package/FrameGraph/Node/nodeRenderGraphBuildState.d.ts +21 -0
  106. package/FrameGraph/Node/nodeRenderGraphBuildState.js +35 -0
  107. package/FrameGraph/Node/nodeRenderGraphBuildState.js.map +1 -0
  108. package/FrameGraph/Passes/cullPass.d.ts +28 -0
  109. package/FrameGraph/Passes/cullPass.js +38 -0
  110. package/FrameGraph/Passes/cullPass.js.map +1 -0
  111. package/FrameGraph/Passes/pass.d.ts +14 -0
  112. package/FrameGraph/Passes/pass.js +20 -0
  113. package/FrameGraph/Passes/pass.js.map +1 -0
  114. package/FrameGraph/Passes/renderPass.d.ts +49 -0
  115. package/FrameGraph/Passes/renderPass.js +72 -0
  116. package/FrameGraph/Passes/renderPass.js.map +1 -0
  117. package/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask.d.ts +16 -0
  118. package/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask.js +17 -0
  119. package/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask.js.map +1 -0
  120. package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.d.ts +12 -0
  121. package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js +21 -0
  122. package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js.map +1 -0
  123. package/FrameGraph/Tasks/PostProcesses/bloomTask.d.ts +54 -0
  124. package/FrameGraph/Tasks/PostProcesses/bloomTask.js +114 -0
  125. package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -0
  126. package/FrameGraph/Tasks/PostProcesses/blurTask.d.ts +17 -0
  127. package/FrameGraph/Tasks/PostProcesses/blurTask.js +24 -0
  128. package/FrameGraph/Tasks/PostProcesses/blurTask.js.map +1 -0
  129. package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.d.ts +30 -0
  130. package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js +35 -0
  131. package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js.map +1 -0
  132. package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.d.ts +12 -0
  133. package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js +26 -0
  134. package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js.map +1 -0
  135. package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.d.ts +12 -0
  136. package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js +29 -0
  137. package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js.map +1 -0
  138. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.d.ts +65 -0
  139. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js +134 -0
  140. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js.map +1 -0
  141. package/FrameGraph/Tasks/PostProcesses/extractHighlightsTask.d.ts +16 -0
  142. package/FrameGraph/Tasks/PostProcesses/extractHighlightsTask.js +17 -0
  143. package/FrameGraph/Tasks/PostProcesses/extractHighlightsTask.js.map +1 -0
  144. package/FrameGraph/Tasks/PostProcesses/postProcessTask.d.ts +41 -0
  145. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +64 -0
  146. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -0
  147. package/FrameGraph/Tasks/Rendering/cullObjectsTask.d.ts +28 -0
  148. package/FrameGraph/Tasks/Rendering/cullObjectsTask.js +52 -0
  149. package/FrameGraph/Tasks/Rendering/cullObjectsTask.js.map +1 -0
  150. package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +145 -0
  151. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +259 -0
  152. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -0
  153. package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +66 -0
  154. package/FrameGraph/Tasks/Rendering/objectRendererTask.js +127 -0
  155. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -0
  156. package/FrameGraph/Tasks/Texture/clearTextureTask.d.ts +34 -0
  157. package/FrameGraph/Tasks/Texture/clearTextureTask.js +42 -0
  158. package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -0
  159. package/FrameGraph/Tasks/Texture/copyToBackbufferColorTask.d.ts +12 -0
  160. package/FrameGraph/Tasks/Texture/copyToBackbufferColorTask.js +23 -0
  161. package/FrameGraph/Tasks/Texture/copyToBackbufferColorTask.js.map +1 -0
  162. package/FrameGraph/Tasks/Texture/copyToTextureTask.d.ts +26 -0
  163. package/FrameGraph/Tasks/Texture/copyToTextureTask.js +31 -0
  164. package/FrameGraph/Tasks/Texture/copyToTextureTask.js.map +1 -0
  165. package/FrameGraph/Tasks/Texture/generateMipMapsTask.d.ts +22 -0
  166. package/FrameGraph/Tasks/Texture/generateMipMapsTask.js +34 -0
  167. package/FrameGraph/Tasks/Texture/generateMipMapsTask.js.map +1 -0
  168. package/FrameGraph/frameGraph.d.ts +143 -0
  169. package/FrameGraph/frameGraph.js +275 -0
  170. package/FrameGraph/frameGraph.js.map +1 -0
  171. package/FrameGraph/frameGraphContext.d.ts +5 -0
  172. package/FrameGraph/frameGraphContext.js +6 -0
  173. package/FrameGraph/frameGraphContext.js.map +1 -0
  174. package/FrameGraph/frameGraphObjectList.d.ts +15 -0
  175. package/FrameGraph/frameGraphObjectList.js +7 -0
  176. package/FrameGraph/frameGraphObjectList.js.map +1 -0
  177. package/FrameGraph/frameGraphRenderContext.d.ts +110 -0
  178. package/FrameGraph/frameGraphRenderContext.js +237 -0
  179. package/FrameGraph/frameGraphRenderContext.js.map +1 -0
  180. package/FrameGraph/frameGraphTask.d.ts +49 -0
  181. package/FrameGraph/frameGraphTask.js +117 -0
  182. package/FrameGraph/frameGraphTask.js.map +1 -0
  183. package/FrameGraph/frameGraphTextureManager.d.ts +50 -0
  184. package/FrameGraph/frameGraphTextureManager.js +277 -0
  185. package/FrameGraph/frameGraphTextureManager.js.map +1 -0
  186. package/FrameGraph/frameGraphTypes.d.ts +59 -0
  187. package/FrameGraph/frameGraphTypes.js +9 -0
  188. package/FrameGraph/frameGraphTypes.js.map +1 -0
  189. package/FrameGraph/index.d.ts +28 -0
  190. package/FrameGraph/index.js +30 -0
  191. package/FrameGraph/index.js.map +1 -0
  192. package/Gamepads/gamepadSceneComponent.d.ts +0 -1
  193. package/Gamepads/gamepadSceneComponent.js +1 -7
  194. package/Gamepads/gamepadSceneComponent.js.map +1 -1
  195. package/Gizmos/boundingBoxGizmo.d.ts +7 -0
  196. package/Gizmos/boundingBoxGizmo.js +19 -6
  197. package/Gizmos/boundingBoxGizmo.js.map +1 -1
  198. package/Inputs/scene.inputManager.d.ts +3 -1
  199. package/Inputs/scene.inputManager.js +20 -8
  200. package/Inputs/scene.inputManager.js.map +1 -1
  201. package/Layers/layer.d.ts +1 -1
  202. package/Layers/layer.js +1 -1
  203. package/Layers/layer.js.map +1 -1
  204. package/Materials/PBR/pbrBaseMaterial.d.ts +4 -0
  205. package/Materials/PBR/pbrBaseMaterial.js +8 -0
  206. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  207. package/Materials/Textures/dynamicTexture.d.ts +32 -2
  208. package/Materials/Textures/dynamicTexture.js +13 -18
  209. package/Materials/Textures/dynamicTexture.js.map +1 -1
  210. package/Materials/Textures/index.d.ts +1 -0
  211. package/Materials/Textures/index.js +1 -0
  212. package/Materials/Textures/index.js.map +1 -1
  213. package/Materials/Textures/mirrorTexture.js +0 -6
  214. package/Materials/Textures/mirrorTexture.js.map +1 -1
  215. package/Materials/Textures/multiRenderTarget.d.ts +20 -8
  216. package/Materials/Textures/multiRenderTarget.js +2 -0
  217. package/Materials/Textures/multiRenderTarget.js.map +1 -1
  218. package/Materials/Textures/renderTargetTexture.d.ts +8 -1
  219. package/Materials/Textures/renderTargetTexture.js +28 -10
  220. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  221. package/Materials/Textures/textureCreationOptions.d.ts +20 -2
  222. package/Materials/Textures/textureCreationOptions.js +20 -1
  223. package/Materials/Textures/textureCreationOptions.js.map +1 -1
  224. package/Materials/effectRenderer.d.ts +132 -14
  225. package/Materials/effectRenderer.js +229 -33
  226. package/Materials/effectRenderer.js.map +1 -1
  227. package/Materials/index.d.ts +1 -0
  228. package/Materials/index.js +1 -0
  229. package/Materials/index.js.map +1 -1
  230. package/Materials/materialHelper.functions.js +2 -0
  231. package/Materials/materialHelper.functions.js.map +1 -1
  232. package/Materials/materialHelper.geometryrendering.d.ts +122 -0
  233. package/Materials/materialHelper.geometryrendering.js +259 -0
  234. package/Materials/materialHelper.geometryrendering.js.map +1 -0
  235. package/Materials/standardMaterial.d.ts +4 -0
  236. package/Materials/standardMaterial.js +8 -0
  237. package/Materials/standardMaterial.js.map +1 -1
  238. package/Maths/index.d.ts +1 -0
  239. package/Maths/index.js +1 -0
  240. package/Maths/index.js.map +1 -1
  241. package/Meshes/Builders/greasedLineBuilder.d.ts +1 -1
  242. package/Meshes/Node/Blocks/geometryOptimizeBlock.d.ts +22 -1
  243. package/Meshes/Node/Blocks/geometryOptimizeBlock.js +39 -0
  244. package/Meshes/Node/Blocks/geometryOptimizeBlock.js.map +1 -1
  245. package/Misc/copyTextureToTexture.d.ts +3 -2
  246. package/Misc/copyTextureToTexture.js +11 -5
  247. package/Misc/copyTextureToTexture.js.map +1 -1
  248. package/PostProcesses/blackAndWhitePostProcess.d.ts +5 -3
  249. package/PostProcesses/blackAndWhitePostProcess.js +24 -19
  250. package/PostProcesses/blackAndWhitePostProcess.js.map +1 -1
  251. package/PostProcesses/bloomEffect.d.ts +7 -5
  252. package/PostProcesses/bloomEffect.js +49 -23
  253. package/PostProcesses/bloomEffect.js.map +1 -1
  254. package/PostProcesses/bloomMergePostProcess.d.ts +5 -5
  255. package/PostProcesses/bloomMergePostProcess.js +28 -19
  256. package/PostProcesses/bloomMergePostProcess.js.map +1 -1
  257. package/PostProcesses/blurPostProcess.d.ts +7 -43
  258. package/PostProcesses/blurPostProcess.js +47 -185
  259. package/PostProcesses/blurPostProcess.js.map +1 -1
  260. package/PostProcesses/circleOfConfusionPostProcess.d.ts +13 -6
  261. package/PostProcesses/circleOfConfusionPostProcess.js +59 -38
  262. package/PostProcesses/circleOfConfusionPostProcess.js.map +1 -1
  263. package/PostProcesses/depthOfFieldBlurPostProcess.d.ts +2 -6
  264. package/PostProcesses/depthOfFieldBlurPostProcess.js +14 -11
  265. package/PostProcesses/depthOfFieldBlurPostProcess.js.map +1 -1
  266. package/PostProcesses/depthOfFieldEffect.d.ts +5 -2
  267. package/PostProcesses/depthOfFieldEffect.js +53 -45
  268. package/PostProcesses/depthOfFieldEffect.js.map +1 -1
  269. package/PostProcesses/depthOfFieldMergePostProcess.d.ts +0 -1
  270. package/PostProcesses/depthOfFieldMergePostProcess.js +18 -12
  271. package/PostProcesses/depthOfFieldMergePostProcess.js.map +1 -1
  272. package/PostProcesses/extractHighlightsPostProcess.d.ts +8 -4
  273. package/PostProcesses/extractHighlightsPostProcess.js +35 -22
  274. package/PostProcesses/extractHighlightsPostProcess.js.map +1 -1
  275. package/PostProcesses/index.d.ts +6 -0
  276. package/PostProcesses/index.js +6 -0
  277. package/PostProcesses/index.js.map +1 -1
  278. package/PostProcesses/postProcess.d.ts +15 -70
  279. package/PostProcesses/postProcess.js +80 -97
  280. package/PostProcesses/postProcess.js.map +1 -1
  281. package/PostProcesses/thinBlackAndWhitePostProcess.d.ts +28 -0
  282. package/PostProcesses/thinBlackAndWhitePostProcess.js +50 -0
  283. package/PostProcesses/thinBlackAndWhitePostProcess.js.map +1 -0
  284. package/PostProcesses/thinBloomEffect.d.ts +49 -0
  285. package/PostProcesses/thinBloomEffect.js +59 -0
  286. package/PostProcesses/thinBloomEffect.js.map +1 -0
  287. package/PostProcesses/thinBloomMergePostProcess.d.ts +15 -0
  288. package/PostProcesses/thinBloomMergePostProcess.js +38 -0
  289. package/PostProcesses/thinBloomMergePostProcess.js.map +1 -0
  290. package/PostProcesses/thinBlurPostProcess.d.ts +89 -0
  291. package/PostProcesses/thinBlurPostProcess.js +242 -0
  292. package/PostProcesses/thinBlurPostProcess.js.map +1 -0
  293. package/PostProcesses/thinCircleOfConfusionPostProcess.d.ts +62 -0
  294. package/PostProcesses/thinCircleOfConfusionPostProcess.js +81 -0
  295. package/PostProcesses/thinCircleOfConfusionPostProcess.js.map +1 -0
  296. package/PostProcesses/thinDepthOfFieldBlurPostProcess.d.ts +8 -0
  297. package/PostProcesses/thinDepthOfFieldBlurPostProcess.js +13 -0
  298. package/PostProcesses/thinDepthOfFieldBlurPostProcess.js.map +1 -0
  299. package/PostProcesses/thinDepthOfFieldEffect.d.ts +70 -0
  300. package/PostProcesses/thinDepthOfFieldEffect.js +115 -0
  301. package/PostProcesses/thinDepthOfFieldEffect.js.map +1 -0
  302. package/PostProcesses/thinDepthOfFieldMergePostProcess.d.ts +11 -0
  303. package/PostProcesses/thinDepthOfFieldMergePostProcess.js +30 -0
  304. package/PostProcesses/thinDepthOfFieldMergePostProcess.js.map +1 -0
  305. package/PostProcesses/thinExtractHighlightsPostProcess.d.ts +30 -0
  306. package/PostProcesses/thinExtractHighlightsPostProcess.js +55 -0
  307. package/PostProcesses/thinExtractHighlightsPostProcess.js.map +1 -0
  308. package/Rendering/depthPeelingRenderer.js +2 -2
  309. package/Rendering/depthPeelingRenderer.js.map +1 -1
  310. package/Rendering/fluidRenderer/fluidRenderingObject.js +4 -4
  311. package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
  312. package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js +1 -1
  313. package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js.map +1 -1
  314. package/Shaders/ShadersInclude/pbrBlockPrePass.d.ts +5 -0
  315. package/Shaders/ShadersInclude/pbrBlockPrePass.js +75 -0
  316. package/Shaders/ShadersInclude/pbrBlockPrePass.js.map +1 -0
  317. package/Shaders/ShadersInclude/prePassVertex.js +1 -2
  318. package/Shaders/ShadersInclude/prePassVertex.js.map +1 -1
  319. package/Shaders/circleOfConfusion.fragment.js +9 -1
  320. package/Shaders/circleOfConfusion.fragment.js.map +1 -1
  321. package/Shaders/colorCorrection.fragment.js +1 -0
  322. package/Shaders/colorCorrection.fragment.js.map +1 -1
  323. package/Shaders/default.fragment.js +17 -25
  324. package/Shaders/default.fragment.js.map +1 -1
  325. package/Shaders/default.vertex.js +4 -6
  326. package/Shaders/default.vertex.js.map +1 -1
  327. package/Shaders/pbr.fragment.d.ts +1 -0
  328. package/Shaders/pbr.fragment.js +2 -74
  329. package/Shaders/pbr.fragment.js.map +1 -1
  330. package/Shaders/pbr.vertex.js +3 -3
  331. package/Shaders/pbr.vertex.js.map +1 -1
  332. package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.d.ts +5 -0
  333. package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js +100 -0
  334. package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js.map +1 -0
  335. package/ShadersWGSL/ShadersInclude/prePassVertex.js +1 -2
  336. package/ShadersWGSL/ShadersInclude/prePassVertex.js.map +1 -1
  337. package/ShadersWGSL/background.vertex.js +1 -1
  338. package/ShadersWGSL/background.vertex.js.map +1 -1
  339. package/ShadersWGSL/circleOfConfusion.fragment.js +10 -2
  340. package/ShadersWGSL/circleOfConfusion.fragment.js.map +1 -1
  341. package/ShadersWGSL/default.fragment.js +20 -31
  342. package/ShadersWGSL/default.fragment.js.map +1 -1
  343. package/ShadersWGSL/default.vertex.js +4 -5
  344. package/ShadersWGSL/default.vertex.js.map +1 -1
  345. package/ShadersWGSL/glowMapGeneration.fragment.js +1 -1
  346. package/ShadersWGSL/glowMapGeneration.fragment.js.map +1 -1
  347. package/ShadersWGSL/glowMapGeneration.vertex.js +1 -1
  348. package/ShadersWGSL/glowMapGeneration.vertex.js.map +1 -1
  349. package/ShadersWGSL/pbr.fragment.d.ts +1 -0
  350. package/ShadersWGSL/pbr.fragment.js +2 -100
  351. package/ShadersWGSL/pbr.fragment.js.map +1 -1
  352. package/ShadersWGSL/pbr.vertex.js +4 -2
  353. package/ShadersWGSL/pbr.vertex.js.map +1 -1
  354. package/XR/features/WebXRRawCameraAccess.js +1 -1
  355. package/XR/features/WebXRRawCameraAccess.js.map +1 -1
  356. package/index.d.ts +1 -0
  357. package/index.js +1 -0
  358. package/index.js.map +1 -1
  359. package/package.json +1 -1
  360. package/scene.d.ts +19 -2
  361. package/scene.js +110 -13
  362. package/scene.js.map +1 -1
  363. package/sceneComponent.d.ts +0 -1
  364. package/sceneComponent.js +0 -1
  365. package/sceneComponent.js.map +1 -1
  366. package/types.d.ts +12 -0
  367. package/types.js.map +1 -1
@@ -0,0 +1,67 @@
1
+ import type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraph } from "../../../../index.js";
2
+ import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock";
3
+ import { FrameGraphCircleOfConfusionTask } from "../../../Tasks/PostProcesses/circleOfConfusionTask.js";
4
+ /**
5
+ * Block that implements the circle of confusion post process
6
+ */
7
+ export declare class NodeRenderGraphCircleOfConfusionPostProcessBlock extends NodeRenderGraphBlock {
8
+ protected _frameGraphTask: FrameGraphCircleOfConfusionTask;
9
+ /**
10
+ * Gets the frame graph task associated with this block
11
+ */
12
+ get task(): FrameGraphCircleOfConfusionTask;
13
+ /**
14
+ * Create a new NodeRenderGraphCircleOfConfusionPostProcessBlock
15
+ * @param name defines the block name
16
+ * @param frameGraph defines the hosting frame graph
17
+ * @param scene defines the hosting scene
18
+ */
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
+ /** Sampling mode used to sample from the depth texture */
24
+ get depthSamplingMode(): number;
25
+ set depthSamplingMode(value: number);
26
+ /** 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. */
27
+ get lensSize(): number;
28
+ set lensSize(value: number);
29
+ /** F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop */
30
+ get fStop(): number;
31
+ set fStop(value: number);
32
+ /** Distance away from the camera to focus on in scene units/1000 (eg. millimeter) */
33
+ get focusDistance(): number;
34
+ set focusDistance(value: number);
35
+ /** Focal length of the effect's camera in scene units/1000 (eg. millimeter) */
36
+ get focalLength(): number;
37
+ set focalLength(value: number);
38
+ /**
39
+ * Gets the current class name
40
+ * @returns the class name
41
+ */
42
+ getClassName(): string;
43
+ /**
44
+ * Gets the source input component
45
+ */
46
+ get source(): NodeRenderGraphConnectionPoint;
47
+ /**
48
+ * Gets the geometry view depth input component
49
+ */
50
+ get geomViewDepth(): NodeRenderGraphConnectionPoint;
51
+ /**
52
+ * Gets the destination input component
53
+ */
54
+ get destination(): NodeRenderGraphConnectionPoint;
55
+ /**
56
+ * Gets the camera input component
57
+ */
58
+ get camera(): NodeRenderGraphConnectionPoint;
59
+ /**
60
+ * Gets the output component
61
+ */
62
+ get output(): NodeRenderGraphConnectionPoint;
63
+ protected _buildBlock(state: NodeRenderGraphBuildState): void;
64
+ protected _dumpPropertiesCode(): string;
65
+ serialize(): any;
66
+ _deserialize(serializationObject: any): void;
67
+ }
@@ -0,0 +1,187 @@
1
+ import { __decorate } from "../../../../tslib.es6.js";
2
+ import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock.js";
3
+ import { RegisterClass } from "../../../../Misc/typeStore.js";
4
+ import { NodeRenderGraphBlockConnectionPointTypes } from "../../Types/nodeRenderGraphTypes.js";
5
+ import { editableInPropertyPage } from "../../../../Decorators/nodeDecorator.js";
6
+ import { FrameGraphCircleOfConfusionTask } from "../../../Tasks/PostProcesses/circleOfConfusionTask.js";
7
+ import { ThinCircleOfConfusionPostProcess } from "../../../../PostProcesses/thinCircleOfConfusionPostProcess.js";
8
+ /**
9
+ * Block that implements the circle of confusion post process
10
+ */
11
+ export class NodeRenderGraphCircleOfConfusionPostProcessBlock extends NodeRenderGraphBlock {
12
+ /**
13
+ * Gets the frame graph task associated with this block
14
+ */
15
+ get task() {
16
+ return this._frameGraphTask;
17
+ }
18
+ /**
19
+ * Create a new NodeRenderGraphCircleOfConfusionPostProcessBlock
20
+ * @param name defines the block name
21
+ * @param frameGraph defines the hosting frame graph
22
+ * @param scene defines the hosting scene
23
+ */
24
+ constructor(name, frameGraph, scene) {
25
+ super(name, frameGraph, scene);
26
+ this.registerInput("source", NodeRenderGraphBlockConnectionPointTypes.Texture);
27
+ this.registerInput("geomViewDepth", NodeRenderGraphBlockConnectionPointTypes.TextureViewDepth);
28
+ this.registerInput("destination", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
29
+ this.registerInput("camera", NodeRenderGraphBlockConnectionPointTypes.Camera);
30
+ this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
31
+ this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
32
+ this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);
33
+ this.output._typeConnectionSource = () => {
34
+ return this.destination.isConnected ? this.destination : this.source;
35
+ };
36
+ this._frameGraphTask = new FrameGraphCircleOfConfusionTask(this.name, frameGraph, new ThinCircleOfConfusionPostProcess(name, scene.getEngine(), { depthNotNormalized: true }));
37
+ }
38
+ /** Sampling mode used to sample from the source texture */
39
+ get sourceSamplingMode() {
40
+ return this._frameGraphTask.sourceSamplingMode;
41
+ }
42
+ set sourceSamplingMode(value) {
43
+ this._frameGraphTask.sourceSamplingMode = value;
44
+ }
45
+ /** Sampling mode used to sample from the depth texture */
46
+ get depthSamplingMode() {
47
+ return this._frameGraphTask.depthSamplingMode;
48
+ }
49
+ set depthSamplingMode(value) {
50
+ this._frameGraphTask.depthSamplingMode = value;
51
+ }
52
+ /** 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. */
53
+ get lensSize() {
54
+ return this._frameGraphTask.postProcess.lensSize;
55
+ }
56
+ set lensSize(value) {
57
+ this._frameGraphTask.postProcess.lensSize = value;
58
+ }
59
+ /** F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop */
60
+ get fStop() {
61
+ return this._frameGraphTask.postProcess.fStop;
62
+ }
63
+ set fStop(value) {
64
+ this._frameGraphTask.postProcess.fStop = value;
65
+ }
66
+ /** Distance away from the camera to focus on in scene units/1000 (eg. millimeter) */
67
+ get focusDistance() {
68
+ return this._frameGraphTask.postProcess.focusDistance;
69
+ }
70
+ set focusDistance(value) {
71
+ this._frameGraphTask.postProcess.focusDistance = value;
72
+ }
73
+ /** Focal length of the effect's camera in scene units/1000 (eg. millimeter) */
74
+ get focalLength() {
75
+ return this._frameGraphTask.postProcess.focalLength;
76
+ }
77
+ set focalLength(value) {
78
+ this._frameGraphTask.postProcess.focalLength = value;
79
+ }
80
+ /**
81
+ * Gets the current class name
82
+ * @returns the class name
83
+ */
84
+ getClassName() {
85
+ return "NodeRenderGraphCircleOfConfusionPostProcessBlock";
86
+ }
87
+ /**
88
+ * Gets the source input component
89
+ */
90
+ get source() {
91
+ return this._inputs[0];
92
+ }
93
+ /**
94
+ * Gets the geometry view depth input component
95
+ */
96
+ get geomViewDepth() {
97
+ return this._inputs[1];
98
+ }
99
+ /**
100
+ * Gets the destination input component
101
+ */
102
+ get destination() {
103
+ return this._inputs[2];
104
+ }
105
+ /**
106
+ * Gets the camera input component
107
+ */
108
+ get camera() {
109
+ return this._inputs[3];
110
+ }
111
+ /**
112
+ * Gets the output component
113
+ */
114
+ get output() {
115
+ return this._outputs[0];
116
+ }
117
+ _buildBlock(state) {
118
+ super._buildBlock(state);
119
+ this._frameGraphTask.name = this.name;
120
+ this.output.value = this._frameGraphTask.outputTexture;
121
+ const sourceConnectedPoint = this.source.connectedPoint;
122
+ if (sourceConnectedPoint) {
123
+ this._frameGraphTask.sourceTexture = sourceConnectedPoint.value;
124
+ }
125
+ const geomViewDepthConnectedPoint = this.geomViewDepth.connectedPoint;
126
+ if (geomViewDepthConnectedPoint) {
127
+ this._frameGraphTask.depthTexture = geomViewDepthConnectedPoint.value;
128
+ }
129
+ const destinationConnectedPoint = this.destination.connectedPoint;
130
+ if (destinationConnectedPoint) {
131
+ this._frameGraphTask.destinationTexture = destinationConnectedPoint.value;
132
+ }
133
+ const cameraConnectedPoint = this.camera.connectedPoint;
134
+ if (cameraConnectedPoint) {
135
+ this._frameGraphTask.camera = cameraConnectedPoint.value;
136
+ }
137
+ }
138
+ _dumpPropertiesCode() {
139
+ const codes = [];
140
+ codes.push(`${this._codeVariableName}.lensSize = ${this.lensSize};`);
141
+ codes.push(`${this._codeVariableName}.fStop = ${this.fStop};`);
142
+ codes.push(`${this._codeVariableName}.focusDistance = ${this.focusDistance};`);
143
+ codes.push(`${this._codeVariableName}.focalLength = ${this.focalLength};`);
144
+ codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);
145
+ codes.push(`${this._codeVariableName}.depthSamplingMode = ${this.depthSamplingMode};`);
146
+ return super._dumpPropertiesCode() + codes.join("\n");
147
+ }
148
+ serialize() {
149
+ const serializationObject = super.serialize();
150
+ serializationObject.lensSize = this.lensSize;
151
+ serializationObject.fStop = this.fStop;
152
+ serializationObject.focusDistance = this.focusDistance;
153
+ serializationObject.focalLength = this.focalLength;
154
+ serializationObject.sourceSamplingMode = this.sourceSamplingMode;
155
+ serializationObject.depthSamplingMode = this.depthSamplingMode;
156
+ return serializationObject;
157
+ }
158
+ _deserialize(serializationObject) {
159
+ super._deserialize(serializationObject);
160
+ this.lensSize = serializationObject.lensSize;
161
+ this.fStop = serializationObject.fStop;
162
+ this.focusDistance = serializationObject.focusDistance;
163
+ this.focalLength = serializationObject.focalLength;
164
+ this.sourceSamplingMode = serializationObject.sourceSamplingMode;
165
+ this.depthSamplingMode = serializationObject.depthSamplingMode;
166
+ }
167
+ }
168
+ __decorate([
169
+ editableInPropertyPage("Source sampling mode", 6 /* PropertyTypeForEdition.SamplingMode */, "PROPERTIES")
170
+ ], NodeRenderGraphCircleOfConfusionPostProcessBlock.prototype, "sourceSamplingMode", null);
171
+ __decorate([
172
+ editableInPropertyPage("Depth sampling mode", 6 /* PropertyTypeForEdition.SamplingMode */, "PROPERTIES")
173
+ ], NodeRenderGraphCircleOfConfusionPostProcessBlock.prototype, "depthSamplingMode", null);
174
+ __decorate([
175
+ editableInPropertyPage("Lens size", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES")
176
+ ], NodeRenderGraphCircleOfConfusionPostProcessBlock.prototype, "lensSize", null);
177
+ __decorate([
178
+ editableInPropertyPage("F-Stop", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES")
179
+ ], NodeRenderGraphCircleOfConfusionPostProcessBlock.prototype, "fStop", null);
180
+ __decorate([
181
+ editableInPropertyPage("Focus distance", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES")
182
+ ], NodeRenderGraphCircleOfConfusionPostProcessBlock.prototype, "focusDistance", null);
183
+ __decorate([
184
+ editableInPropertyPage("Focal length", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES")
185
+ ], NodeRenderGraphCircleOfConfusionPostProcessBlock.prototype, "focalLength", null);
186
+ RegisterClass("BABYLON.NodeRenderGraphCircleOfConfusionPostProcessBlock", NodeRenderGraphCircleOfConfusionPostProcessBlock);
187
+ //# sourceMappingURL=circleOfConfusionPostProcessBlock.js.map
@@ -0,0 +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;;OAEG;IACH,IAAoB,IAAI;QACpB,OA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;QACjE,mBAAmB,CAAC,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAC;QAC/D,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,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,kBAAkB,GAAG,mBAAmB,CAAC,kBAAkB,CAAC;QACjE,IAAI,CAAC,iBAAiB,GAAG,mBAAmB,CAAC,iBAAiB,CAAC;IACnE,CAAC;CACJ;AAhKG;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;AA8GL,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.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._frameGraphTask.name = this.name;\r\n\r\n this.output.value = this._frameGraphTask.outputTexture;\r\n\r\n const sourceConnectedPoint = this.source.connectedPoint;\r\n if (sourceConnectedPoint) {\r\n this._frameGraphTask.sourceTexture = sourceConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const geomViewDepthConnectedPoint = this.geomViewDepth.connectedPoint;\r\n if (geomViewDepthConnectedPoint) {\r\n this._frameGraphTask.depthTexture = geomViewDepthConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const destinationConnectedPoint = this.destination.connectedPoint;\r\n if (destinationConnectedPoint) {\r\n this._frameGraphTask.destinationTexture = destinationConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const cameraConnectedPoint = this.camera.connectedPoint;\r\n if (cameraConnectedPoint) {\r\n this._frameGraphTask.camera = cameraConnectedPoint.value as Camera;\r\n }\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"]}
@@ -0,0 +1,77 @@
1
+ import type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraph } from "../../../../index.js";
2
+ import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock";
3
+ import { FrameGraphDepthOfFieldTask } from "../../../Tasks/PostProcesses/depthOfFieldTask";
4
+ import { ThinDepthOfFieldEffectBlurLevel } from "../../../../PostProcesses/thinDepthOfFieldEffect.js";
5
+ /**
6
+ * Block that implements the depth of field post process
7
+ */
8
+ export declare class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRenderGraphBlock {
9
+ protected _frameGraphTask: FrameGraphDepthOfFieldTask;
10
+ /**
11
+ * Gets the frame graph task associated with this block
12
+ */
13
+ get task(): FrameGraphDepthOfFieldTask;
14
+ /**
15
+ * Create a new NodeRenderGraphDepthOfFieldPostProcessBlock
16
+ * @param name defines the block name
17
+ * @param frameGraph defines the hosting frame graph
18
+ * @param scene defines the hosting scene
19
+ * @param blurLevel The quality of the depth of field effect (default: ThinDepthOfFieldEffectBlurLevel.Low)
20
+ * @param hdr If high dynamic range textures should be used (default: false)
21
+ */
22
+ constructor(name: string, frameGraph: FrameGraph, scene: Scene, blurLevel?: ThinDepthOfFieldEffectBlurLevel, hdr?: boolean);
23
+ private _createTask;
24
+ /** The quality of the blur effect */
25
+ get blurLevel(): ThinDepthOfFieldEffectBlurLevel;
26
+ set blurLevel(value: ThinDepthOfFieldEffectBlurLevel);
27
+ /** If high dynamic range textures should be used */
28
+ get hdr(): boolean;
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
+ /** Sampling mode used to sample from the depth texture */
34
+ get depthSamplingMode(): number;
35
+ set depthSamplingMode(value: number);
36
+ /** The focal the length of the camera used in the effect in scene units/1000 (eg. millimeter). */
37
+ get focalLength(): number;
38
+ set focalLength(value: number);
39
+ /** F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop. */
40
+ get fStop(): number;
41
+ set fStop(value: number);
42
+ /** Distance away from the camera to focus on in scene units/1000 (eg. millimeter). */
43
+ get focusDistance(): number;
44
+ set focusDistance(value: number);
45
+ /** 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. */
46
+ get lensSize(): number;
47
+ set lensSize(value: number);
48
+ /**
49
+ * Gets the current class name
50
+ * @returns the class name
51
+ */
52
+ getClassName(): string;
53
+ /**
54
+ * Gets the source input component
55
+ */
56
+ get source(): NodeRenderGraphConnectionPoint;
57
+ /**
58
+ * Gets the geometry view depth input component
59
+ */
60
+ get geomViewDepth(): NodeRenderGraphConnectionPoint;
61
+ /**
62
+ * Gets the destination input component
63
+ */
64
+ get destination(): NodeRenderGraphConnectionPoint;
65
+ /**
66
+ * Gets the camera input component
67
+ */
68
+ get camera(): NodeRenderGraphConnectionPoint;
69
+ /**
70
+ * Gets the output component
71
+ */
72
+ get output(): NodeRenderGraphConnectionPoint;
73
+ protected _buildBlock(state: NodeRenderGraphBuildState): void;
74
+ protected _dumpPropertiesCode(): string;
75
+ serialize(): any;
76
+ _deserialize(serializationObject: any): void;
77
+ }
@@ -0,0 +1,232 @@
1
+ import { __decorate } from "../../../../tslib.es6.js";
2
+ import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock.js";
3
+ import { RegisterClass } from "../../../../Misc/typeStore.js";
4
+ import { NodeRenderGraphBlockConnectionPointTypes } from "../../Types/nodeRenderGraphTypes.js";
5
+ import { editableInPropertyPage } from "../../../../Decorators/nodeDecorator.js";
6
+ import { FrameGraphDepthOfFieldTask } from "../../../Tasks/PostProcesses/depthOfFieldTask.js";
7
+ /**
8
+ * Block that implements the depth of field post process
9
+ */
10
+ export class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRenderGraphBlock {
11
+ /**
12
+ * Gets the frame graph task associated with this block
13
+ */
14
+ get task() {
15
+ return this._frameGraphTask;
16
+ }
17
+ /**
18
+ * Create a new NodeRenderGraphDepthOfFieldPostProcessBlock
19
+ * @param name defines the block name
20
+ * @param frameGraph defines the hosting frame graph
21
+ * @param scene defines the hosting scene
22
+ * @param blurLevel The quality of the depth of field effect (default: ThinDepthOfFieldEffectBlurLevel.Low)
23
+ * @param hdr If high dynamic range textures should be used (default: false)
24
+ */
25
+ constructor(name, frameGraph, scene, blurLevel = 0 /* ThinDepthOfFieldEffectBlurLevel.Low */, hdr = false) {
26
+ super(name, frameGraph, scene);
27
+ this._additionalConstructionParameters = [blurLevel, hdr];
28
+ this.registerInput("source", NodeRenderGraphBlockConnectionPointTypes.Texture);
29
+ this.registerInput("geomViewDepth", NodeRenderGraphBlockConnectionPointTypes.TextureViewDepth);
30
+ this.registerInput("destination", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
31
+ this.registerInput("camera", NodeRenderGraphBlockConnectionPointTypes.Camera);
32
+ this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
33
+ this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
34
+ this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);
35
+ this.output._typeConnectionSource = () => {
36
+ return this.destination.isConnected ? this.destination : this.source;
37
+ };
38
+ this._frameGraphTask = new FrameGraphDepthOfFieldTask(this.name, frameGraph, scene.getEngine(), blurLevel, hdr);
39
+ }
40
+ _createTask(blurLevel, hdr) {
41
+ const sourceSamplingMode = this._frameGraphTask.sourceSamplingMode;
42
+ const depthSamplingMode = this._frameGraphTask.depthSamplingMode;
43
+ const focalLength = this._frameGraphTask.depthOfField.focalLength;
44
+ const fStop = this._frameGraphTask.depthOfField.fStop;
45
+ const focusDistance = this._frameGraphTask.depthOfField.focusDistance;
46
+ const lensSize = this._frameGraphTask.depthOfField.lensSize;
47
+ this._frameGraphTask.dispose();
48
+ this._frameGraphTask = new FrameGraphDepthOfFieldTask(this.name, this._frameGraph, this._scene.getEngine(), blurLevel, hdr);
49
+ this._frameGraphTask.sourceSamplingMode = sourceSamplingMode;
50
+ this._frameGraphTask.depthSamplingMode = depthSamplingMode;
51
+ this._frameGraphTask.depthOfField.focalLength = focalLength;
52
+ this._frameGraphTask.depthOfField.fStop = fStop;
53
+ this._frameGraphTask.depthOfField.focusDistance = focusDistance;
54
+ this._frameGraphTask.depthOfField.lensSize = lensSize;
55
+ this._additionalConstructionParameters = [blurLevel, hdr];
56
+ }
57
+ /** The quality of the blur effect */
58
+ get blurLevel() {
59
+ return this._frameGraphTask.depthOfField.blurLevel;
60
+ }
61
+ set blurLevel(value) {
62
+ this._createTask(value, this._frameGraphTask.hdr);
63
+ }
64
+ /** If high dynamic range textures should be used */
65
+ get hdr() {
66
+ return this._frameGraphTask.hdr;
67
+ }
68
+ set hdr(value) {
69
+ this._createTask(this._frameGraphTask.depthOfField.blurLevel, value);
70
+ }
71
+ /** Sampling mode used to sample from the source texture */
72
+ get sourceSamplingMode() {
73
+ return this._frameGraphTask.sourceSamplingMode;
74
+ }
75
+ set sourceSamplingMode(value) {
76
+ this._frameGraphTask.sourceSamplingMode = value;
77
+ }
78
+ /** Sampling mode used to sample from the depth texture */
79
+ get depthSamplingMode() {
80
+ return this._frameGraphTask.depthSamplingMode;
81
+ }
82
+ set depthSamplingMode(value) {
83
+ this._frameGraphTask.depthSamplingMode = value;
84
+ }
85
+ /** The focal the length of the camera used in the effect in scene units/1000 (eg. millimeter). */
86
+ get focalLength() {
87
+ return this._frameGraphTask.depthOfField.focalLength;
88
+ }
89
+ set focalLength(value) {
90
+ this._frameGraphTask.depthOfField.focalLength = value;
91
+ }
92
+ /** F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop. */
93
+ get fStop() {
94
+ return this._frameGraphTask.depthOfField.fStop;
95
+ }
96
+ set fStop(value) {
97
+ this._frameGraphTask.depthOfField.fStop = value;
98
+ }
99
+ /** Distance away from the camera to focus on in scene units/1000 (eg. millimeter). */
100
+ get focusDistance() {
101
+ return this._frameGraphTask.depthOfField.focusDistance;
102
+ }
103
+ set focusDistance(value) {
104
+ this._frameGraphTask.depthOfField.focusDistance = value;
105
+ }
106
+ /** 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. */
107
+ get lensSize() {
108
+ return this._frameGraphTask.depthOfField.lensSize;
109
+ }
110
+ set lensSize(value) {
111
+ this._frameGraphTask.depthOfField.lensSize = value;
112
+ }
113
+ /**
114
+ * Gets the current class name
115
+ * @returns the class name
116
+ */
117
+ getClassName() {
118
+ return "NodeRenderGraphDepthOfFieldPostProcessBlock";
119
+ }
120
+ /**
121
+ * Gets the source input component
122
+ */
123
+ get source() {
124
+ return this._inputs[0];
125
+ }
126
+ /**
127
+ * Gets the geometry view depth input component
128
+ */
129
+ get geomViewDepth() {
130
+ return this._inputs[1];
131
+ }
132
+ /**
133
+ * Gets the destination input component
134
+ */
135
+ get destination() {
136
+ return this._inputs[2];
137
+ }
138
+ /**
139
+ * Gets the camera input component
140
+ */
141
+ get camera() {
142
+ return this._inputs[3];
143
+ }
144
+ /**
145
+ * Gets the output component
146
+ */
147
+ get output() {
148
+ return this._outputs[0];
149
+ }
150
+ _buildBlock(state) {
151
+ super._buildBlock(state);
152
+ this._frameGraphTask.name = this.name;
153
+ this.output.value = this._frameGraphTask.outputTexture;
154
+ const sourceConnectedPoint = this.source.connectedPoint;
155
+ if (sourceConnectedPoint) {
156
+ this._frameGraphTask.sourceTexture = sourceConnectedPoint.value;
157
+ }
158
+ const geomViewDepthConnectedPoint = this.geomViewDepth.connectedPoint;
159
+ if (geomViewDepthConnectedPoint) {
160
+ this._frameGraphTask.depthTexture = geomViewDepthConnectedPoint.value;
161
+ }
162
+ const destinationConnectedPoint = this.destination.connectedPoint;
163
+ if (destinationConnectedPoint) {
164
+ this._frameGraphTask.destinationTexture = destinationConnectedPoint.value;
165
+ }
166
+ const cameraConnectedPoint = this.camera.connectedPoint;
167
+ if (cameraConnectedPoint) {
168
+ this._frameGraphTask.camera = cameraConnectedPoint.value;
169
+ }
170
+ }
171
+ _dumpPropertiesCode() {
172
+ const codes = [];
173
+ codes.push(`${this._codeVariableName}.lensSize = ${this.lensSize};`);
174
+ codes.push(`${this._codeVariableName}.fStop = ${this.fStop};`);
175
+ codes.push(`${this._codeVariableName}.focusDistance = ${this.focusDistance};`);
176
+ codes.push(`${this._codeVariableName}.focalLength = ${this.focalLength};`);
177
+ codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);
178
+ codes.push(`${this._codeVariableName}.depthSamplingMode = ${this.depthSamplingMode};`);
179
+ return super._dumpPropertiesCode() + codes.join("\n");
180
+ }
181
+ serialize() {
182
+ const serializationObject = super.serialize();
183
+ serializationObject.lensSize = this.lensSize;
184
+ serializationObject.fStop = this.fStop;
185
+ serializationObject.focusDistance = this.focusDistance;
186
+ serializationObject.focalLength = this.focalLength;
187
+ serializationObject.sourceSamplingMode = this.sourceSamplingMode;
188
+ serializationObject.depthSamplingMode = this.depthSamplingMode;
189
+ return serializationObject;
190
+ }
191
+ _deserialize(serializationObject) {
192
+ super._deserialize(serializationObject);
193
+ this.lensSize = serializationObject.lensSize;
194
+ this.fStop = serializationObject.fStop;
195
+ this.focusDistance = serializationObject.focusDistance;
196
+ this.focalLength = serializationObject.focalLength;
197
+ this.sourceSamplingMode = serializationObject.sourceSamplingMode;
198
+ this.depthSamplingMode = serializationObject.depthSamplingMode;
199
+ }
200
+ }
201
+ __decorate([
202
+ editableInPropertyPage("Blur level", 4 /* PropertyTypeForEdition.List */, "PROPERTIES", {
203
+ options: [
204
+ { label: "Low", value: 0 /* ThinDepthOfFieldEffectBlurLevel.Low */ },
205
+ { label: "Medium", value: 1 /* ThinDepthOfFieldEffectBlurLevel.Medium */ },
206
+ { label: "High", value: 2 /* ThinDepthOfFieldEffectBlurLevel.High */ },
207
+ ],
208
+ })
209
+ ], NodeRenderGraphDepthOfFieldPostProcessBlock.prototype, "blurLevel", null);
210
+ __decorate([
211
+ editableInPropertyPage("HDR", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
212
+ ], NodeRenderGraphDepthOfFieldPostProcessBlock.prototype, "hdr", null);
213
+ __decorate([
214
+ editableInPropertyPage("Source sampling mode", 6 /* PropertyTypeForEdition.SamplingMode */, "PROPERTIES")
215
+ ], NodeRenderGraphDepthOfFieldPostProcessBlock.prototype, "sourceSamplingMode", null);
216
+ __decorate([
217
+ editableInPropertyPage("Depth sampling mode", 6 /* PropertyTypeForEdition.SamplingMode */, "PROPERTIES")
218
+ ], NodeRenderGraphDepthOfFieldPostProcessBlock.prototype, "depthSamplingMode", null);
219
+ __decorate([
220
+ editableInPropertyPage("Focal length", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES")
221
+ ], NodeRenderGraphDepthOfFieldPostProcessBlock.prototype, "focalLength", null);
222
+ __decorate([
223
+ editableInPropertyPage("F-Stop", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES")
224
+ ], NodeRenderGraphDepthOfFieldPostProcessBlock.prototype, "fStop", null);
225
+ __decorate([
226
+ editableInPropertyPage("Focus distance", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES")
227
+ ], NodeRenderGraphDepthOfFieldPostProcessBlock.prototype, "focusDistance", null);
228
+ __decorate([
229
+ editableInPropertyPage("Lens size", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES")
230
+ ], NodeRenderGraphDepthOfFieldPostProcessBlock.prototype, "lensSize", null);
231
+ RegisterClass("BABYLON.NodeRenderGraphDepthOfFieldPostProcessBlock", NodeRenderGraphDepthOfFieldPostProcessBlock);
232
+ //# sourceMappingURL=depthOfFieldPostProcessBlock.js.map
@@ -0,0 +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,CAA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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;AA8GL,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.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._frameGraphTask.name = this.name;\r\n\r\n this.output.value = this._frameGraphTask.outputTexture;\r\n\r\n const sourceConnectedPoint = this.source.connectedPoint;\r\n if (sourceConnectedPoint) {\r\n this._frameGraphTask.sourceTexture = sourceConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const geomViewDepthConnectedPoint = this.geomViewDepth.connectedPoint;\r\n if (geomViewDepthConnectedPoint) {\r\n this._frameGraphTask.depthTexture = geomViewDepthConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const destinationConnectedPoint = this.destination.connectedPoint;\r\n if (destinationConnectedPoint) {\r\n this._frameGraphTask.destinationTexture = destinationConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const cameraConnectedPoint = this.camera.connectedPoint;\r\n if (cameraConnectedPoint) {\r\n this._frameGraphTask.camera = cameraConnectedPoint.value as Camera;\r\n }\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"]}