@babylonjs/core 7.39.0 → 7.39.2
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.
- package/Cameras/arcRotateCamera.d.ts +1 -1
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/targetCamera.js +6 -0
- package/Cameras/targetCamera.js.map +1 -1
- package/Debug/directionalLightFrustumViewer.d.ts +2 -1
- package/Debug/directionalLightFrustumViewer.js +4 -3
- package/Debug/directionalLightFrustumViewer.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.js +1 -0
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/constants.d.ts +8 -0
- package/Engines/constants.js +8 -0
- package/Engines/constants.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js +3 -9
- package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js +3 -9
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js +3 -9
- package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js +5 -17
- package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js +5 -17
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js +3 -9
- package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.d.ts +6 -1
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +40 -20
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.d.ts +77 -0
- package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js +250 -0
- package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.d.ts +57 -0
- package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.js +169 -0
- package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/cullObjectsBlock.js +3 -9
- package/FrameGraph/Node/Blocks/Rendering/cullObjectsBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js +4 -13
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.d.ts +6 -0
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js +27 -0
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/shadowGeneratorBlock.d.ts +19 -0
- package/FrameGraph/Node/Blocks/Rendering/shadowGeneratorBlock.js +28 -0
- package/FrameGraph/Node/Blocks/Rendering/shadowGeneratorBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Textures/clearBlock.js +3 -9
- package/FrameGraph/Node/Blocks/Textures/clearBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js +3 -9
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js +2 -5
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/executeBlock.d.ts +29 -0
- package/FrameGraph/Node/Blocks/executeBlock.js +43 -0
- package/FrameGraph/Node/Blocks/executeBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/index.d.ts +4 -0
- package/FrameGraph/Node/Blocks/index.js +4 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Node/Blocks/inputBlock.d.ts +7 -2
- package/FrameGraph/Node/Blocks/inputBlock.js +13 -0
- package/FrameGraph/Node/Blocks/inputBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/resourceContainerBlock.d.ts +55 -0
- package/FrameGraph/Node/Blocks/resourceContainerBlock.js +97 -0
- package/FrameGraph/Node/Blocks/resourceContainerBlock.js.map +1 -0
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +13 -10
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +11 -4
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js +32 -4
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraphBlock.d.ts +1 -0
- package/FrameGraph/Node/nodeRenderGraphBlock.js +11 -0
- package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.d.ts +18 -0
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js +24 -0
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js.map +1 -1
- package/FrameGraph/Passes/cullPass.d.ts +1 -1
- package/FrameGraph/Passes/cullPass.js.map +1 -1
- package/FrameGraph/Tasks/Misc/executeTask.d.ts +22 -0
- package/FrameGraph/Tasks/Misc/executeTask.js +28 -0
- package/FrameGraph/Tasks/Misc/executeTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.d.ts +72 -0
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js +183 -0
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +16 -5
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js +46 -0
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.d.ts +107 -0
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js +264 -0
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js.map +1 -0
- package/FrameGraph/Tasks/Texture/clearTextureTask.js +7 -0
- package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
- package/FrameGraph/frameGraph.d.ts +9 -0
- package/FrameGraph/frameGraph.js +12 -3
- package/FrameGraph/frameGraph.js.map +1 -1
- package/FrameGraph/frameGraphTextureManager.js +4 -1
- package/FrameGraph/frameGraphTextureManager.js.map +1 -1
- package/FrameGraph/index.d.ts +5 -0
- package/FrameGraph/index.js +5 -0
- package/FrameGraph/index.js.map +1 -1
- package/Inputs/scene.inputManager.d.ts +1 -1
- package/Inputs/scene.inputManager.js +8 -1
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.d.ts +1 -1
- package/Lights/Shadows/shadowGenerator.js +2 -7
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Lights/directionalLight.d.ts +5 -4
- package/Lights/directionalLight.js +7 -9
- package/Lights/directionalLight.js.map +1 -1
- package/Lights/shadowLight.d.ts +4 -4
- package/Lights/shadowLight.js +3 -2
- package/Lights/shadowLight.js.map +1 -1
- package/Lights/spotLight.d.ts +2 -2
- package/Lights/spotLight.js +3 -2
- package/Lights/spotLight.js.map +1 -1
- package/Loading/sceneLoader.d.ts +1 -1
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/GreasedLine/greasedLinePluginMaterial.js +1 -1
- package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
- package/Materials/PBR/pbrMetallicRoughnessMaterial.js +18 -6
- package/Materials/PBR/pbrMetallicRoughnessMaterial.js.map +1 -1
- package/Materials/PBR/pbrSpecularGlossinessMaterial.js +18 -6
- package/Materials/PBR/pbrSpecularGlossinessMaterial.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +2 -0
- package/Materials/Textures/renderTargetTexture.js +18 -8
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/material.d.ts +1 -4
- package/Materials/material.js +29 -24
- package/Materials/material.js.map +1 -1
- package/Materials/materialPluginBase.d.ts +4 -0
- package/Materials/materialPluginBase.js +4 -0
- package/Materials/materialPluginBase.js.map +1 -1
- package/Maths/math.color.js.map +1 -1
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +5 -3
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +14 -15
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/abstractMesh.js +7 -0
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/lattice.material.d.ts +3 -8
- package/Meshes/lattice.material.js.map +1 -1
- package/Misc/copyTextureToTexture.js +1 -1
- package/Misc/copyTextureToTexture.js.map +1 -1
- package/Misc/filesInput.d.ts +3 -1
- package/Misc/filesInput.js +8 -4
- package/Misc/filesInput.js.map +1 -1
- package/PostProcesses/postProcess.d.ts +2 -2
- package/PostProcesses/postProcess.js +4 -4
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/postProcessManager.js +1 -1
- package/PostProcesses/postProcessManager.js.map +1 -1
- package/Rendering/objectRenderer.js +8 -0
- package/Rendering/objectRenderer.js.map +1 -1
- package/Shaders/ShadersInclude/lightsFragmentFunctions.js +1 -1
- package/Shaders/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
- package/Shaders/default.fragment.js +2 -1
- package/Shaders/default.fragment.js.map +1 -1
- package/Shaders/default.vertex.js +2 -1
- package/Shaders/default.vertex.js.map +1 -1
- package/Shaders/pbr.fragment.js +2 -1
- package/Shaders/pbr.fragment.js.map +1 -1
- package/Shaders/pbr.vertex.js +2 -1
- package/Shaders/pbr.vertex.js.map +1 -1
- package/XR/webXRCamera.js +3 -0
- package/XR/webXRCamera.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +7 -0
- package/scene.js +10 -1
- package/scene.js.map +1 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
2
|
+
import { NodeRenderGraphBlockConnectionPointTypes } from "../Types/nodeRenderGraphTypes.js";
|
|
3
|
+
import { NodeRenderGraphBlock } from "../nodeRenderGraphBlock.js";
|
|
4
|
+
import { FrameGraphExecuteTask } from "../../Tasks/Misc/executeTask.js";
|
|
5
|
+
/**
|
|
6
|
+
* Block used to execute a custom function in the frame graph
|
|
7
|
+
*/
|
|
8
|
+
export class NodeRenderGraphExecuteBlock extends NodeRenderGraphBlock {
|
|
9
|
+
/**
|
|
10
|
+
* Gets the frame graph task associated with this block
|
|
11
|
+
*/
|
|
12
|
+
get task() {
|
|
13
|
+
return this._frameGraphTask;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new NodeRenderGraphExecuteBlock
|
|
17
|
+
* @param name defines the block name
|
|
18
|
+
* @param frameGraph defines the hosting frame graph
|
|
19
|
+
* @param scene defines the hosting scene
|
|
20
|
+
*/
|
|
21
|
+
constructor(name, frameGraph, scene) {
|
|
22
|
+
super(name, frameGraph, scene);
|
|
23
|
+
const dependencies = this._addDependenciesInput();
|
|
24
|
+
dependencies.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.Camera | NodeRenderGraphBlockConnectionPointTypes.ShadowLight | NodeRenderGraphBlockConnectionPointTypes.ObjectList);
|
|
25
|
+
this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.ResourceContainer);
|
|
26
|
+
this._frameGraphTask = new FrameGraphExecuteTask(name, frameGraph);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Gets the current class name
|
|
30
|
+
* @returns the class name
|
|
31
|
+
*/
|
|
32
|
+
getClassName() {
|
|
33
|
+
return "NodeRenderGraphExecuteBlock";
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Gets the output component
|
|
37
|
+
*/
|
|
38
|
+
get output() {
|
|
39
|
+
return this._outputs[0];
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
RegisterClass("BABYLON.NodeRenderGraphExecuteBlock", NodeRenderGraphExecuteBlock);
|
|
43
|
+
//# sourceMappingURL=executeBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executeBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Node/Blocks/executeBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,wCAAwC,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE;;GAEG;AACH,MAAM,OAAO,2BAA4B,SAAQ,oBAAoB;IAGjE;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;OAKG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,KAAY;QACjE,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAE/B,MAAM,YAAY,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAElD,YAAY,CAAC,+BAA+B,CACxC,wCAAwC,CAAC,MAAM,GAAG,wCAAwC,CAAC,WAAW,GAAG,wCAAwC,CAAC,UAAU,CAC/J,CAAC;QAEF,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,wCAAwC,CAAC,iBAAiB,CAAC,CAAC;QAE1F,IAAI,CAAC,eAAe,GAAG,IAAI,qBAAqB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACvE,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,OAAO,6BAA6B,CAAC;IACzC,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;CACJ;AAED,aAAa,CAAC,qCAAqC,EAAE,2BAA2B,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, FrameGraph } from \"core/index\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../Types/nodeRenderGraphTypes\";\r\nimport { NodeRenderGraphBlock } from \"../nodeRenderGraphBlock\";\r\nimport { FrameGraphExecuteTask } from \"../../Tasks/Misc/executeTask\";\r\n\r\n/**\r\n * Block used to execute a custom function in the frame graph\r\n */\r\nexport class NodeRenderGraphExecuteBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphExecuteTask;\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 * Creates a new NodeRenderGraphExecuteBlock\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 const dependencies = this._addDependenciesInput();\r\n\r\n dependencies.addAcceptedConnectionPointTypes(\r\n NodeRenderGraphBlockConnectionPointTypes.Camera | NodeRenderGraphBlockConnectionPointTypes.ShadowLight | NodeRenderGraphBlockConnectionPointTypes.ObjectList\r\n );\r\n\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.ResourceContainer);\r\n\r\n this._frameGraphTask = new FrameGraphExecuteTask(name, frameGraph);\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 \"NodeRenderGraphExecuteBlock\";\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\r\nRegisterClass(\"BABYLON.NodeRenderGraphExecuteBlock\", NodeRenderGraphExecuteBlock);\r\n"]}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
export * from "./elbowBlock";
|
|
2
|
+
export * from "./executeBlock";
|
|
2
3
|
export * from "./inputBlock";
|
|
3
4
|
export * from "./outputBlock";
|
|
5
|
+
export * from "./resourceContainerBlock";
|
|
4
6
|
export * from "./PostProcesses/blackAndWhitePostProcessBlock";
|
|
5
7
|
export * from "./PostProcesses/bloomPostProcessBlock";
|
|
6
8
|
export * from "./PostProcesses/blurPostProcessBlock";
|
|
7
9
|
export * from "./PostProcesses/circleOfConfusionPostProcessBlock";
|
|
8
10
|
export * from "./PostProcesses/depthOfFieldPostProcessBlock";
|
|
9
11
|
export * from "./PostProcesses/extractHighlightsPostProcessBlock";
|
|
12
|
+
export * from "./Rendering/csmShadowGeneratorBlock";
|
|
10
13
|
export * from "./Rendering/cullObjectsBlock";
|
|
11
14
|
export * from "./Rendering/geometryRendererBlock";
|
|
12
15
|
export * from "./Rendering/objectRendererBlock";
|
|
16
|
+
export * from "./Rendering/shadowGeneratorBlock";
|
|
13
17
|
export * from "./Rendering/taaObjectRendererBlock";
|
|
14
18
|
export * from "./Teleport/teleportInBlock";
|
|
15
19
|
export * from "./Teleport/teleportOutBlock";
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
export * from "./elbowBlock.js";
|
|
2
|
+
export * from "./executeBlock.js";
|
|
2
3
|
export * from "./inputBlock.js";
|
|
3
4
|
export * from "./outputBlock.js";
|
|
5
|
+
export * from "./resourceContainerBlock.js";
|
|
4
6
|
export * from "./PostProcesses/blackAndWhitePostProcessBlock.js";
|
|
5
7
|
export * from "./PostProcesses/bloomPostProcessBlock.js";
|
|
6
8
|
export * from "./PostProcesses/blurPostProcessBlock.js";
|
|
7
9
|
export * from "./PostProcesses/circleOfConfusionPostProcessBlock.js";
|
|
8
10
|
export * from "./PostProcesses/depthOfFieldPostProcessBlock.js";
|
|
9
11
|
export * from "./PostProcesses/extractHighlightsPostProcessBlock.js";
|
|
12
|
+
export * from "./Rendering/csmShadowGeneratorBlock.js";
|
|
10
13
|
export * from "./Rendering/cullObjectsBlock.js";
|
|
11
14
|
export * from "./Rendering/geometryRendererBlock.js";
|
|
12
15
|
export * from "./Rendering/objectRendererBlock.js";
|
|
16
|
+
export * from "./Rendering/shadowGeneratorBlock.js";
|
|
13
17
|
export * from "./Rendering/taaObjectRendererBlock.js";
|
|
14
18
|
export * from "./Teleport/teleportInBlock.js";
|
|
15
19
|
export * from "./Teleport/teleportOutBlock.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Node/Blocks/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Node/Blocks/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AAEzC,cAAc,+CAA+C,CAAC;AAC9D,cAAc,uCAAuC,CAAC;AACtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,mDAAmD,CAAC;AAClE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,mDAAmD,CAAC;AAElE,cAAc,qCAAqC,CAAC;AACpD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC;AAEnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAE5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC","sourcesContent":["export * from \"./elbowBlock\";\r\nexport * from \"./executeBlock\";\r\nexport * from \"./inputBlock\";\r\nexport * from \"./outputBlock\";\r\nexport * from \"./resourceContainerBlock\";\r\n\r\nexport * from \"./PostProcesses/blackAndWhitePostProcessBlock\";\r\nexport * from \"./PostProcesses/bloomPostProcessBlock\";\r\nexport * from \"./PostProcesses/blurPostProcessBlock\";\r\nexport * from \"./PostProcesses/circleOfConfusionPostProcessBlock\";\r\nexport * from \"./PostProcesses/depthOfFieldPostProcessBlock\";\r\nexport * from \"./PostProcesses/extractHighlightsPostProcessBlock\";\r\n\r\nexport * from \"./Rendering/csmShadowGeneratorBlock\";\r\nexport * from \"./Rendering/cullObjectsBlock\";\r\nexport * from \"./Rendering/geometryRendererBlock\";\r\nexport * from \"./Rendering/objectRendererBlock\";\r\nexport * from \"./Rendering/shadowGeneratorBlock\";\r\nexport * from \"./Rendering/taaObjectRendererBlock\";\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,8 +1,8 @@
|
|
|
1
|
-
import type { NodeRenderGraphConnectionPoint, Scene, FrameGraph, NodeRenderGraphBuildState, Camera, InternalTexture, Nullable, FrameGraphTextureCreationOptions, FrameGraphObjectList } from "../../../index.js";
|
|
1
|
+
import type { NodeRenderGraphConnectionPoint, Scene, FrameGraph, NodeRenderGraphBuildState, Camera, InternalTexture, Nullable, FrameGraphTextureCreationOptions, FrameGraphObjectList, IShadowLight } from "../../../index.js";
|
|
2
2
|
import { Observable } from "../../../Misc/observable";
|
|
3
3
|
import { NodeRenderGraphBlockConnectionPointTypes } from "../Types/nodeRenderGraphTypes";
|
|
4
4
|
import { NodeRenderGraphBlock } from "../nodeRenderGraphBlock";
|
|
5
|
-
export type NodeRenderGraphValueType = InternalTexture | Camera | FrameGraphObjectList;
|
|
5
|
+
export type NodeRenderGraphValueType = InternalTexture | Camera | FrameGraphObjectList | IShadowLight;
|
|
6
6
|
export type NodeRenderGraphInputCreationOptions = FrameGraphTextureCreationOptions;
|
|
7
7
|
/**
|
|
8
8
|
* Block used to expose an input value
|
|
@@ -81,6 +81,11 @@ export declare class NodeRenderGraphInputBlock extends NodeRenderGraphBlock {
|
|
|
81
81
|
* @returns true if the block is an object list
|
|
82
82
|
*/
|
|
83
83
|
isObjectList(): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Check if the block is a shadow light
|
|
86
|
+
* @returns true if the block is a shadow light
|
|
87
|
+
*/
|
|
88
|
+
isShadowLight(): boolean;
|
|
84
89
|
protected _buildBlock(state: NodeRenderGraphBuildState): void;
|
|
85
90
|
dispose(): void;
|
|
86
91
|
protected _dumpPropertiesCode(): string;
|
|
@@ -172,6 +172,13 @@ export class NodeRenderGraphInputBlock extends NodeRenderGraphBlock {
|
|
|
172
172
|
isObjectList() {
|
|
173
173
|
return (this.type & NodeRenderGraphBlockConnectionPointTypes.ObjectList) !== 0;
|
|
174
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
* Check if the block is a shadow light
|
|
177
|
+
* @returns true if the block is a shadow light
|
|
178
|
+
*/
|
|
179
|
+
isShadowLight() {
|
|
180
|
+
return (this.type & NodeRenderGraphBlockConnectionPointTypes.ShadowLight) !== 0;
|
|
181
|
+
}
|
|
175
182
|
_buildBlock(state) {
|
|
176
183
|
super._buildBlock(state);
|
|
177
184
|
if (this.isExternal) {
|
|
@@ -187,6 +194,9 @@ export class NodeRenderGraphInputBlock extends NodeRenderGraphBlock {
|
|
|
187
194
|
else if (this.isObjectList()) {
|
|
188
195
|
this.output.value = this.getTypedValue();
|
|
189
196
|
}
|
|
197
|
+
else if (this.isShadowLight()) {
|
|
198
|
+
this.output.value = this.getTypedValue();
|
|
199
|
+
}
|
|
190
200
|
else {
|
|
191
201
|
if (this._storedValue === undefined || this._storedValue === null) {
|
|
192
202
|
throw new Error(`NodeRenderGraphInputBlock: External input "${this.name}" is not set`);
|
|
@@ -228,6 +238,9 @@ export class NodeRenderGraphInputBlock extends NodeRenderGraphBlock {
|
|
|
228
238
|
else if (this.isObjectList()) {
|
|
229
239
|
codes.push(`${this._codeVariableName}.value = EXTERNAL_OBJECT_LIST; // TODO: set the external object list`);
|
|
230
240
|
}
|
|
241
|
+
else if (this.isShadowLight()) {
|
|
242
|
+
codes.push(`${this._codeVariableName}.value = EXTERNAL_SHADOW_LIGHT; // TODO: set the external shadow light`);
|
|
243
|
+
}
|
|
231
244
|
return super._dumpPropertiesCode() + codes.join("\n");
|
|
232
245
|
}
|
|
233
246
|
serialize() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Node/Blocks/inputBlock.ts"],"names":[],"mappings":";AAaA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,wCAAwC,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAA0B,MAAM,mCAAmC,CAAC;AACnG,OAAO,EAAE,4BAA4B,EAAE,mCAAmC,EAAE,MAAM,qCAAqC,CAAC;AACxH,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAMvD;;GAEG;AACH,MAAM,OAAO,yBAA0B,S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YACD,IAAI,CAAC,eAAe,GAAG,mBAAmB,CAAC,eAAe,CAAC;QAC/D,CAAC;IACL,CAAC;CACJ;AAjQU;IADN,sBAAsB,CAAC,aAAa,0CAAkC,YAAY,CAAC;6DAC1D;AAmQ9B,aAAa,CAAC,mCAAmC,EAAE,yBAAyB,CAAC,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nimport type {\r\n NodeRenderGraphConnectionPoint,\r\n Scene,\r\n FrameGraph,\r\n NodeRenderGraphBuildState,\r\n Camera,\r\n InternalTexture,\r\n Nullable,\r\n FrameGraphTextureCreationOptions,\r\n FrameGraphTextureHandle,\r\n FrameGraphObjectList,\r\n} from \"core/index\";\r\nimport { Observable } from \"../../../Misc/observable\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../Types/nodeRenderGraphTypes\";\r\nimport { NodeRenderGraphBlock } from \"../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../Decorators/nodeDecorator\";\r\nimport { backbufferColorTextureHandle, backbufferDepthStencilTextureHandle } from \"../../../FrameGraph/frameGraphTypes\";\r\nimport { Constants } from \"../../../Engines/constants\";\r\n\r\nexport type NodeRenderGraphValueType = InternalTexture | Camera | FrameGraphObjectList;\r\n\r\nexport type NodeRenderGraphInputCreationOptions = FrameGraphTextureCreationOptions;\r\n\r\n/**\r\n * Block used to expose an input value\r\n */\r\nexport class NodeRenderGraphInputBlock extends NodeRenderGraphBlock {\r\n private _storedValue: Nullable<NodeRenderGraphValueType> = null;\r\n private _type: NodeRenderGraphBlockConnectionPointTypes = NodeRenderGraphBlockConnectionPointTypes.Undefined;\r\n\r\n /** Gets an observable raised when the value is changed */\r\n public onValueChangedObservable = new Observable<NodeRenderGraphInputBlock>();\r\n\r\n /** Indicates that the input is externally managed */\r\n @editableInPropertyPage(\"Is external\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public isExternal = false;\r\n\r\n /** Gets or sets the options to create the input value */\r\n public creationOptions: NodeRenderGraphInputCreationOptions;\r\n\r\n /**\r\n * Gets or sets the connection point type (default is Undefined)\r\n */\r\n public get type(): NodeRenderGraphBlockConnectionPointTypes {\r\n return this._type;\r\n }\r\n\r\n /**\r\n * Creates a new NodeRenderGraphInputBlock\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 type defines the type of the input (can be set to NodeRenderGraphBlockConnectionPointTypes.Undefined)\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene, type: NodeRenderGraphBlockConnectionPointTypes = NodeRenderGraphBlockConnectionPointTypes.Undefined) {\r\n super(name, frameGraph, scene);\r\n\r\n this._type = type;\r\n this._isInput = true;\r\n this.registerOutput(\"output\", type);\r\n this.setDefaultValue();\r\n }\r\n\r\n /**\r\n * Set the input block to its default value (based on its type)\r\n */\r\n public setDefaultValue() {\r\n switch (this.type) {\r\n case NodeRenderGraphBlockConnectionPointTypes.Texture:\r\n case NodeRenderGraphBlockConnectionPointTypes.TextureViewDepth:\r\n case NodeRenderGraphBlockConnectionPointTypes.TextureScreenDepth:\r\n case NodeRenderGraphBlockConnectionPointTypes.TextureViewNormal:\r\n case NodeRenderGraphBlockConnectionPointTypes.TextureWorldNormal:\r\n case NodeRenderGraphBlockConnectionPointTypes.TextureAlbedo:\r\n case NodeRenderGraphBlockConnectionPointTypes.TextureReflectivity:\r\n case NodeRenderGraphBlockConnectionPointTypes.TextureLocalPosition:\r\n case NodeRenderGraphBlockConnectionPointTypes.TextureWorldPosition:\r\n case NodeRenderGraphBlockConnectionPointTypes.TextureVelocity:\r\n case NodeRenderGraphBlockConnectionPointTypes.TextureLinearVelocity:\r\n case NodeRenderGraphBlockConnectionPointTypes.TextureIrradiance:\r\n case NodeRenderGraphBlockConnectionPointTypes.TextureAlbedoSqrt: {\r\n const options: FrameGraphTextureCreationOptions = {\r\n size: { width: 100, height: 100 },\r\n options: {\r\n createMipMaps: false,\r\n types: [Constants.TEXTURETYPE_UNSIGNED_BYTE],\r\n formats: [Constants.TEXTUREFORMAT_RGBA],\r\n samples: 1,\r\n useSRGBBuffers: [false],\r\n },\r\n sizeIsPercentage: true,\r\n };\r\n this.creationOptions = options;\r\n break;\r\n }\r\n case NodeRenderGraphBlockConnectionPointTypes.TextureDepthStencilAttachment: {\r\n const options: FrameGraphTextureCreationOptions = {\r\n size: { width: 100, height: 100 },\r\n options: {\r\n createMipMaps: false,\r\n types: [Constants.TEXTURETYPE_UNSIGNED_BYTE],\r\n formats: [Constants.TEXTUREFORMAT_DEPTH24_STENCIL8],\r\n useSRGBBuffers: [false],\r\n labels: [this.name],\r\n samples: 1,\r\n },\r\n sizeIsPercentage: true,\r\n };\r\n this.creationOptions = options;\r\n break;\r\n }\r\n case NodeRenderGraphBlockConnectionPointTypes.ObjectList:\r\n this.value = { meshes: [], particleSystems: [] };\r\n this.isExternal = true;\r\n break;\r\n case NodeRenderGraphBlockConnectionPointTypes.Camera:\r\n this.value = this._scene.cameras[0];\r\n this.isExternal = true;\r\n break;\r\n default:\r\n this.isExternal = true;\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets the value of that point.\r\n */\r\n public get value(): Nullable<NodeRenderGraphValueType> {\r\n return this._storedValue;\r\n }\r\n\r\n public set value(value: Nullable<NodeRenderGraphValueType>) {\r\n this._storedValue = value;\r\n this.output.value = undefined;\r\n this.onValueChangedObservable.notifyObservers(this);\r\n }\r\n\r\n /**\r\n * Gets the value as a specific type\r\n * @returns the value as a specific type\r\n */\r\n public getTypedValue<T extends NodeRenderGraphValueType>(): T {\r\n return this._storedValue as T;\r\n }\r\n\r\n /**\r\n * Gets the value as an internal texture\r\n * @returns The internal texture stored in value if value is an internal texture, otherwise null\r\n */\r\n public getInternalTextureFromValue(): Nullable<InternalTexture> {\r\n if ((this._storedValue as InternalTexture)._swapAndDie) {\r\n return this._storedValue as InternalTexture;\r\n }\r\n return null;\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 \"NodeRenderGraphInputBlock\";\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 /**\r\n * Check if the block is a texture of any type\r\n * @returns true if the block is a texture\r\n */\r\n public isAnyTexture(): boolean {\r\n return (this.type & NodeRenderGraphBlockConnectionPointTypes.TextureAll) !== 0;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating that the connection point is the back buffer texture\r\n * @returns true if the connection point is the back buffer texture\r\n */\r\n public isBackBuffer() {\r\n return (this.type & NodeRenderGraphBlockConnectionPointTypes.TextureBackBuffer) !== 0;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating that the connection point is a depth/stencil attachment texture\r\n * @returns true if the connection point is a depth/stencil attachment texture\r\n */\r\n public isBackBufferDepthStencilAttachment() {\r\n return (this.type & NodeRenderGraphBlockConnectionPointTypes.TextureBackBufferDepthStencilAttachment) !== 0;\r\n }\r\n\r\n /**\r\n * Check if the block is a camera\r\n * @returns true if the block is a camera\r\n */\r\n public isCamera(): boolean {\r\n return (this.type & NodeRenderGraphBlockConnectionPointTypes.Camera) !== 0;\r\n }\r\n\r\n /**\r\n * Check if the block is an object list\r\n * @returns true if the block is an object list\r\n */\r\n public isObjectList(): boolean {\r\n return (this.type & NodeRenderGraphBlockConnectionPointTypes.ObjectList) !== 0;\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n if (this.isExternal) {\r\n if (this.isBackBuffer()) {\r\n this.output.value = backbufferColorTextureHandle;\r\n } else if (this.isBackBufferDepthStencilAttachment()) {\r\n this.output.value = backbufferDepthStencilTextureHandle;\r\n } else if (this.isCamera()) {\r\n this.output.value = this.getTypedValue<Camera>();\r\n } else if (this.isObjectList()) {\r\n this.output.value = this.getTypedValue<FrameGraphObjectList>();\r\n } else {\r\n if (this._storedValue === undefined || this._storedValue === null) {\r\n throw new Error(`NodeRenderGraphInputBlock: External input \"${this.name}\" is not set`);\r\n }\r\n const texture = this.getInternalTextureFromValue();\r\n if (texture) {\r\n this.output.value = this._frameGraph.textureManager.importTexture(this.name, texture, this.output.value as FrameGraphTextureHandle);\r\n }\r\n }\r\n return;\r\n }\r\n\r\n if ((this.type & NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer) !== 0) {\r\n const textureCreateOptions = this.creationOptions as FrameGraphTextureCreationOptions;\r\n\r\n if (!textureCreateOptions) {\r\n throw new Error(`NodeRenderGraphInputBlock: Creation options are missing for texture \"${this.name}\"`);\r\n }\r\n\r\n this.output.value = this._frameGraph.textureManager.createRenderTargetTexture(this.name, textureCreateOptions);\r\n }\r\n }\r\n\r\n public override dispose() {\r\n this._storedValue = null;\r\n this.onValueChangedObservable.clear();\r\n super.dispose();\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.isExternal = ${this.isExternal};`);\r\n if (this.isAnyTexture()) {\r\n if (!this.isExternal) {\r\n codes.push(`${this._codeVariableName}.creationOptions = ${JSON.stringify(this.creationOptions)};`);\r\n } else {\r\n codes.push(`${this._codeVariableName}.value = EXTERNAL_TEXTURE; // TODO: set the external texture`);\r\n }\r\n } else if (this.isCamera()) {\r\n codes.push(`${this._codeVariableName}.value = EXTERNAL_CAMERA; // TODO: set the external camera`);\r\n } else if (this.isObjectList()) {\r\n codes.push(`${this._codeVariableName}.value = EXTERNAL_OBJECT_LIST; // TODO: set the external object list`);\r\n }\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.type = this.type;\r\n serializationObject.isExternal = this.isExternal;\r\n if (this.creationOptions) {\r\n serializationObject.creationOptions = this.creationOptions;\r\n }\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this._type = serializationObject.type;\r\n this.output.type = this._type;\r\n this.isExternal = serializationObject.isExternal;\r\n if (serializationObject.creationOptions) {\r\n if (serializationObject.creationOptions.options.depthTextureFormat !== undefined) {\r\n // Backward compatibility - remove this code in the future\r\n serializationObject.creationOptions.options.formats = [serializationObject.creationOptions.options.depthTextureFormat];\r\n }\r\n this.creationOptions = serializationObject.creationOptions;\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphInputBlock\", NodeRenderGraphInputBlock);\r\n"]}
|
|
1
|
+
{"version":3,"file":"inputBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Node/Blocks/inputBlock.ts"],"names":[],"mappings":";AAcA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,wCAAwC,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAA0B,MAAM,mCAAmC,CAAC;AACnG,OAAO,EAAE,4BAA4B,EAAE,mCAAmC,EAAE,MAAM,qCAAqC,CAAC;AACxH,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAMvD;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,oBAAoB;IAc/D;;OAEG;IACH,IAAW,IAAI;QACX,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED;;;;;;OAMG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,KAAY,EAAE,OAAiD,wCAAwC,CAAC,SAAS;QACtK,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QA5B3B,iBAAY,GAAuC,IAAI,CAAC;QACxD,UAAK,GAA6C,wCAAwC,CAAC,SAAS,CAAC;QAE7G,0DAA0D;QACnD,6BAAw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AAO,CAAC,kBAAkB,CAAC,CAAC;YAC3H,CAAC;YACD,IAAI,CAAC,eAAe,GAAG,mBAAmB,CAAC,eAAe,CAAC;QAC/D,CAAC;IACL,CAAC;CACJ;AA7QU;IADN,sBAAsB,CAAC,aAAa,0CAAkC,YAAY,CAAC;6DAC1D;AA+Q9B,aAAa,CAAC,mCAAmC,EAAE,yBAAyB,CAAC,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nimport type {\r\n NodeRenderGraphConnectionPoint,\r\n Scene,\r\n FrameGraph,\r\n NodeRenderGraphBuildState,\r\n Camera,\r\n InternalTexture,\r\n Nullable,\r\n FrameGraphTextureCreationOptions,\r\n FrameGraphTextureHandle,\r\n FrameGraphObjectList,\r\n IShadowLight,\r\n} from \"core/index\";\r\nimport { Observable } from \"../../../Misc/observable\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../Types/nodeRenderGraphTypes\";\r\nimport { NodeRenderGraphBlock } from \"../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../Decorators/nodeDecorator\";\r\nimport { backbufferColorTextureHandle, backbufferDepthStencilTextureHandle } from \"../../../FrameGraph/frameGraphTypes\";\r\nimport { Constants } from \"../../../Engines/constants\";\r\n\r\nexport type NodeRenderGraphValueType = InternalTexture | Camera | FrameGraphObjectList | IShadowLight;\r\n\r\nexport type NodeRenderGraphInputCreationOptions = FrameGraphTextureCreationOptions;\r\n\r\n/**\r\n * Block used to expose an input value\r\n */\r\nexport class NodeRenderGraphInputBlock extends NodeRenderGraphBlock {\r\n private _storedValue: Nullable<NodeRenderGraphValueType> = null;\r\n private _type: NodeRenderGraphBlockConnectionPointTypes = NodeRenderGraphBlockConnectionPointTypes.Undefined;\r\n\r\n /** Gets an observable raised when the value is changed */\r\n public onValueChangedObservable = new Observable<NodeRenderGraphInputBlock>();\r\n\r\n /** Indicates that the input is externally managed */\r\n @editableInPropertyPage(\"Is external\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public isExternal = false;\r\n\r\n /** Gets or sets the options to create the input value */\r\n public creationOptions: NodeRenderGraphInputCreationOptions;\r\n\r\n /**\r\n * Gets or sets the connection point type (default is Undefined)\r\n */\r\n public get type(): NodeRenderGraphBlockConnectionPointTypes {\r\n return this._type;\r\n }\r\n\r\n /**\r\n * Creates a new NodeRenderGraphInputBlock\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 type defines the type of the input (can be set to NodeRenderGraphBlockConnectionPointTypes.Undefined)\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene, type: NodeRenderGraphBlockConnectionPointTypes = NodeRenderGraphBlockConnectionPointTypes.Undefined) {\r\n super(name, frameGraph, scene);\r\n\r\n this._type = type;\r\n this._isInput = true;\r\n this.registerOutput(\"output\", type);\r\n this.setDefaultValue();\r\n }\r\n\r\n /**\r\n * Set the input block to its default value (based on its type)\r\n */\r\n public setDefaultValue() {\r\n switch (this.type) {\r\n case NodeRenderGraphBlockConnectionPointTypes.Texture:\r\n case NodeRenderGraphBlockConnectionPointTypes.TextureViewDepth:\r\n case NodeRenderGraphBlockConnectionPointTypes.TextureScreenDepth:\r\n case NodeRenderGraphBlockConnectionPointTypes.TextureViewNormal:\r\n case NodeRenderGraphBlockConnectionPointTypes.TextureWorldNormal:\r\n case NodeRenderGraphBlockConnectionPointTypes.TextureAlbedo:\r\n case NodeRenderGraphBlockConnectionPointTypes.TextureReflectivity:\r\n case NodeRenderGraphBlockConnectionPointTypes.TextureLocalPosition:\r\n case NodeRenderGraphBlockConnectionPointTypes.TextureWorldPosition:\r\n case NodeRenderGraphBlockConnectionPointTypes.TextureVelocity:\r\n case NodeRenderGraphBlockConnectionPointTypes.TextureLinearVelocity:\r\n case NodeRenderGraphBlockConnectionPointTypes.TextureIrradiance:\r\n case NodeRenderGraphBlockConnectionPointTypes.TextureAlbedoSqrt: {\r\n const options: FrameGraphTextureCreationOptions = {\r\n size: { width: 100, height: 100 },\r\n options: {\r\n createMipMaps: false,\r\n types: [Constants.TEXTURETYPE_UNSIGNED_BYTE],\r\n formats: [Constants.TEXTUREFORMAT_RGBA],\r\n samples: 1,\r\n useSRGBBuffers: [false],\r\n },\r\n sizeIsPercentage: true,\r\n };\r\n this.creationOptions = options;\r\n break;\r\n }\r\n case NodeRenderGraphBlockConnectionPointTypes.TextureDepthStencilAttachment: {\r\n const options: FrameGraphTextureCreationOptions = {\r\n size: { width: 100, height: 100 },\r\n options: {\r\n createMipMaps: false,\r\n types: [Constants.TEXTURETYPE_UNSIGNED_BYTE],\r\n formats: [Constants.TEXTUREFORMAT_DEPTH24_STENCIL8],\r\n useSRGBBuffers: [false],\r\n labels: [this.name],\r\n samples: 1,\r\n },\r\n sizeIsPercentage: true,\r\n };\r\n this.creationOptions = options;\r\n break;\r\n }\r\n case NodeRenderGraphBlockConnectionPointTypes.ObjectList:\r\n this.value = { meshes: [], particleSystems: [] };\r\n this.isExternal = true;\r\n break;\r\n case NodeRenderGraphBlockConnectionPointTypes.Camera:\r\n this.value = this._scene.cameras[0];\r\n this.isExternal = true;\r\n break;\r\n default:\r\n this.isExternal = true;\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets the value of that point.\r\n */\r\n public get value(): Nullable<NodeRenderGraphValueType> {\r\n return this._storedValue;\r\n }\r\n\r\n public set value(value: Nullable<NodeRenderGraphValueType>) {\r\n this._storedValue = value;\r\n this.output.value = undefined;\r\n this.onValueChangedObservable.notifyObservers(this);\r\n }\r\n\r\n /**\r\n * Gets the value as a specific type\r\n * @returns the value as a specific type\r\n */\r\n public getTypedValue<T extends NodeRenderGraphValueType>(): T {\r\n return this._storedValue as T;\r\n }\r\n\r\n /**\r\n * Gets the value as an internal texture\r\n * @returns The internal texture stored in value if value is an internal texture, otherwise null\r\n */\r\n public getInternalTextureFromValue(): Nullable<InternalTexture> {\r\n if ((this._storedValue as InternalTexture)._swapAndDie) {\r\n return this._storedValue as InternalTexture;\r\n }\r\n return null;\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 \"NodeRenderGraphInputBlock\";\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 /**\r\n * Check if the block is a texture of any type\r\n * @returns true if the block is a texture\r\n */\r\n public isAnyTexture(): boolean {\r\n return (this.type & NodeRenderGraphBlockConnectionPointTypes.TextureAll) !== 0;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating that the connection point is the back buffer texture\r\n * @returns true if the connection point is the back buffer texture\r\n */\r\n public isBackBuffer() {\r\n return (this.type & NodeRenderGraphBlockConnectionPointTypes.TextureBackBuffer) !== 0;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating that the connection point is a depth/stencil attachment texture\r\n * @returns true if the connection point is a depth/stencil attachment texture\r\n */\r\n public isBackBufferDepthStencilAttachment() {\r\n return (this.type & NodeRenderGraphBlockConnectionPointTypes.TextureBackBufferDepthStencilAttachment) !== 0;\r\n }\r\n\r\n /**\r\n * Check if the block is a camera\r\n * @returns true if the block is a camera\r\n */\r\n public isCamera(): boolean {\r\n return (this.type & NodeRenderGraphBlockConnectionPointTypes.Camera) !== 0;\r\n }\r\n\r\n /**\r\n * Check if the block is an object list\r\n * @returns true if the block is an object list\r\n */\r\n public isObjectList(): boolean {\r\n return (this.type & NodeRenderGraphBlockConnectionPointTypes.ObjectList) !== 0;\r\n }\r\n\r\n /**\r\n * Check if the block is a shadow light\r\n * @returns true if the block is a shadow light\r\n */\r\n public isShadowLight(): boolean {\r\n return (this.type & NodeRenderGraphBlockConnectionPointTypes.ShadowLight) !== 0;\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n if (this.isExternal) {\r\n if (this.isBackBuffer()) {\r\n this.output.value = backbufferColorTextureHandle;\r\n } else if (this.isBackBufferDepthStencilAttachment()) {\r\n this.output.value = backbufferDepthStencilTextureHandle;\r\n } else if (this.isCamera()) {\r\n this.output.value = this.getTypedValue<Camera>();\r\n } else if (this.isObjectList()) {\r\n this.output.value = this.getTypedValue<FrameGraphObjectList>();\r\n } else if (this.isShadowLight()) {\r\n this.output.value = this.getTypedValue<IShadowLight>();\r\n } else {\r\n if (this._storedValue === undefined || this._storedValue === null) {\r\n throw new Error(`NodeRenderGraphInputBlock: External input \"${this.name}\" is not set`);\r\n }\r\n const texture = this.getInternalTextureFromValue();\r\n if (texture) {\r\n this.output.value = this._frameGraph.textureManager.importTexture(this.name, texture, this.output.value as FrameGraphTextureHandle);\r\n }\r\n }\r\n return;\r\n }\r\n\r\n if ((this.type & NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer) !== 0) {\r\n const textureCreateOptions = this.creationOptions as FrameGraphTextureCreationOptions;\r\n\r\n if (!textureCreateOptions) {\r\n throw new Error(`NodeRenderGraphInputBlock: Creation options are missing for texture \"${this.name}\"`);\r\n }\r\n\r\n this.output.value = this._frameGraph.textureManager.createRenderTargetTexture(this.name, textureCreateOptions);\r\n }\r\n }\r\n\r\n public override dispose() {\r\n this._storedValue = null;\r\n this.onValueChangedObservable.clear();\r\n super.dispose();\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.isExternal = ${this.isExternal};`);\r\n if (this.isAnyTexture()) {\r\n if (!this.isExternal) {\r\n codes.push(`${this._codeVariableName}.creationOptions = ${JSON.stringify(this.creationOptions)};`);\r\n } else {\r\n codes.push(`${this._codeVariableName}.value = EXTERNAL_TEXTURE; // TODO: set the external texture`);\r\n }\r\n } else if (this.isCamera()) {\r\n codes.push(`${this._codeVariableName}.value = EXTERNAL_CAMERA; // TODO: set the external camera`);\r\n } else if (this.isObjectList()) {\r\n codes.push(`${this._codeVariableName}.value = EXTERNAL_OBJECT_LIST; // TODO: set the external object list`);\r\n } else if (this.isShadowLight()) {\r\n codes.push(`${this._codeVariableName}.value = EXTERNAL_SHADOW_LIGHT; // TODO: set the external shadow light`);\r\n }\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.type = this.type;\r\n serializationObject.isExternal = this.isExternal;\r\n if (this.creationOptions) {\r\n serializationObject.creationOptions = this.creationOptions;\r\n }\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this._type = serializationObject.type;\r\n this.output.type = this._type;\r\n this.isExternal = serializationObject.isExternal;\r\n if (serializationObject.creationOptions) {\r\n if (serializationObject.creationOptions.options.depthTextureFormat !== undefined) {\r\n // Backward compatibility - remove this code in the future\r\n serializationObject.creationOptions.options.formats = [serializationObject.creationOptions.options.depthTextureFormat];\r\n }\r\n this.creationOptions = serializationObject.creationOptions;\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphInputBlock\", NodeRenderGraphInputBlock);\r\n"]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { NodeRenderGraphConnectionPoint, Scene, FrameGraph } from "../../../index.js";
|
|
2
|
+
import { NodeRenderGraphBlock } from "../nodeRenderGraphBlock";
|
|
3
|
+
/**
|
|
4
|
+
* Block used as a resource (textures, buffers) container
|
|
5
|
+
*/
|
|
6
|
+
export declare class NodeRenderGraphResourceContainerBlock extends NodeRenderGraphBlock {
|
|
7
|
+
/**
|
|
8
|
+
* Creates a new NodeRenderGraphResourceContainerBlock
|
|
9
|
+
* @param name defines the block name
|
|
10
|
+
* @param frameGraph defines the hosting frame graph
|
|
11
|
+
* @param scene defines the hosting scene
|
|
12
|
+
*/
|
|
13
|
+
constructor(name: string, frameGraph: FrameGraph, scene: Scene);
|
|
14
|
+
/**
|
|
15
|
+
* Gets the current class name
|
|
16
|
+
* @returns the class name
|
|
17
|
+
*/
|
|
18
|
+
getClassName(): string;
|
|
19
|
+
/**
|
|
20
|
+
* Gets the resource0 component
|
|
21
|
+
*/
|
|
22
|
+
get resource0(): NodeRenderGraphConnectionPoint;
|
|
23
|
+
/**
|
|
24
|
+
* Gets the resource1 component
|
|
25
|
+
*/
|
|
26
|
+
get resource1(): NodeRenderGraphConnectionPoint;
|
|
27
|
+
/**
|
|
28
|
+
* Gets the resource2 component
|
|
29
|
+
*/
|
|
30
|
+
get resource2(): NodeRenderGraphConnectionPoint;
|
|
31
|
+
/**
|
|
32
|
+
* Gets the resource3 component
|
|
33
|
+
*/
|
|
34
|
+
get resource3(): NodeRenderGraphConnectionPoint;
|
|
35
|
+
/**
|
|
36
|
+
* Gets the resource4 component
|
|
37
|
+
*/
|
|
38
|
+
get resource4(): NodeRenderGraphConnectionPoint;
|
|
39
|
+
/**
|
|
40
|
+
* Gets the resource5 component
|
|
41
|
+
*/
|
|
42
|
+
get resource5(): NodeRenderGraphConnectionPoint;
|
|
43
|
+
/**
|
|
44
|
+
* Gets the resource6 component
|
|
45
|
+
*/
|
|
46
|
+
get resource6(): NodeRenderGraphConnectionPoint;
|
|
47
|
+
/**
|
|
48
|
+
* Gets the resource7 component
|
|
49
|
+
*/
|
|
50
|
+
get resource7(): NodeRenderGraphConnectionPoint;
|
|
51
|
+
/**
|
|
52
|
+
* Gets the output component
|
|
53
|
+
*/
|
|
54
|
+
get output(): NodeRenderGraphConnectionPoint;
|
|
55
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
2
|
+
import { NodeRenderGraphBlockConnectionPointTypes } from "../Types/nodeRenderGraphTypes.js";
|
|
3
|
+
import { NodeRenderGraphBlock } from "../nodeRenderGraphBlock.js";
|
|
4
|
+
/**
|
|
5
|
+
* Block used as a resource (textures, buffers) container
|
|
6
|
+
*/
|
|
7
|
+
export class NodeRenderGraphResourceContainerBlock extends NodeRenderGraphBlock {
|
|
8
|
+
/**
|
|
9
|
+
* Creates a new NodeRenderGraphResourceContainerBlock
|
|
10
|
+
* @param name defines the block name
|
|
11
|
+
* @param frameGraph defines the hosting frame graph
|
|
12
|
+
* @param scene defines the hosting scene
|
|
13
|
+
*/
|
|
14
|
+
constructor(name, frameGraph, scene) {
|
|
15
|
+
super(name, frameGraph, scene);
|
|
16
|
+
this.registerInput("resource0", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
17
|
+
this.registerInput("resource1", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
18
|
+
this.registerInput("resource2", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
19
|
+
this.registerInput("resource3", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
20
|
+
this.registerInput("resource4", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
21
|
+
this.registerInput("resource5", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
22
|
+
this.registerInput("resource6", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
23
|
+
this.registerInput("resource7", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
24
|
+
this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.ResourceContainer);
|
|
25
|
+
this.resource0.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer | NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator);
|
|
26
|
+
this.resource1.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer | NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator);
|
|
27
|
+
this.resource2.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer | NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator);
|
|
28
|
+
this.resource3.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer | NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator);
|
|
29
|
+
this.resource4.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer | NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator);
|
|
30
|
+
this.resource5.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer | NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator);
|
|
31
|
+
this.resource6.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer | NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator);
|
|
32
|
+
this.resource7.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer | NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Gets the current class name
|
|
36
|
+
* @returns the class name
|
|
37
|
+
*/
|
|
38
|
+
getClassName() {
|
|
39
|
+
return "NodeRenderGraphResourceContainerBlock";
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Gets the resource0 component
|
|
43
|
+
*/
|
|
44
|
+
get resource0() {
|
|
45
|
+
return this._inputs[0];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Gets the resource1 component
|
|
49
|
+
*/
|
|
50
|
+
get resource1() {
|
|
51
|
+
return this._inputs[1];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Gets the resource2 component
|
|
55
|
+
*/
|
|
56
|
+
get resource2() {
|
|
57
|
+
return this._inputs[2];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Gets the resource3 component
|
|
61
|
+
*/
|
|
62
|
+
get resource3() {
|
|
63
|
+
return this._inputs[3];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Gets the resource4 component
|
|
67
|
+
*/
|
|
68
|
+
get resource4() {
|
|
69
|
+
return this._inputs[4];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Gets the resource5 component
|
|
73
|
+
*/
|
|
74
|
+
get resource5() {
|
|
75
|
+
return this._inputs[5];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Gets the resource6 component
|
|
79
|
+
*/
|
|
80
|
+
get resource6() {
|
|
81
|
+
return this._inputs[6];
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Gets the resource7 component
|
|
85
|
+
*/
|
|
86
|
+
get resource7() {
|
|
87
|
+
return this._inputs[7];
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Gets the output component
|
|
91
|
+
*/
|
|
92
|
+
get output() {
|
|
93
|
+
return this._outputs[0];
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
RegisterClass("BABYLON.NodeRenderGraphResourceContainerBlock", NodeRenderGraphResourceContainerBlock);
|
|
97
|
+
//# sourceMappingURL=resourceContainerBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceContainerBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Node/Blocks/resourceContainerBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,wCAAwC,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAE/D;;GAEG;AACH,MAAM,OAAO,qCAAsC,SAAQ,oBAAoB;IAC3E;;;;;OAKG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,KAAY;QACjE,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAE/B,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,wCAAwC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACxF,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,wCAAwC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;Q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slint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, FrameGraph } from \"core/index\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../Types/nodeRenderGraphTypes\";\r\nimport { NodeRenderGraphBlock } from \"../nodeRenderGraphBlock\";\r\n\r\n/**\r\n * Block used as a resource (textures, buffers) container\r\n */\r\nexport class NodeRenderGraphResourceContainerBlock extends NodeRenderGraphBlock {\r\n /**\r\n * Creates a new NodeRenderGraphResourceContainerBlock\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(\"resource0\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this.registerInput(\"resource1\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this.registerInput(\"resource2\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this.registerInput(\"resource3\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this.registerInput(\"resource4\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this.registerInput(\"resource5\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this.registerInput(\"resource6\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this.registerInput(\"resource7\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.ResourceContainer);\r\n\r\n this.resource0.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer | NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator);\r\n this.resource1.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer | NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator);\r\n this.resource2.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer | NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator);\r\n this.resource3.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer | NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator);\r\n this.resource4.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer | NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator);\r\n this.resource5.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer | NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator);\r\n this.resource6.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer | NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator);\r\n this.resource7.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer | NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator);\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 \"NodeRenderGraphResourceContainerBlock\";\r\n }\r\n\r\n /**\r\n * Gets the resource0 component\r\n */\r\n public get resource0(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the resource1 component\r\n */\r\n public get resource1(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the resource2 component\r\n */\r\n public get resource2(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the resource3 component\r\n */\r\n public get resource3(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the resource4 component\r\n */\r\n public get resource4(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the resource5 component\r\n */\r\n public get resource5(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[5];\r\n }\r\n\r\n /**\r\n * Gets the resource6 component\r\n */\r\n public get resource6(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[6];\r\n }\r\n\r\n /**\r\n * Gets the resource7 component\r\n */\r\n public get resource7(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[7];\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\r\nRegisterClass(\"BABYLON.NodeRenderGraphResourceContainerBlock\", NodeRenderGraphResourceContainerBlock);\r\n"]}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import type { Color4 } from "../../../
|
|
2
|
-
import type { Scene } from "../../../scene";
|
|
3
|
-
import type { FrameGraphTextureHandle } from "../../../FrameGraph/frameGraphTypes";
|
|
4
|
-
import type { Camera } from "../../../Cameras/camera";
|
|
5
|
-
import type { FrameGraphObjectList } from "../../frameGraphObjectList.js";
|
|
1
|
+
import type { Color4, Scene, FrameGraphTextureHandle, Camera, FrameGraphObjectList, IShadowLight, FrameGraphShadowGeneratorTask } from "../../../index.js";
|
|
6
2
|
/**
|
|
7
3
|
* Interface used to configure the node render graph editor
|
|
8
4
|
*/
|
|
@@ -67,10 +63,17 @@ export declare enum NodeRenderGraphBlockConnectionPointTypes {
|
|
|
67
63
|
/** Linear velocity geometry texture */
|
|
68
64
|
TextureLinearVelocity = 32768,
|
|
69
65
|
/** Bit field for all textures but back buffer depth/stencil */
|
|
70
|
-
TextureAllButBackBufferDepthStencil =
|
|
71
|
-
/** Bit field for all textures but back buffer */
|
|
72
|
-
TextureAllButBackBuffer =
|
|
73
|
-
|
|
66
|
+
TextureAllButBackBufferDepthStencil = 1048571,
|
|
67
|
+
/** Bit field for all textures but back buffer color and depth/stencil */
|
|
68
|
+
TextureAllButBackBuffer = 1048569,
|
|
69
|
+
/** Bit field for all textures */
|
|
70
|
+
TextureAll = 1048575,
|
|
71
|
+
/** Resource container */
|
|
72
|
+
ResourceContainer = 1048576,
|
|
73
|
+
/** Shadow generator */
|
|
74
|
+
ShadowGenerator = 2097152,
|
|
75
|
+
/** Light */
|
|
76
|
+
ShadowLight = 4194304,
|
|
74
77
|
/** Camera */
|
|
75
78
|
Camera = 16777216,
|
|
76
79
|
/** List of objects (meshes, particle systems, sprites) */
|
|
@@ -107,4 +110,4 @@ export declare enum NodeRenderGraphConnectionPointDirection {
|
|
|
107
110
|
/**
|
|
108
111
|
* Defines the type of a connection point value
|
|
109
112
|
*/
|
|
110
|
-
export type NodeRenderGraphBlockConnectionPointValueType = FrameGraphTextureHandle | Camera | FrameGraphObjectList;
|
|
113
|
+
export type NodeRenderGraphBlockConnectionPointValueType = FrameGraphTextureHandle | Camera | FrameGraphObjectList | IShadowLight | FrameGraphShadowGeneratorTask;
|
|
@@ -36,10 +36,17 @@ export var NodeRenderGraphBlockConnectionPointTypes;
|
|
|
36
36
|
/** Linear velocity geometry texture */
|
|
37
37
|
NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["TextureLinearVelocity"] = 32768] = "TextureLinearVelocity";
|
|
38
38
|
/** Bit field for all textures but back buffer depth/stencil */
|
|
39
|
-
NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["TextureAllButBackBufferDepthStencil"] =
|
|
40
|
-
/** Bit field for all textures but back buffer */
|
|
41
|
-
NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["TextureAllButBackBuffer"] =
|
|
42
|
-
|
|
39
|
+
NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["TextureAllButBackBufferDepthStencil"] = 1048571] = "TextureAllButBackBufferDepthStencil";
|
|
40
|
+
/** Bit field for all textures but back buffer color and depth/stencil */
|
|
41
|
+
NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["TextureAllButBackBuffer"] = 1048569] = "TextureAllButBackBuffer";
|
|
42
|
+
/** Bit field for all textures */
|
|
43
|
+
NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["TextureAll"] = 1048575] = "TextureAll";
|
|
44
|
+
/** Resource container */
|
|
45
|
+
NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["ResourceContainer"] = 1048576] = "ResourceContainer";
|
|
46
|
+
/** Shadow generator */
|
|
47
|
+
NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["ShadowGenerator"] = 2097152] = "ShadowGenerator";
|
|
48
|
+
/** Light */
|
|
49
|
+
NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["ShadowLight"] = 4194304] = "ShadowLight";
|
|
43
50
|
/** Camera */
|
|
44
51
|
NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["Camera"] = 16777216] = "Camera";
|
|
45
52
|
/** List of objects (meshes, particle systems, sprites) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeRenderGraphTypes.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Node/Types/nodeRenderGraphTypes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nodeRenderGraphTypes.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Node/Types/nodeRenderGraphTypes.ts"],"names":[],"mappings":"AAgCA;;GAEG;AACH,MAAM,CAAN,IAAY,wCA4DX;AA5DD,WAAY,wCAAwC;IAChD,8BAA8B;IAC9B,6GAAoB,CAAA;IACpB,gCAAgC;IAChC,iIAA8B,CAAA;IAC9B,2CAA2C;IAC3C,6KAAoD,CAAA;IACpD,+BAA+B;IAC/B,yJAA0C,CAAA;IAC1C,6CAA6C;IAC7C,gIAA6B,CAAA;IAC7B,8CAA8C;IAC9C,kIAA8B,CAAA;IAC9B,8BAA8B;IAC9B,0HA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modules\r\nimport type { Color4, Scene, FrameGraphTextureHandle, Camera, FrameGraphObjectList, IShadowLight, FrameGraphShadowGeneratorTask } from \"core/index\";\r\n\r\n/**\r\n * Interface used to configure the node render graph editor\r\n */\r\nexport interface INodeRenderGraphEditorOptions {\r\n /** Define the URL to load node editor script from */\r\n editorURL?: string;\r\n /** Additional configuration for the FGE */\r\n nodeRenderGraphEditorConfig?: {\r\n backgroundColor?: Color4;\r\n hostScene?: Scene;\r\n };\r\n}\r\n\r\n/**\r\n * Options that can be passed to the node render graph build method\r\n */\r\nexport interface INodeRenderGraphCreateOptions {\r\n /** If true, textures created by the node render graph will be visible in the inspector, for easier debugging (default: false) */\r\n debugTextures?: boolean;\r\n /** Rebuild the node render graph when the screen is resized (default: true) */\r\n rebuildGraphOnEngineResize?: boolean;\r\n /** Defines if the build should log activity (default: false) */\r\n verbose?: boolean;\r\n /** Defines if the autoConfigure method should be called when initializing blocks (default: false) */\r\n autoConfigure?: boolean;\r\n /** If true, external inputs like object lists and cameras will be filled with default values, taken from the scene. Note that external textures are not concerned (default: true). */\r\n autoFillExternalInputs?: boolean;\r\n}\r\n\r\n/**\r\n * Defines the kind of connection point for node render graph nodes\r\n */\r\nexport enum NodeRenderGraphBlockConnectionPointTypes {\r\n /** General purpose texture */\r\n Texture = 0x00000001,\r\n /** Back buffer color texture */\r\n TextureBackBuffer = 0x00000002,\r\n /** Back buffer depth/stencil attachment */\r\n TextureBackBufferDepthStencilAttachment = 0x00000004,\r\n /** Depth/stencil attachment */\r\n TextureDepthStencilAttachment = 0x00000008,\r\n /** Depth (in view space) geometry texture */\r\n TextureViewDepth = 0x00000010,\r\n /** Normal (in view space) geometry texture */\r\n TextureViewNormal = 0x00000020,\r\n /** Albedo geometry texture */\r\n TextureAlbedo = 0x00000040,\r\n /** Reflectivity geometry texture */\r\n TextureReflectivity = 0x00000080,\r\n /** Position (in world space) geometry texture */\r\n TextureWorldPosition = 0x00000100,\r\n /** Velocity geometry texture */\r\n TextureVelocity = 0x00000200,\r\n /** Irradiance geometry texture */\r\n TextureIrradiance = 0x00000400,\r\n /** Albedo (sqrt) geometry texture */\r\n TextureAlbedoSqrt = 0x00000800,\r\n /** Depth (in screen space) geometry texture */\r\n TextureScreenDepth = 0x00001000,\r\n /** Normal (in world space) geometry texture */\r\n TextureWorldNormal = 0x00002000,\r\n /** Position (in local space) geometry texture */\r\n TextureLocalPosition = 0x00004000,\r\n /** Linear velocity geometry texture */\r\n TextureLinearVelocity = 0x00008000,\r\n\r\n /** Bit field for all textures but back buffer depth/stencil */\r\n TextureAllButBackBufferDepthStencil = 0x000ffffb,\r\n /** Bit field for all textures but back buffer color and depth/stencil */\r\n TextureAllButBackBuffer = 0x000ffff9,\r\n /** Bit field for all textures */\r\n TextureAll = 0x000fffff,\r\n\r\n /** Resource container */\r\n ResourceContainer = 0x00100000,\r\n /** Shadow generator */\r\n ShadowGenerator = 0x00200000,\r\n /** Light */\r\n ShadowLight = 0x00400000,\r\n /** Camera */\r\n Camera = 0x01000000,\r\n /** List of objects (meshes, particle systems, sprites) */\r\n ObjectList = 0x02000000,\r\n\r\n /** Detect type based on connection */\r\n AutoDetect = 0x10000000,\r\n /** Output type that will be defined by input type */\r\n BasedOnInput = 0x20000000,\r\n /** Undefined */\r\n Undefined = 0x40000000,\r\n /** Bitmask of all types */\r\n All = 0xffffffff,\r\n}\r\n\r\n/**\r\n * Enum used to define the compatibility state between two connection points\r\n */\r\nexport const enum NodeRenderGraphConnectionPointCompatibilityStates {\r\n /** Points are compatibles */\r\n Compatible,\r\n /** Points are incompatible because of their types */\r\n TypeIncompatible,\r\n /** Points are incompatible because they are in the same hierarchy **/\r\n HierarchyIssue,\r\n}\r\n\r\n/**\r\n * Defines the direction of a connection point\r\n */\r\nexport const enum NodeRenderGraphConnectionPointDirection {\r\n /** Input */\r\n Input,\r\n /** Output */\r\n Output,\r\n}\r\n\r\n/**\r\n * Defines the type of a connection point value\r\n */\r\nexport type NodeRenderGraphBlockConnectionPointValueType = FrameGraphTextureHandle | Camera | FrameGraphObjectList | IShadowLight | FrameGraphShadowGeneratorTask;\r\n"]}
|
|
@@ -12,6 +12,7 @@ import { Tools } from "../../Misc/tools.js";
|
|
|
12
12
|
import { Engine } from "../../Engines/engine.js";
|
|
13
13
|
import { NodeRenderGraphBlockConnectionPointTypes } from "./Types/nodeRenderGraphTypes.js";
|
|
14
14
|
import { NodeRenderGraphClearBlock } from "./Blocks/Textures/clearBlock.js";
|
|
15
|
+
import { NodeRenderGraphObjectRendererBlock } from "./Blocks/Rendering/objectRendererBlock.js";
|
|
15
16
|
import { NodeRenderGraphBuildState } from "./nodeRenderGraphBuildState.js";
|
|
16
17
|
/**
|
|
17
18
|
* Defines a node render graph
|
|
@@ -217,7 +218,14 @@ export class NodeRenderGraph {
|
|
|
217
218
|
}
|
|
218
219
|
_autoFillExternalInputs() {
|
|
219
220
|
const allInputs = this.getInputBlocks();
|
|
221
|
+
const shadowLights = [];
|
|
222
|
+
for (const light of this._scene.lights) {
|
|
223
|
+
if (light.setShadowProjectionMatrix !== undefined) {
|
|
224
|
+
shadowLights.push(light);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
220
227
|
let cameraIndex = 0;
|
|
228
|
+
let lightIndex = 0;
|
|
221
229
|
for (const input of allInputs) {
|
|
222
230
|
if (!input.isExternal) {
|
|
223
231
|
continue;
|
|
@@ -238,6 +246,12 @@ export class NodeRenderGraph {
|
|
|
238
246
|
else if (input.isObjectList()) {
|
|
239
247
|
input.value = { meshes: this._scene.meshes, particleSystems: this._scene.particleSystems };
|
|
240
248
|
}
|
|
249
|
+
else if (input.isShadowLight()) {
|
|
250
|
+
if (lightIndex < shadowLights.length) {
|
|
251
|
+
input.value = shadowLights[lightIndex++];
|
|
252
|
+
lightIndex = lightIndex % shadowLights.length;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
241
255
|
}
|
|
242
256
|
}
|
|
243
257
|
/**
|
|
@@ -454,14 +468,28 @@ export class NodeRenderGraph {
|
|
|
454
468
|
setToDefault() {
|
|
455
469
|
this.clear();
|
|
456
470
|
this.editorData = null;
|
|
457
|
-
// Source
|
|
458
|
-
const
|
|
471
|
+
// Source textures
|
|
472
|
+
const colorTexture = new NodeRenderGraphInputBlock("Color Texture", this._frameGraph, this._scene, NodeRenderGraphBlockConnectionPointTypes.Texture);
|
|
473
|
+
colorTexture.creationOptions.options.samples = 4;
|
|
474
|
+
const depthTexture = new NodeRenderGraphInputBlock("Depth Texture", this._frameGraph, this._scene, NodeRenderGraphBlockConnectionPointTypes.TextureDepthStencilAttachment);
|
|
475
|
+
depthTexture.creationOptions.options.samples = 4;
|
|
459
476
|
// Clear texture
|
|
460
477
|
const clear = new NodeRenderGraphClearBlock("Clear", this._frameGraph, this._scene);
|
|
461
|
-
|
|
478
|
+
clear.clearDepth = true;
|
|
479
|
+
clear.clearStencil = true;
|
|
480
|
+
colorTexture.output.connectTo(clear.texture);
|
|
481
|
+
depthTexture.output.connectTo(clear.depth);
|
|
482
|
+
// Render objects
|
|
483
|
+
const camera = new NodeRenderGraphInputBlock("Camera", this._frameGraph, this._scene, NodeRenderGraphBlockConnectionPointTypes.Camera);
|
|
484
|
+
const objectList = new NodeRenderGraphInputBlock("Object List", this._frameGraph, this._scene, NodeRenderGraphBlockConnectionPointTypes.ObjectList);
|
|
485
|
+
const mainRendering = new NodeRenderGraphObjectRendererBlock("Main Rendering", this._frameGraph, this._scene);
|
|
486
|
+
camera.output.connectTo(mainRendering.camera);
|
|
487
|
+
objectList.output.connectTo(mainRendering.objects);
|
|
488
|
+
clear.output.connectTo(mainRendering.destination);
|
|
489
|
+
clear.outputDepth.connectTo(mainRendering.depth);
|
|
462
490
|
// Final output
|
|
463
491
|
const output = new NodeRenderGraphOutputBlock("Output", this._frameGraph, this._scene);
|
|
464
|
-
|
|
492
|
+
mainRendering.output.connectTo(output.texture);
|
|
465
493
|
this.outputBlock = output;
|
|
466
494
|
}
|
|
467
495
|
/**
|