@babylonjs/core 8.38.0 → 8.39.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 (235) hide show
  1. package/Animations/animation.d.ts +2 -1
  2. package/Animations/animation.js +3 -2
  3. package/Animations/animation.js.map +1 -1
  4. package/Audio/Interfaces/ISoundOptions.d.ts +1 -1
  5. package/Audio/Interfaces/ISoundOptions.js.map +1 -1
  6. package/Audio/audioEngine.d.ts +3 -4
  7. package/Audio/audioEngine.js +9 -6
  8. package/Audio/audioEngine.js.map +1 -1
  9. package/Audio/sound.d.ts +33 -54
  10. package/Audio/sound.js +450 -718
  11. package/Audio/sound.js.map +1 -1
  12. package/AudioV2/abstractAudio/abstractAudioOutNode.d.ts +1 -1
  13. package/AudioV2/abstractAudio/abstractAudioOutNode.js +1 -1
  14. package/AudioV2/abstractAudio/abstractAudioOutNode.js.map +1 -1
  15. package/AudioV2/abstractAudio/abstractSound.d.ts +1 -1
  16. package/AudioV2/abstractAudio/abstractSound.js +2 -2
  17. package/AudioV2/abstractAudio/abstractSound.js.map +1 -1
  18. package/AudioV2/abstractAudio/abstractSoundSource.d.ts +11 -3
  19. package/AudioV2/abstractAudio/abstractSoundSource.js +37 -1
  20. package/AudioV2/abstractAudio/abstractSoundSource.js.map +1 -1
  21. package/AudioV2/abstractAudio/audioBus.d.ts +8 -3
  22. package/AudioV2/abstractAudio/audioBus.js +24 -1
  23. package/AudioV2/abstractAudio/audioBus.js.map +1 -1
  24. package/AudioV2/abstractAudio/staticSound.d.ts +1 -1
  25. package/AudioV2/abstractAudio/staticSound.js +2 -2
  26. package/AudioV2/abstractAudio/staticSound.js.map +1 -1
  27. package/AudioV2/abstractAudio/streamingSound.d.ts +1 -1
  28. package/AudioV2/abstractAudio/streamingSound.js +2 -2
  29. package/AudioV2/abstractAudio/streamingSound.js.map +1 -1
  30. package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.d.ts +1 -1
  31. package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.js +3 -0
  32. package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.js.map +1 -1
  33. package/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.d.ts +1 -0
  34. package/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.js +1 -0
  35. package/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.js.map +1 -1
  36. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.d.ts +12 -2
  37. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.js +2 -0
  38. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.js.map +1 -1
  39. package/AudioV2/abstractAudio/subProperties/spatialAudio.d.ts +6 -0
  40. package/AudioV2/abstractAudio/subProperties/spatialAudio.js +25 -0
  41. package/AudioV2/abstractAudio/subProperties/spatialAudio.js.map +1 -1
  42. package/AudioV2/webAudio/components/webAudioParameterComponent.js +2 -2
  43. package/AudioV2/webAudio/components/webAudioParameterComponent.js.map +1 -1
  44. package/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.d.ts +3 -0
  45. package/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.js +14 -17
  46. package/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.js.map +1 -1
  47. package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.js +1 -0
  48. package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.js.map +1 -1
  49. package/AudioV2/webAudio/subProperties/spatialWebAudio.js +1 -0
  50. package/AudioV2/webAudio/subProperties/spatialWebAudio.js.map +1 -1
  51. package/AudioV2/webAudio/webAudioBus.d.ts +2 -7
  52. package/AudioV2/webAudio/webAudioBus.js +4 -24
  53. package/AudioV2/webAudio/webAudioBus.js.map +1 -1
  54. package/AudioV2/webAudio/webAudioEngine.js +1 -0
  55. package/AudioV2/webAudio/webAudioEngine.js.map +1 -1
  56. package/AudioV2/webAudio/webAudioSoundSource.d.ts +2 -7
  57. package/AudioV2/webAudio/webAudioSoundSource.js +3 -24
  58. package/AudioV2/webAudio/webAudioSoundSource.js.map +1 -1
  59. package/AudioV2/webAudio/webAudioStaticSound.d.ts +3 -7
  60. package/AudioV2/webAudio/webAudioStaticSound.js +13 -26
  61. package/AudioV2/webAudio/webAudioStaticSound.js.map +1 -1
  62. package/AudioV2/webAudio/webAudioStreamingSound.d.ts +3 -7
  63. package/AudioV2/webAudio/webAudioStreamingSound.js +6 -23
  64. package/AudioV2/webAudio/webAudioStreamingSound.js.map +1 -1
  65. package/Behaviors/Cameras/autoRotationBehavior.d.ts +4 -0
  66. package/Behaviors/Cameras/autoRotationBehavior.js +7 -0
  67. package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
  68. package/Behaviors/Cameras/bouncingBehavior.d.ts +5 -0
  69. package/Behaviors/Cameras/bouncingBehavior.js +8 -0
  70. package/Behaviors/Cameras/bouncingBehavior.js.map +1 -1
  71. package/Behaviors/Cameras/framingBehavior.d.ts +4 -0
  72. package/Behaviors/Cameras/framingBehavior.js +7 -0
  73. package/Behaviors/Cameras/framingBehavior.js.map +1 -1
  74. package/Behaviors/Cameras/interpolatingBehavior.d.ts +7 -1
  75. package/Behaviors/Cameras/interpolatingBehavior.js +11 -3
  76. package/Behaviors/Cameras/interpolatingBehavior.js.map +1 -1
  77. package/Behaviors/Meshes/attachToBoxBehavior.d.ts +5 -0
  78. package/Behaviors/Meshes/attachToBoxBehavior.js +8 -1
  79. package/Behaviors/Meshes/attachToBoxBehavior.js.map +1 -1
  80. package/Behaviors/Meshes/baseSixDofDragBehavior.d.ts +5 -2
  81. package/Behaviors/Meshes/baseSixDofDragBehavior.js +8 -0
  82. package/Behaviors/Meshes/baseSixDofDragBehavior.js.map +1 -1
  83. package/Behaviors/Meshes/fadeInOutBehavior.d.ts +5 -0
  84. package/Behaviors/Meshes/fadeInOutBehavior.js +6 -0
  85. package/Behaviors/Meshes/fadeInOutBehavior.js.map +1 -1
  86. package/Behaviors/Meshes/handConstraintBehavior.d.ts +5 -0
  87. package/Behaviors/Meshes/handConstraintBehavior.js +8 -0
  88. package/Behaviors/Meshes/handConstraintBehavior.js.map +1 -1
  89. package/Behaviors/Meshes/multiPointerScaleBehavior.d.ts +5 -0
  90. package/Behaviors/Meshes/multiPointerScaleBehavior.js +8 -0
  91. package/Behaviors/Meshes/multiPointerScaleBehavior.js.map +1 -1
  92. package/Behaviors/Meshes/sixDofDragBehavior.js +1 -1
  93. package/Behaviors/Meshes/sixDofDragBehavior.js.map +1 -1
  94. package/Behaviors/Meshes/surfaceMagnetismBehavior.d.ts +5 -0
  95. package/Behaviors/Meshes/surfaceMagnetismBehavior.js +7 -0
  96. package/Behaviors/Meshes/surfaceMagnetismBehavior.js.map +1 -1
  97. package/Behaviors/behavior.d.ts +4 -0
  98. package/Behaviors/behavior.js.map +1 -1
  99. package/Cameras/geospatialCamera.d.ts +13 -5
  100. package/Cameras/geospatialCamera.js +116 -48
  101. package/Cameras/geospatialCamera.js.map +1 -1
  102. package/Cameras/geospatialCameraMovement.d.ts +6 -2
  103. package/Cameras/geospatialCameraMovement.js +11 -11
  104. package/Cameras/geospatialCameraMovement.js.map +1 -1
  105. package/Engines/WebGPU/Extensions/engine.multiRender.d.ts +2 -1
  106. package/Engines/WebGPU/Extensions/engine.multiRender.js +5 -2
  107. package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
  108. package/Engines/WebGPU/webgpuTextureHelper.d.ts +1 -0
  109. package/Engines/WebGPU/webgpuTextureHelper.js +11 -0
  110. package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
  111. package/Engines/WebGPU/webgpuTextureManager.d.ts +1 -0
  112. package/Engines/WebGPU/webgpuTextureManager.js +100 -9
  113. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
  114. package/Engines/abstractEngine.d.ts +2 -2
  115. package/Engines/abstractEngine.js +2 -2
  116. package/Engines/abstractEngine.js.map +1 -1
  117. package/Engines/renderTargetWrapper.js +6 -1
  118. package/Engines/renderTargetWrapper.js.map +1 -1
  119. package/Engines/thinEngine.js +1 -1
  120. package/Engines/thinEngine.js.map +1 -1
  121. package/Engines/webgpuEngine.d.ts +7 -4
  122. package/Engines/webgpuEngine.js +53 -25
  123. package/Engines/webgpuEngine.js.map +1 -1
  124. package/FrameGraph/Node/Blocks/PostProcesses/volumetricLightingBlock.d.ts +74 -0
  125. package/FrameGraph/Node/Blocks/PostProcesses/volumetricLightingBlock.js +179 -0
  126. package/FrameGraph/Node/Blocks/PostProcesses/volumetricLightingBlock.js.map +1 -0
  127. package/FrameGraph/Node/Blocks/index.d.ts +2 -0
  128. package/FrameGraph/Node/Blocks/index.js +2 -0
  129. package/FrameGraph/Node/Blocks/index.js.map +1 -1
  130. package/FrameGraph/Node/Blocks/lightingVolumeBlock.d.ts +46 -0
  131. package/FrameGraph/Node/Blocks/lightingVolumeBlock.js +106 -0
  132. package/FrameGraph/Node/Blocks/lightingVolumeBlock.js.map +1 -0
  133. package/FrameGraph/Node/nodeRenderGraph.d.ts +22 -5
  134. package/FrameGraph/Node/nodeRenderGraph.js +39 -18
  135. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  136. package/FrameGraph/Passes/pass.d.ts +2 -0
  137. package/FrameGraph/Passes/pass.js +2 -0
  138. package/FrameGraph/Passes/pass.js.map +1 -1
  139. package/FrameGraph/Passes/renderPass.d.ts +2 -0
  140. package/FrameGraph/Passes/renderPass.js +4 -0
  141. package/FrameGraph/Passes/renderPass.js.map +1 -1
  142. package/FrameGraph/Tasks/Misc/lightingVolumeTask.d.ts +31 -0
  143. package/FrameGraph/Tasks/Misc/lightingVolumeTask.js +56 -0
  144. package/FrameGraph/Tasks/Misc/lightingVolumeTask.js.map +1 -0
  145. package/FrameGraph/Tasks/PostProcesses/postProcessTask.d.ts +2 -2
  146. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
  147. package/FrameGraph/Tasks/PostProcesses/volumetricLightingBlendVolumeTask.d.ts +30 -0
  148. package/FrameGraph/Tasks/PostProcesses/volumetricLightingBlendVolumeTask.js +57 -0
  149. package/FrameGraph/Tasks/PostProcesses/volumetricLightingBlendVolumeTask.js.map +1 -0
  150. package/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.d.ts +91 -0
  151. package/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.js +210 -0
  152. package/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.js.map +1 -0
  153. package/FrameGraph/Tasks/Rendering/objectRendererTask.js +1 -1
  154. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
  155. package/FrameGraph/Tasks/Texture/clearTextureTask.js +1 -1
  156. package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
  157. package/FrameGraph/frameGraph.d.ts +13 -4
  158. package/FrameGraph/frameGraph.js +45 -5
  159. package/FrameGraph/frameGraph.js.map +1 -1
  160. package/FrameGraph/frameGraphRenderContext.d.ts +2 -2
  161. package/FrameGraph/frameGraphRenderContext.js.map +1 -1
  162. package/FrameGraph/frameGraphRenderTarget.d.ts +1 -0
  163. package/FrameGraph/frameGraphRenderTarget.js +3 -0
  164. package/FrameGraph/frameGraphRenderTarget.js.map +1 -1
  165. package/FrameGraph/frameGraphTask.d.ts +6 -0
  166. package/FrameGraph/frameGraphTask.js +17 -2
  167. package/FrameGraph/frameGraphTask.js.map +1 -1
  168. package/FrameGraph/frameGraphTypes.d.ts +2 -0
  169. package/FrameGraph/frameGraphTypes.js.map +1 -1
  170. package/FrameGraph/index.d.ts +2 -0
  171. package/FrameGraph/index.js +2 -0
  172. package/FrameGraph/index.js.map +1 -1
  173. package/Helpers/sceneHelpers.js +1 -1
  174. package/Helpers/sceneHelpers.js.map +1 -1
  175. package/Lights/index.d.ts +1 -0
  176. package/Lights/index.js +1 -0
  177. package/Lights/index.js.map +1 -1
  178. package/Lights/lightingVolume.d.ts +89 -0
  179. package/Lights/lightingVolume.js +435 -0
  180. package/Lights/lightingVolume.js.map +1 -0
  181. package/Materials/GaussianSplatting/gaussianSplattingMaterial.d.ts +7 -0
  182. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +19 -5
  183. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
  184. package/Materials/Node/nodeMaterial.js +8 -2
  185. package/Materials/Node/nodeMaterial.js.map +1 -1
  186. package/Materials/floatingOriginMatrixOverrides.js +6 -5
  187. package/Materials/floatingOriginMatrixOverrides.js.map +1 -1
  188. package/Materials/uniformBuffer.d.ts +1 -0
  189. package/Materials/uniformBuffer.js +8 -1
  190. package/Materials/uniformBuffer.js.map +1 -1
  191. package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +5 -2
  192. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +138 -45
  193. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  194. package/Meshes/mesh.js +1 -1
  195. package/Meshes/mesh.js.map +1 -1
  196. package/Misc/screenshotTools.js +2 -8
  197. package/Misc/screenshotTools.js.map +1 -1
  198. package/Particles/solidParticle.d.ts +9 -0
  199. package/Particles/solidParticle.js +11 -0
  200. package/Particles/solidParticle.js.map +1 -1
  201. package/Particles/solidParticleSystem.d.ts +28 -0
  202. package/Particles/solidParticleSystem.js +75 -0
  203. package/Particles/solidParticleSystem.js.map +1 -1
  204. package/Physics/v2/characterController.d.ts +42 -2
  205. package/Physics/v2/characterController.js +140 -46
  206. package/Physics/v2/characterController.js.map +1 -1
  207. package/Shaders/volumetricLightingBlendVolume.fragment.d.ts +5 -0
  208. package/Shaders/volumetricLightingBlendVolume.fragment.js +21 -0
  209. package/Shaders/volumetricLightingBlendVolume.fragment.js.map +1 -0
  210. package/Shaders/volumetricLightingRenderVolume.fragment.d.ts +7 -0
  211. package/Shaders/volumetricLightingRenderVolume.fragment.js +25 -0
  212. package/Shaders/volumetricLightingRenderVolume.fragment.js.map +1 -0
  213. package/Shaders/volumetricLightingRenderVolume.vertex.d.ts +9 -0
  214. package/Shaders/volumetricLightingRenderVolume.vertex.js +18 -0
  215. package/Shaders/volumetricLightingRenderVolume.vertex.js.map +1 -0
  216. package/ShadersWGSL/gaussianSplattingDepth.fragment.d.ts +0 -1
  217. package/ShadersWGSL/gaussianSplattingDepth.fragment.js +0 -2
  218. package/ShadersWGSL/gaussianSplattingDepth.fragment.js.map +1 -1
  219. package/ShadersWGSL/lightingVolume.compute.d.ts +5 -0
  220. package/ShadersWGSL/lightingVolume.compute.js +27 -0
  221. package/ShadersWGSL/lightingVolume.compute.js.map +1 -0
  222. package/ShadersWGSL/volumetricLightingBlendVolume.fragment.d.ts +5 -0
  223. package/ShadersWGSL/volumetricLightingBlendVolume.fragment.js +22 -0
  224. package/ShadersWGSL/volumetricLightingBlendVolume.fragment.js.map +1 -0
  225. package/ShadersWGSL/volumetricLightingRenderVolume.fragment.d.ts +7 -0
  226. package/ShadersWGSL/volumetricLightingRenderVolume.fragment.js +27 -0
  227. package/ShadersWGSL/volumetricLightingRenderVolume.fragment.js.map +1 -0
  228. package/ShadersWGSL/volumetricLightingRenderVolume.vertex.d.ts +7 -0
  229. package/ShadersWGSL/volumetricLightingRenderVolume.vertex.js +17 -0
  230. package/ShadersWGSL/volumetricLightingRenderVolume.vertex.js.map +1 -0
  231. package/States/IStencilState.d.ts +48 -2
  232. package/States/IStencilState.js.map +1 -1
  233. package/package.json +1 -1
  234. package/scene.js +6 -4
  235. package/scene.js.map +1 -1
@@ -0,0 +1,74 @@
1
+ import type { FrameGraph, NodeRenderGraphBuildState, NodeRenderGraphConnectionPoint, Scene } from "../../../../index.js";
2
+ import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock.js";
3
+ import { FrameGraphVolumetricLightingTask } from "../../../Tasks/PostProcesses/volumetricLightingTask.js";
4
+ import { Vector3 } from "../../../../Maths/math.vector.js";
5
+ import { Color3 } from "../../../../Maths/math.color.js";
6
+ /**
7
+ * Block that implements the volumetric lighting post process
8
+ */
9
+ export declare class NodeRenderGraphVolumetricLightingBlock extends NodeRenderGraphBlock {
10
+ protected _frameGraphTask: FrameGraphVolumetricLightingTask;
11
+ _additionalConstructionParameters: [boolean];
12
+ /**
13
+ * Gets the frame graph task associated with this block
14
+ */
15
+ get task(): FrameGraphVolumetricLightingTask;
16
+ /**
17
+ * Create a new NodeRenderGraphVolumetricLightingBlock
18
+ * @param name defines the block name
19
+ * @param frameGraph defines the hosting frame graph
20
+ * @param scene defines the hosting scene
21
+ * @param enableExtinction defines whether to enable extinction coefficients
22
+ */
23
+ constructor(name: string, frameGraph: FrameGraph, scene: Scene, enableExtinction?: boolean);
24
+ private _createTask;
25
+ /** Gets or sets the phaseG parameter */
26
+ get phaseG(): number;
27
+ set phaseG(value: number);
28
+ /** If extinction coefficients should be used */
29
+ get enableExtinction(): boolean;
30
+ set enableExtinction(value: boolean);
31
+ /** Gets or sets the extinction color */
32
+ get extinction(): Vector3;
33
+ set extinction(value: Vector3);
34
+ /** Gets or sets the light power */
35
+ get lightPower(): Color3;
36
+ set lightPower(value: Color3);
37
+ /**
38
+ * Gets the current class name
39
+ * @returns the class name
40
+ */
41
+ getClassName(): string;
42
+ /**
43
+ * Gets the target input component
44
+ */
45
+ get target(): NodeRenderGraphConnectionPoint;
46
+ /**
47
+ * Gets the depth texture input component
48
+ */
49
+ get depth(): NodeRenderGraphConnectionPoint;
50
+ /**
51
+ * Gets the camera input component
52
+ */
53
+ get camera(): NodeRenderGraphConnectionPoint;
54
+ /**
55
+ * Gets the lighting volume mesh input component
56
+ */
57
+ get lightingVolumeMesh(): NodeRenderGraphConnectionPoint;
58
+ /**
59
+ * Gets the light input component
60
+ */
61
+ get light(): NodeRenderGraphConnectionPoint;
62
+ /**
63
+ * Gets the lighting volume texture input component
64
+ */
65
+ get lightingVolumeTexture(): NodeRenderGraphConnectionPoint;
66
+ /**
67
+ * Gets the output component
68
+ */
69
+ get output(): NodeRenderGraphConnectionPoint;
70
+ protected _buildBlock(state: NodeRenderGraphBuildState): void;
71
+ protected _dumpPropertiesCode(): string;
72
+ serialize(): any;
73
+ _deserialize(serializationObject: any): void;
74
+ }
@@ -0,0 +1,179 @@
1
+ import { __decorate } from "../../../../tslib.es6.js";
2
+ import { RegisterClass } from "../../../../Misc/typeStore.js";
3
+ import { editableInPropertyPage } from "../../../../Decorators/nodeDecorator.js";
4
+ import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock.js";
5
+ import { FrameGraphVolumetricLightingTask } from "../../../Tasks/PostProcesses/volumetricLightingTask.js";
6
+ import { NodeRenderGraphBlockConnectionPointTypes } from "../../Types/nodeRenderGraphTypes.js";
7
+ import { Vector3 } from "../../../../Maths/math.vector.js";
8
+ import { Color3 } from "../../../../Maths/math.color.js";
9
+ /**
10
+ * Block that implements the volumetric lighting post process
11
+ */
12
+ export class NodeRenderGraphVolumetricLightingBlock extends NodeRenderGraphBlock {
13
+ /**
14
+ * Gets the frame graph task associated with this block
15
+ */
16
+ get task() {
17
+ return this._frameGraphTask;
18
+ }
19
+ /**
20
+ * Create a new NodeRenderGraphVolumetricLightingBlock
21
+ * @param name defines the block name
22
+ * @param frameGraph defines the hosting frame graph
23
+ * @param scene defines the hosting scene
24
+ * @param enableExtinction defines whether to enable extinction coefficients
25
+ */
26
+ constructor(name, frameGraph, scene, enableExtinction = false) {
27
+ super(name, frameGraph, scene);
28
+ this._additionalConstructionParameters = [enableExtinction];
29
+ this.registerInput("target", NodeRenderGraphBlockConnectionPointTypes.AutoDetect);
30
+ this.registerInput("depth", NodeRenderGraphBlockConnectionPointTypes.AutoDetect);
31
+ this.registerInput("camera", NodeRenderGraphBlockConnectionPointTypes.Camera);
32
+ this.registerInput("lightingVolumeMesh", NodeRenderGraphBlockConnectionPointTypes.ObjectList);
33
+ this.registerInput("light", NodeRenderGraphBlockConnectionPointTypes.ShadowLight);
34
+ this.registerInput("lightingVolumeTexture", NodeRenderGraphBlockConnectionPointTypes.AutoDetect, true);
35
+ this.target.addExcludedConnectionPointFromAllowedTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
36
+ this.lightingVolumeTexture.addExcludedConnectionPointFromAllowedTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
37
+ this.depth.addExcludedConnectionPointFromAllowedTypes(NodeRenderGraphBlockConnectionPointTypes.TextureDepthStencilAttachment | NodeRenderGraphBlockConnectionPointTypes.TextureScreenDepth);
38
+ this._addDependenciesInput();
39
+ this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
40
+ this.output._typeConnectionSource = () => {
41
+ return this.target;
42
+ };
43
+ this._frameGraphTask = new FrameGraphVolumetricLightingTask(name, frameGraph, enableExtinction);
44
+ }
45
+ _createTask(enableExtinction) {
46
+ const sourceSamplingMode = this._frameGraphTask.sourceSamplingMode;
47
+ const phaseG = this._frameGraphTask.phaseG;
48
+ const extinction = this._frameGraphTask.extinction;
49
+ const lightPower = this._frameGraphTask.lightPower;
50
+ this._frameGraphTask.dispose();
51
+ this._frameGraphTask = new FrameGraphVolumetricLightingTask(this.name, this._frameGraph, enableExtinction);
52
+ this._frameGraphTask.sourceSamplingMode = sourceSamplingMode;
53
+ this._frameGraphTask.phaseG = phaseG;
54
+ this._frameGraphTask.extinction = extinction;
55
+ this._frameGraphTask.lightPower = lightPower;
56
+ this._additionalConstructionParameters = [enableExtinction];
57
+ }
58
+ /** Gets or sets the phaseG parameter */
59
+ get phaseG() {
60
+ return this._frameGraphTask.phaseG;
61
+ }
62
+ set phaseG(value) {
63
+ this._frameGraphTask.phaseG = value;
64
+ }
65
+ /** If extinction coefficients should be used */
66
+ get enableExtinction() {
67
+ return this._frameGraphTask.enableExtinction;
68
+ }
69
+ set enableExtinction(value) {
70
+ this._createTask(value);
71
+ }
72
+ /** Gets or sets the extinction color */
73
+ get extinction() {
74
+ return this._frameGraphTask.extinction;
75
+ }
76
+ set extinction(value) {
77
+ this._frameGraphTask.extinction = value;
78
+ }
79
+ /** Gets or sets the light power */
80
+ get lightPower() {
81
+ return this._frameGraphTask.lightPower;
82
+ }
83
+ set lightPower(value) {
84
+ this._frameGraphTask.lightPower = value;
85
+ }
86
+ /**
87
+ * Gets the current class name
88
+ * @returns the class name
89
+ */
90
+ getClassName() {
91
+ return "NodeRenderGraphVolumetricLightingBlock";
92
+ }
93
+ /**
94
+ * Gets the target input component
95
+ */
96
+ get target() {
97
+ return this._inputs[0];
98
+ }
99
+ /**
100
+ * Gets the depth texture input component
101
+ */
102
+ get depth() {
103
+ return this._inputs[1];
104
+ }
105
+ /**
106
+ * Gets the camera input component
107
+ */
108
+ get camera() {
109
+ return this._inputs[2];
110
+ }
111
+ /**
112
+ * Gets the lighting volume mesh input component
113
+ */
114
+ get lightingVolumeMesh() {
115
+ return this._inputs[3];
116
+ }
117
+ /**
118
+ * Gets the light input component
119
+ */
120
+ get light() {
121
+ return this._inputs[4];
122
+ }
123
+ /**
124
+ * Gets the lighting volume texture input component
125
+ */
126
+ get lightingVolumeTexture() {
127
+ return this._inputs[5];
128
+ }
129
+ /**
130
+ * Gets the output component
131
+ */
132
+ get output() {
133
+ return this._outputs[0];
134
+ }
135
+ _buildBlock(state) {
136
+ super._buildBlock(state);
137
+ this.output.value = this._frameGraphTask.outputTexture;
138
+ this._frameGraphTask.targetTexture = this.target.connectedPoint?.value;
139
+ this._frameGraphTask.depthTexture = this.depth.connectedPoint?.value;
140
+ this._frameGraphTask.camera = this.camera.connectedPoint?.value;
141
+ this._frameGraphTask.lightingVolumeMesh = this.lightingVolumeMesh.connectedPoint?.value;
142
+ this._frameGraphTask.light = this.light.connectedPoint?.value;
143
+ this._frameGraphTask.lightingVolumeTexture = this.lightingVolumeTexture.connectedPoint?.value;
144
+ }
145
+ _dumpPropertiesCode() {
146
+ const codes = [];
147
+ codes.push(`${this._codeVariableName}.phaseG = ${this.phaseG};`);
148
+ codes.push(`${this._codeVariableName}.extinction = new BABYLON.Vector3(${this.extinction.x}, ${this.extinction.y}, ${this.extinction.z});`);
149
+ codes.push(`${this._codeVariableName}.lightPower = new Color3(${this.lightPower.r}, ${this.lightPower.g}, ${this.lightPower.b});`);
150
+ return super._dumpPropertiesCode() + codes.join("\n");
151
+ }
152
+ serialize() {
153
+ const serializationObject = super.serialize();
154
+ serializationObject.phaseG = this.phaseG;
155
+ serializationObject.extinction = this.extinction.asArray();
156
+ serializationObject.lightPower = this.lightPower.asArray();
157
+ return serializationObject;
158
+ }
159
+ _deserialize(serializationObject) {
160
+ super._deserialize(serializationObject);
161
+ this.phaseG = serializationObject.phaseG;
162
+ this.extinction = Vector3.FromArray(serializationObject.extinction);
163
+ this.lightPower = Color3.FromArray(serializationObject.lightPower);
164
+ }
165
+ }
166
+ __decorate([
167
+ editableInPropertyPage("PhaseG", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES", { min: -0.9, max: 0.9 })
168
+ ], NodeRenderGraphVolumetricLightingBlock.prototype, "phaseG", null);
169
+ __decorate([
170
+ editableInPropertyPage("Enable extinction", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
171
+ ], NodeRenderGraphVolumetricLightingBlock.prototype, "enableExtinction", null);
172
+ __decorate([
173
+ editableInPropertyPage("Extinction", 4 /* PropertyTypeForEdition.Vector3 */, "PROPERTIES")
174
+ ], NodeRenderGraphVolumetricLightingBlock.prototype, "extinction", null);
175
+ __decorate([
176
+ editableInPropertyPage("Light power", 6 /* PropertyTypeForEdition.Color3 */, "PROPERTIES")
177
+ ], NodeRenderGraphVolumetricLightingBlock.prototype, "lightPower", null);
178
+ RegisterClass("BABYLON.NodeRenderGraphVolumetricLightingBlock", NodeRenderGraphVolumetricLightingBlock);
179
+ //# sourceMappingURL=volumetricLightingBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"volumetricLightingBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/volumetricLightingBlock.ts"],"names":[],"mappings":";AAUA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO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,CAAC;wEAGlF;AAoGL,aAAa,CAAC,gDAAgD,EAAE,sCAAsC,CAAC,CAAC","sourcesContent":["import type {\r\n Camera,\r\n DirectionalLight,\r\n FrameGraph,\r\n FrameGraphObjectList,\r\n FrameGraphTextureHandle,\r\n NodeRenderGraphBuildState,\r\n NodeRenderGraphConnectionPoint,\r\n Scene,\r\n} from \"core/index\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { FrameGraphVolumetricLightingTask } from \"core/FrameGraph/Tasks/PostProcesses/volumetricLightingTask\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { Vector3 } from \"core/Maths/math.vector\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\n\r\n/**\r\n * Block that implements the volumetric lighting post process\r\n */\r\nexport class NodeRenderGraphVolumetricLightingBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphVolumetricLightingTask;\r\n\r\n public override _additionalConstructionParameters: [boolean];\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 NodeRenderGraphVolumetricLightingBlock\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 enableExtinction defines whether to enable extinction coefficients\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene, enableExtinction = false) {\r\n super(name, frameGraph, scene);\r\n\r\n this._additionalConstructionParameters = [enableExtinction];\r\n\r\n this.registerInput(\"target\", NodeRenderGraphBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"depth\", NodeRenderGraphBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"camera\", NodeRenderGraphBlockConnectionPointTypes.Camera);\r\n this.registerInput(\"lightingVolumeMesh\", NodeRenderGraphBlockConnectionPointTypes.ObjectList);\r\n this.registerInput(\"light\", NodeRenderGraphBlockConnectionPointTypes.ShadowLight);\r\n this.registerInput(\"lightingVolumeTexture\", NodeRenderGraphBlockConnectionPointTypes.AutoDetect, true);\r\n\r\n this.target.addExcludedConnectionPointFromAllowedTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n this.lightingVolumeTexture.addExcludedConnectionPointFromAllowedTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n\r\n this.depth.addExcludedConnectionPointFromAllowedTypes(\r\n NodeRenderGraphBlockConnectionPointTypes.TextureDepthStencilAttachment | NodeRenderGraphBlockConnectionPointTypes.TextureScreenDepth\r\n );\r\n\r\n this._addDependenciesInput();\r\n\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.output._typeConnectionSource = () => {\r\n return this.target;\r\n };\r\n\r\n this._frameGraphTask = new FrameGraphVolumetricLightingTask(name, frameGraph, enableExtinction);\r\n }\r\n\r\n private _createTask(enableExtinction: boolean) {\r\n const sourceSamplingMode = this._frameGraphTask.sourceSamplingMode;\r\n const phaseG = this._frameGraphTask.phaseG;\r\n const extinction = this._frameGraphTask.extinction;\r\n const lightPower = this._frameGraphTask.lightPower;\r\n\r\n this._frameGraphTask.dispose();\r\n\r\n this._frameGraphTask = new FrameGraphVolumetricLightingTask(this.name, this._frameGraph, enableExtinction);\r\n this._frameGraphTask.sourceSamplingMode = sourceSamplingMode;\r\n this._frameGraphTask.phaseG = phaseG;\r\n this._frameGraphTask.extinction = extinction;\r\n this._frameGraphTask.lightPower = lightPower;\r\n\r\n this._additionalConstructionParameters = [enableExtinction];\r\n }\r\n\r\n /** Gets or sets the phaseG parameter */\r\n @editableInPropertyPage(\"PhaseG\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: -0.9, max: 0.9 })\r\n public get phaseG(): number {\r\n return this._frameGraphTask.phaseG;\r\n }\r\n\r\n public set phaseG(value: number) {\r\n this._frameGraphTask.phaseG = value;\r\n }\r\n\r\n /** If extinction coefficients should be used */\r\n @editableInPropertyPage(\"Enable extinction\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get enableExtinction(): boolean {\r\n return this._frameGraphTask.enableExtinction;\r\n }\r\n\r\n public set enableExtinction(value: boolean) {\r\n this._createTask(value);\r\n }\r\n\r\n /** Gets or sets the extinction color */\r\n @editableInPropertyPage(\"Extinction\", PropertyTypeForEdition.Vector3, \"PROPERTIES\")\r\n public get extinction(): Vector3 {\r\n return this._frameGraphTask.extinction;\r\n }\r\n\r\n public set extinction(value: Vector3) {\r\n this._frameGraphTask.extinction = value;\r\n }\r\n\r\n /** Gets or sets the light power */\r\n @editableInPropertyPage(\"Light power\", PropertyTypeForEdition.Color3, \"PROPERTIES\")\r\n public get lightPower(): Color3 {\r\n return this._frameGraphTask.lightPower;\r\n }\r\n\r\n public set lightPower(value: Color3) {\r\n this._frameGraphTask.lightPower = 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 \"NodeRenderGraphVolumetricLightingBlock\";\r\n }\r\n\r\n /**\r\n * Gets the target input component\r\n */\r\n public get target(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the depth texture input component\r\n */\r\n public get depth(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\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[2];\r\n }\r\n\r\n /**\r\n * Gets the lighting volume mesh input component\r\n */\r\n public get lightingVolumeMesh(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the light input component\r\n */\r\n public get light(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the lighting volume texture input component\r\n */\r\n public get lightingVolumeTexture(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[5];\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.targetTexture = this.target.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.depthTexture = this.depth.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.camera = this.camera.connectedPoint?.value as Camera;\r\n this._frameGraphTask.lightingVolumeMesh = this.lightingVolumeMesh.connectedPoint?.value as FrameGraphObjectList;\r\n this._frameGraphTask.light = this.light.connectedPoint?.value as DirectionalLight;\r\n this._frameGraphTask.lightingVolumeTexture = this.lightingVolumeTexture.connectedPoint?.value as FrameGraphTextureHandle;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.phaseG = ${this.phaseG};`);\r\n codes.push(`${this._codeVariableName}.extinction = new BABYLON.Vector3(${this.extinction.x}, ${this.extinction.y}, ${this.extinction.z});`);\r\n codes.push(`${this._codeVariableName}.lightPower = new Color3(${this.lightPower.r}, ${this.lightPower.g}, ${this.lightPower.b});`);\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.phaseG = this.phaseG;\r\n serializationObject.extinction = this.extinction.asArray();\r\n serializationObject.lightPower = this.lightPower.asArray();\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.phaseG = serializationObject.phaseG;\r\n this.extinction = Vector3.FromArray(serializationObject.extinction);\r\n this.lightPower = Color3.FromArray(serializationObject.lightPower);\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphVolumetricLightingBlock\", NodeRenderGraphVolumetricLightingBlock);\r\n"]}
@@ -3,6 +3,7 @@ export * from "./cullObjectsBlock.js";
3
3
  export * from "./elbowBlock.js";
4
4
  export * from "./executeBlock.js";
5
5
  export * from "./inputBlock.js";
6
+ export * from "./lightingVolumeBlock.js";
6
7
  export * from "./outputBlock.js";
7
8
  export * from "./resourceContainerBlock.js";
8
9
  export * from "./Layers/glowLayerBlock.js";
@@ -31,6 +32,7 @@ export * from "./PostProcesses/ssao2PostProcessBlock.js";
31
32
  export * from "./PostProcesses/ssrPostProcessBlock.js";
32
33
  export * from "./PostProcesses/taaPostProcessBlock.js";
33
34
  export * from "./PostProcesses/tonemapPostProcessBlock.js";
35
+ export * from "./PostProcesses/volumetricLightingBlock.js";
34
36
  export * from "./Rendering/csmShadowGeneratorBlock.js";
35
37
  export * from "./Rendering/geometryRendererBlock.js";
36
38
  export * from "./Rendering/objectRendererBlock.js";
@@ -3,6 +3,7 @@ export * from "./cullObjectsBlock.js";
3
3
  export * from "./elbowBlock.js";
4
4
  export * from "./executeBlock.js";
5
5
  export * from "./inputBlock.js";
6
+ export * from "./lightingVolumeBlock.js";
6
7
  export * from "./outputBlock.js";
7
8
  export * from "./resourceContainerBlock.js";
8
9
  export * from "./Layers/glowLayerBlock.js";
@@ -31,6 +32,7 @@ export * from "./PostProcesses/ssao2PostProcessBlock.js";
31
32
  export * from "./PostProcesses/ssrPostProcessBlock.js";
32
33
  export * from "./PostProcesses/taaPostProcessBlock.js";
33
34
  export * from "./PostProcesses/tonemapPostProcessBlock.js";
35
+ export * from "./PostProcesses/volumetricLightingBlock.js";
34
36
  export * from "./Rendering/csmShadowGeneratorBlock.js";
35
37
  export * from "./Rendering/geometryRendererBlock.js";
36
38
  export * from "./Rendering/objectRendererBlock.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Node/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\nexport * from \"./elbowBlock\";\r\nexport * from \"./executeBlock\";\r\nexport * from \"./inputBlock\";\r\nexport * from \"./outputBlock\";\r\nexport * from \"./resourceContainerBlock\";\r\n\r\nexport * from \"./Layers/glowLayerBlock\";\r\nexport * from \"./Layers/highlightLayerBlock\";\r\n\r\nexport * from \"./PostProcesses/anaglyphPostProcessBlock\";\r\nexport * from \"./PostProcesses/basePostProcessBlock\";\r\nexport * from \"./PostProcesses/baseWithPropertiesPostProcessBlock\";\r\nexport * from \"./PostProcesses/blackAndWhitePostProcessBlock\";\r\nexport * from \"./PostProcesses/bloomPostProcessBlock\";\r\nexport * from \"./PostProcesses/blurPostProcessBlock\";\r\nexport * from \"./PostProcesses/chromaticAberrationPostProcessBlock\";\r\nexport * from \"./PostProcesses/circleOfConfusionPostProcessBlock\";\r\nexport * from \"./PostProcesses/colorCorrectionPostProcessBlock\";\r\nexport * from \"./PostProcesses/convolutionPostProcessBlock\";\r\nexport * from \"./PostProcesses/depthOfFieldPostProcessBlock\";\r\nexport * from \"./PostProcesses/extractHighlightsPostProcessBlock\";\r\nexport * from \"./PostProcesses/filterPostProcessBlock\";\r\nexport * from \"./PostProcesses/fxaaPostProcessBlock\";\r\nexport * from \"./PostProcesses/grainPostProcessBlock\";\r\nexport * from \"./PostProcesses/imageProcessingPostProcessBlock\";\r\nexport * from \"./PostProcesses/motionBlurPostProcessBlock\";\r\nexport * from \"./PostProcesses/passPostProcessBlock\";\r\nexport * from \"./PostProcesses/sharpenPostProcessBlock\";\r\nexport * from \"./PostProcesses/screenSpaceCurvaturePostProcessBlock\";\r\nexport * from \"./PostProcesses/ssao2PostProcessBlock\";\r\nexport * from \"./PostProcesses/ssrPostProcessBlock\";\r\nexport * from \"./PostProcesses/taaPostProcessBlock\";\r\nexport * from \"./PostProcesses/tonemapPostProcessBlock\";\r\n\r\nexport * from \"./Rendering/csmShadowGeneratorBlock\";\r\nexport * from \"./Rendering/geometryRendererBlock\";\r\nexport * from \"./Rendering/objectRendererBlock\";\r\nexport * from \"./Rendering/shadowGeneratorBlock\";\r\nexport * from \"./Rendering/utilityLayerRendererBlock\";\r\n\r\nexport * from \"./Teleport/teleportInBlock\";\r\nexport * from \"./Teleport/teleportOutBlock\";\r\n\r\nexport * from \"./Textures/clearBlock\";\r\nexport * from \"./Textures/copyTextureBlock\";\r\nexport * from \"./Textures/generateMipmapsBlock\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Node/Blocks/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AAEzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAE7C,cAAc,0CAA0C,CAAC;AACzD,cAAc,sCAAsC,CAAC;AACrD,cAAc,oDAAoD,CAAC;AACnE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,uCAAuC,CAAC;AACtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,qDAAqD,CAAC;AACpE,cAAc,mDAAmD,CAAC;AAClE,cAAc,iDAAiD,CAAC;AAChE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,mDAAmD,CAAC;AAClE,cAAc,wCAAwC,CAAC;AACvD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,iDAAiD,CAAC;AAChE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,sCAAsC,CAAC;AACrD,cAAc,yCAAyC,CAAC;AACxD,cAAc,sDAAsD,CAAC;AACrE,cAAc,uCAAuC,CAAC;AACtD,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AAExD,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AAEtD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAE5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC","sourcesContent":["export * from \"./computeShaderBlock\";\r\nexport * from \"./cullObjectsBlock\";\r\nexport * from \"./elbowBlock\";\r\nexport * from \"./executeBlock\";\r\nexport * from \"./inputBlock\";\r\nexport * from \"./lightingVolumeBlock\";\r\nexport * from \"./outputBlock\";\r\nexport * from \"./resourceContainerBlock\";\r\n\r\nexport * from \"./Layers/glowLayerBlock\";\r\nexport * from \"./Layers/highlightLayerBlock\";\r\n\r\nexport * from \"./PostProcesses/anaglyphPostProcessBlock\";\r\nexport * from \"./PostProcesses/basePostProcessBlock\";\r\nexport * from \"./PostProcesses/baseWithPropertiesPostProcessBlock\";\r\nexport * from \"./PostProcesses/blackAndWhitePostProcessBlock\";\r\nexport * from \"./PostProcesses/bloomPostProcessBlock\";\r\nexport * from \"./PostProcesses/blurPostProcessBlock\";\r\nexport * from \"./PostProcesses/chromaticAberrationPostProcessBlock\";\r\nexport * from \"./PostProcesses/circleOfConfusionPostProcessBlock\";\r\nexport * from \"./PostProcesses/colorCorrectionPostProcessBlock\";\r\nexport * from \"./PostProcesses/convolutionPostProcessBlock\";\r\nexport * from \"./PostProcesses/depthOfFieldPostProcessBlock\";\r\nexport * from \"./PostProcesses/extractHighlightsPostProcessBlock\";\r\nexport * from \"./PostProcesses/filterPostProcessBlock\";\r\nexport * from \"./PostProcesses/fxaaPostProcessBlock\";\r\nexport * from \"./PostProcesses/grainPostProcessBlock\";\r\nexport * from \"./PostProcesses/imageProcessingPostProcessBlock\";\r\nexport * from \"./PostProcesses/motionBlurPostProcessBlock\";\r\nexport * from \"./PostProcesses/passPostProcessBlock\";\r\nexport * from \"./PostProcesses/sharpenPostProcessBlock\";\r\nexport * from \"./PostProcesses/screenSpaceCurvaturePostProcessBlock\";\r\nexport * from \"./PostProcesses/ssao2PostProcessBlock\";\r\nexport * from \"./PostProcesses/ssrPostProcessBlock\";\r\nexport * from \"./PostProcesses/taaPostProcessBlock\";\r\nexport * from \"./PostProcesses/tonemapPostProcessBlock\";\r\nexport * from \"./PostProcesses/volumetricLightingBlock\";\r\n\r\nexport * from \"./Rendering/csmShadowGeneratorBlock\";\r\nexport * from \"./Rendering/geometryRendererBlock\";\r\nexport * from \"./Rendering/objectRendererBlock\";\r\nexport * from \"./Rendering/shadowGeneratorBlock\";\r\nexport * from \"./Rendering/utilityLayerRendererBlock\";\r\n\r\nexport * from \"./Teleport/teleportInBlock\";\r\nexport * from \"./Teleport/teleportOutBlock\";\r\n\r\nexport * from \"./Textures/clearBlock\";\r\nexport * from \"./Textures/copyTextureBlock\";\r\nexport * from \"./Textures/generateMipmapsBlock\";\r\n"]}
@@ -0,0 +1,46 @@
1
+ import type { FrameGraph, NodeRenderGraphBuildState, NodeRenderGraphConnectionPoint, Scene } from "../../../index.js";
2
+ import { FrameGraphLightingVolumeTask } from "../../Tasks/Misc/lightingVolumeTask.js";
3
+ import { NodeRenderGraphBlock } from "../nodeRenderGraphBlock.js";
4
+ /**
5
+ * Block that implements the lighting volume
6
+ */
7
+ export declare class NodeRenderGraphLightingVolumeBlock extends NodeRenderGraphBlock {
8
+ protected _frameGraphTask: FrameGraphLightingVolumeTask;
9
+ /**
10
+ * Gets the frame graph task associated with this block
11
+ */
12
+ get task(): FrameGraphLightingVolumeTask;
13
+ /**
14
+ * Create a new NodeRenderGraphLightingVolumeBlock
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
+ /** Gets or sets the tesselation parameter */
21
+ get tesselation(): number;
22
+ set tesselation(value: number);
23
+ /** Gets or sets the refresh frequency parameter */
24
+ get frequency(): number;
25
+ set frequency(value: number);
26
+ /** Indicates whether to build the full volume (true) or only the far plane (false). Default is false. */
27
+ get buildFullVolume(): boolean;
28
+ set buildFullVolume(value: boolean);
29
+ /**
30
+ * Gets the current class name
31
+ * @returns the class name
32
+ */
33
+ getClassName(): string;
34
+ /**
35
+ * Gets the shadow generator input component
36
+ */
37
+ get shadowGenerator(): NodeRenderGraphConnectionPoint;
38
+ /**
39
+ * Gets the output component
40
+ */
41
+ get output(): NodeRenderGraphConnectionPoint;
42
+ protected _buildBlock(state: NodeRenderGraphBuildState): void;
43
+ protected _dumpPropertiesCode(): string;
44
+ serialize(): any;
45
+ _deserialize(serializationObject: any): void;
46
+ }
@@ -0,0 +1,106 @@
1
+ import { __decorate } from "../../../tslib.es6.js";
2
+ import { FrameGraphLightingVolumeTask } from "../../Tasks/Misc/lightingVolumeTask.js";
3
+ import { RegisterClass } from "../../../Misc/typeStore.js";
4
+ import { editableInPropertyPage } from "../../../Decorators/nodeDecorator.js";
5
+ import { NodeRenderGraphBlock } from "../nodeRenderGraphBlock.js";
6
+ import { NodeRenderGraphBlockConnectionPointTypes } from "../Types/nodeRenderGraphTypes.js";
7
+ /**
8
+ * Block that implements the lighting volume
9
+ */
10
+ export class NodeRenderGraphLightingVolumeBlock 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 NodeRenderGraphLightingVolumeBlock
19
+ * @param name defines the block name
20
+ * @param frameGraph defines the hosting frame graph
21
+ * @param scene defines the hosting scene
22
+ */
23
+ constructor(name, frameGraph, scene) {
24
+ super(name, frameGraph, scene);
25
+ this.registerInput("shadowGenerator", NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator);
26
+ this._addDependenciesInput();
27
+ this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.ObjectList);
28
+ this._frameGraphTask = new FrameGraphLightingVolumeTask(name, frameGraph);
29
+ }
30
+ /** Gets or sets the tesselation parameter */
31
+ get tesselation() {
32
+ return this._frameGraphTask.lightingVolume.tesselation;
33
+ }
34
+ set tesselation(value) {
35
+ this._frameGraphTask.lightingVolume.tesselation = value;
36
+ }
37
+ /** Gets or sets the refresh frequency parameter */
38
+ get frequency() {
39
+ return this._frameGraphTask.lightingVolume.frequency;
40
+ }
41
+ set frequency(value) {
42
+ this._frameGraphTask.lightingVolume.frequency = value;
43
+ }
44
+ /** Indicates whether to build the full volume (true) or only the far plane (false). Default is false. */
45
+ get buildFullVolume() {
46
+ return this._frameGraphTask.lightingVolume.buildFullVolume;
47
+ }
48
+ set buildFullVolume(value) {
49
+ this._frameGraphTask.lightingVolume.buildFullVolume = value;
50
+ }
51
+ /**
52
+ * Gets the current class name
53
+ * @returns the class name
54
+ */
55
+ getClassName() {
56
+ return "NodeRenderGraphLightingVolumeBlock";
57
+ }
58
+ /**
59
+ * Gets the shadow generator input component
60
+ */
61
+ get shadowGenerator() {
62
+ return this._inputs[0];
63
+ }
64
+ /**
65
+ * Gets the output component
66
+ */
67
+ get output() {
68
+ return this._outputs[0];
69
+ }
70
+ _buildBlock(state) {
71
+ super._buildBlock(state);
72
+ this.output.value = this._frameGraphTask.outputMeshLightingVolume;
73
+ this._frameGraphTask.shadowGenerator = this.shadowGenerator.connectedPoint?.value;
74
+ }
75
+ _dumpPropertiesCode() {
76
+ const codes = [];
77
+ codes.push(`${this._codeVariableName}.tesselation = ${this.tesselation};`);
78
+ codes.push(`${this._codeVariableName}.frequency = ${this.frequency};`);
79
+ codes.push(`${this._codeVariableName}.buildFullVolume = ${this.buildFullVolume};`);
80
+ return super._dumpPropertiesCode() + codes.join("\n");
81
+ }
82
+ serialize() {
83
+ const serializationObject = super.serialize();
84
+ serializationObject.tesselation = this.tesselation;
85
+ serializationObject.frequency = this.frequency;
86
+ serializationObject.buildFullVolume = this.buildFullVolume;
87
+ return serializationObject;
88
+ }
89
+ _deserialize(serializationObject) {
90
+ super._deserialize(serializationObject);
91
+ this.tesselation = serializationObject.tesselation;
92
+ this.frequency = serializationObject.frequency;
93
+ this.buildFullVolume = !!serializationObject.buildFullVolume;
94
+ }
95
+ }
96
+ __decorate([
97
+ editableInPropertyPage("Tesselation", 2 /* PropertyTypeForEdition.Int */, "PROPERTIES", { min: 1, max: 4096 })
98
+ ], NodeRenderGraphLightingVolumeBlock.prototype, "tesselation", null);
99
+ __decorate([
100
+ editableInPropertyPage("Refresh frequency", 2 /* PropertyTypeForEdition.Int */, "PROPERTIES")
101
+ ], NodeRenderGraphLightingVolumeBlock.prototype, "frequency", null);
102
+ __decorate([
103
+ editableInPropertyPage("Build full volume", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
104
+ ], NodeRenderGraphLightingVolumeBlock.prototype, "buildFullVolume", null);
105
+ RegisterClass("BABYLON.NodeRenderGraphLightingVolumeBlock", NodeRenderGraphLightingVolumeBlock);
106
+ //# sourceMappingURL=lightingVolumeBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lightingVolumeBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Node/Blocks/lightingVolumeBlock.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,4BAA4B,EAAE,+CAAsD;AAC7F,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAA0B,MAAM,mCAAmC,CAAC;AACnG,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,wCAAwC,EAAE,MAAM,+BAA+B,CAAC;AAEzF;;GAEG;AACH,MAAM,OAAO,kCAAmC,SAAQ,oBAAoB;IAGxE;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;OAKG;IACH,YAAmB,IAA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QAC/C,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,mBAAmB,CAAC,eAAe,CAAC;IACjE,CAAC;CACJ;AAhFG;IADC,sBAAsB,CAAC,aAAa,sCAA8B,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;qEAGtG;AAQD;IADC,sBAAsB,CAAC,mBAAmB,sCAA8B,YAAY,CAAC;mEAGrF;AAQD;IADC,sBAAsB,CAAC,mBAAmB,0CAAkC,YAAY,CAAC;yEAGzF;AA4DL,aAAa,CAAC,4CAA4C,EAAE,kCAAkC,CAAC,CAAC","sourcesContent":["import type { FrameGraph, FrameGraphShadowGeneratorTask, NodeRenderGraphBuildState, NodeRenderGraphConnectionPoint, Scene } from \"core/index\";\r\nimport { FrameGraphLightingVolumeTask } from \"core/FrameGraph/Tasks/Misc/lightingVolumeTask\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../Decorators/nodeDecorator\";\r\nimport { NodeRenderGraphBlock } from \"../nodeRenderGraphBlock\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../Types/nodeRenderGraphTypes\";\r\n\r\n/**\r\n * Block that implements the lighting volume\r\n */\r\nexport class NodeRenderGraphLightingVolumeBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphLightingVolumeTask;\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 NodeRenderGraphLightingVolumeBlock\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(\"shadowGenerator\", NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator);\r\n\r\n this._addDependenciesInput();\r\n\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.ObjectList);\r\n\r\n this._frameGraphTask = new FrameGraphLightingVolumeTask(name, frameGraph);\r\n }\r\n\r\n /** Gets or sets the tesselation parameter */\r\n @editableInPropertyPage(\"Tesselation\", PropertyTypeForEdition.Int, \"PROPERTIES\", { min: 1, max: 4096 })\r\n public get tesselation(): number {\r\n return this._frameGraphTask.lightingVolume.tesselation;\r\n }\r\n\r\n public set tesselation(value: number) {\r\n this._frameGraphTask.lightingVolume.tesselation = value;\r\n }\r\n\r\n /** Gets or sets the refresh frequency parameter */\r\n @editableInPropertyPage(\"Refresh frequency\", PropertyTypeForEdition.Int, \"PROPERTIES\")\r\n public get frequency(): number {\r\n return this._frameGraphTask.lightingVolume.frequency;\r\n }\r\n\r\n public set frequency(value: number) {\r\n this._frameGraphTask.lightingVolume.frequency = value;\r\n }\r\n\r\n /** Indicates whether to build the full volume (true) or only the far plane (false). Default is false. */\r\n @editableInPropertyPage(\"Build full volume\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get buildFullVolume(): boolean {\r\n return this._frameGraphTask.lightingVolume.buildFullVolume;\r\n }\r\n\r\n public set buildFullVolume(value: boolean) {\r\n this._frameGraphTask.lightingVolume.buildFullVolume = 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 \"NodeRenderGraphLightingVolumeBlock\";\r\n }\r\n\r\n /**\r\n * Gets the shadow generator input component\r\n */\r\n public get shadowGenerator(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\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.outputMeshLightingVolume;\r\n\r\n this._frameGraphTask.shadowGenerator = this.shadowGenerator.connectedPoint?.value as FrameGraphShadowGeneratorTask;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.tesselation = ${this.tesselation};`);\r\n codes.push(`${this._codeVariableName}.frequency = ${this.frequency};`);\r\n codes.push(`${this._codeVariableName}.buildFullVolume = ${this.buildFullVolume};`);\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.tesselation = this.tesselation;\r\n serializationObject.frequency = this.frequency;\r\n serializationObject.buildFullVolume = this.buildFullVolume;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.tesselation = serializationObject.tesselation;\r\n this.frequency = serializationObject.frequency;\r\n this.buildFullVolume = !!serializationObject.buildFullVolume;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphLightingVolumeBlock\", NodeRenderGraphLightingVolumeBlock);\r\n"]}
@@ -1,4 +1,4 @@
1
- import type { Nullable, NodeRenderGraphBlock, INodeRenderGraphCreateOptions, INodeRenderGraphEditorOptions, Scene, INodeRenderGraphCustomBlockDescription } from "../../index.js";
1
+ import type { Nullable, NodeRenderGraphBlock, INodeRenderGraphCreateOptions, INodeRenderGraphEditorOptions, Scene, INodeRenderGraphCustomBlockDescription, Immutable } from "../../index.js";
2
2
  import { Observable } from "../../Misc/observable.js";
3
3
  import { NodeRenderGraphOutputBlock } from "./Blocks/outputBlock.js";
4
4
  import { FrameGraph } from "../frameGraph.js";
@@ -28,7 +28,11 @@ export declare class NodeRenderGraph {
28
28
  */
29
29
  attachedBlocks: NodeRenderGraphBlock[];
30
30
  /**
31
- * Observable raised when the node render graph is built
31
+ * Observable raised before the node render graph is built
32
+ */
33
+ onBeforeBuildObservable: Observable<FrameGraph>;
34
+ /**
35
+ * Observable raised after the node render graph is built
32
36
  * Note that this is the same observable as the one in the underlying FrameGraph!
33
37
  */
34
38
  get onBuildObservable(): Observable<FrameGraph>;
@@ -64,6 +68,10 @@ export declare class NodeRenderGraph {
64
68
  * @returns the scene used by this node render graph
65
69
  */
66
70
  getScene(): Scene;
71
+ /**
72
+ * Gets the options used to create this node render graph
73
+ */
74
+ get options(): Immutable<INodeRenderGraphCreateOptions>;
67
75
  /**
68
76
  * Creates a new node render graph
69
77
  * @param name defines the name of the node render graph
@@ -111,16 +119,24 @@ export declare class NodeRenderGraph {
111
119
  */
112
120
  private _createNodeEditor;
113
121
  /**
114
- * Build the final list of blocks that will be executed by the "execute" method
122
+ * @deprecated Use buildAsync instead
115
123
  * @param dontBuildFrameGraph If the underlying frame graph should not be built (default: false)
116
124
  */
117
125
  build(dontBuildFrameGraph?: boolean): void;
126
+ /**
127
+ * Build the final list of blocks that will be executed by the "execute" method.
128
+ * It also builds the underlying frame graph unless specified otherwise.
129
+ * @param dontBuildFrameGraph If the underlying frame graph should not be built (default: false)
130
+ * @param waitForReadiness If the method should wait for the frame graph to be ready before resolving (default: true). Note that this parameter has no effect if "dontBuildFrameGraph" is true.
131
+ * @param setAsSceneFrameGraph If the built frame graph must be set as the scene's frame graph (default: true)
132
+ */
133
+ buildAsync(dontBuildFrameGraph?: boolean, waitForReadiness?: boolean, setAsSceneFrameGraph?: boolean): Promise<void>;
118
134
  private _autoFillExternalInputs;
119
135
  /**
120
136
  * Returns a promise that resolves when the node render graph is ready to be executed
121
137
  * This method must be called after the graph has been built (NodeRenderGraph.build called)!
122
138
  * @param timeStep Time step in ms between retries (default is 16)
123
- * @param maxTimeout Maximum time in ms to wait for the graph to be ready (default is 5000)
139
+ * @param maxTimeout Maximum time in ms to wait for the graph to be ready (default is 10000)
124
140
  * @returns The promise that resolves when the graph is ready
125
141
  */
126
142
  whenReadyAsync(timeStep?: number, maxTimeout?: number): Promise<void>;
@@ -157,6 +173,7 @@ export declare class NodeRenderGraph {
157
173
  setToDefault(): void;
158
174
  /**
159
175
  * Makes a duplicate of the current node render graph.
176
+ * Note that you should call buildAsync() on the returned graph to make it usable.
160
177
  * @param name defines the name to use for the new node render graph
161
178
  * @returns the new node render graph
162
179
  */
@@ -178,7 +195,7 @@ export declare class NodeRenderGraph {
178
195
  * @param nodeRenderGraphOptions defines options to use when creating the node render graph
179
196
  * @returns a new NodeRenderGraph
180
197
  */
181
- static CreateDefault(name: string, scene: Scene, nodeRenderGraphOptions?: INodeRenderGraphCreateOptions): NodeRenderGraph;
198
+ static CreateDefaultAsync(name: string, scene: Scene, nodeRenderGraphOptions?: INodeRenderGraphCreateOptions): Promise<NodeRenderGraph>;
182
199
  /**
183
200
  * Creates a node render graph from parsed graph data
184
201
  * @param source defines the JSON representation of the node render graph