@babylonjs/core 7.39.1 → 7.39.3
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/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/Engines/thinEngine.js +9 -3
- package/Engines/thinEngine.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.js +3 -1
- 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.js +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.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/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
|
@@ -25,6 +25,7 @@ export class NodeRenderGraphBlackAndWhitePostProcessBlock extends NodeRenderGrap
|
|
|
25
25
|
super(name, frameGraph, scene);
|
|
26
26
|
this.registerInput("source", NodeRenderGraphBlockConnectionPointTypes.Texture);
|
|
27
27
|
this.registerInput("destination", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
28
|
+
this._addDependenciesInput();
|
|
28
29
|
this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
|
|
29
30
|
this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
|
|
30
31
|
this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);
|
|
@@ -74,16 +75,9 @@ export class NodeRenderGraphBlackAndWhitePostProcessBlock extends NodeRenderGrap
|
|
|
74
75
|
}
|
|
75
76
|
_buildBlock(state) {
|
|
76
77
|
super._buildBlock(state);
|
|
77
|
-
this._frameGraphTask.name = this.name;
|
|
78
78
|
this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the "output" texture of the task
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
this._frameGraphTask.sourceTexture = sourceConnectedPoint.value;
|
|
82
|
-
}
|
|
83
|
-
const destinationConnectedPoint = this.destination.connectedPoint;
|
|
84
|
-
if (destinationConnectedPoint) {
|
|
85
|
-
this._frameGraphTask.destinationTexture = destinationConnectedPoint.value;
|
|
86
|
-
}
|
|
79
|
+
this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value;
|
|
80
|
+
this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value;
|
|
87
81
|
}
|
|
88
82
|
_dumpPropertiesCode() {
|
|
89
83
|
const codes = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blackAndWhitePostProcessBlock.js","sourceRoot":"","sources":["../../../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,CAAC,eAAe,GAAG,IAAI,2BAA2B,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,4BAA4B,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IAC7I,CAAC;IAED,2DAA2D;IAE3D,IAAW,kBAAkB;QACzB,OAAO,IAAI,CAAC,eAAe,CAAC,kBAAkB,CAAC;IACnD,CAAC;IAED,IAAW,kBAAkB,CAAC,KAAa;QACvC,IAAI,CAAC,eAAe,CAAC,kBAAkB,GAAG,KAAK,CAAC;IACpD,CAAC;IAED,iFAAiF;IAEjF,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,MAAM,CAAC;IACnD,CAAC;IAED,IAAW,MAAM,CAAC,KAAa;QAC3B,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,MAAM,GAAG,KAAK,CAAC;IACpD,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,OAAO,8CAA8C,CAAC;IAC1D,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,WAAW;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAEkB,WAAW,CAAC,KAAgC;QAC3D,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"blackAndWhitePostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE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AAC;QAC3B,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,iBAAiB,aAAa,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QACjE,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,iBAAiB,yBAAyB,IAAI,CAAC,kBAAkB,GAAG,CAAC,CAAC;QACzF,OAAO,KAAK,CAAC,mBAAmB,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;IAEe,SAAS;QACrB,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAC9C,mBAAmB,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QACzC,mBAAmB,CAAC,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAC;QACjE,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QACxC,IAAI,CAAC,MAAM,GAAG,mBAAmB,CAAC,MAAM,CAAC;QACzC,IAAI,CAAC,kBAAkB,GAAG,mBAAmB,CAAC,kBAAkB,CAAC;IACrE,CAAC;CACJ;AA3EG;IADC,sBAAsB,CAAC,sBAAsB,+CAAuC,YAAY,CAAC;sFAGjG;AAQD;IADC,sBAAsB,CAAC,QAAQ,wCAAgC,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;0EAGhG;AAiEL,aAAa,CAAC,sDAAsD,EAAE,4CAA4C,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraphTextureHandle, FrameGraph } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphBlackAndWhiteTask } from \"core/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask\";\r\nimport { ThinBlackAndWhitePostProcess } from \"core/PostProcesses/thinBlackAndWhitePostProcess\";\r\n\r\n/**\r\n * Block that implements the black and white post process\r\n */\r\nexport class NodeRenderGraphBlackAndWhitePostProcessBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphBlackAndWhiteTask;\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 BlackAndWhitePostProcessBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene) {\r\n super(name, frameGraph, scene);\r\n\r\n this.registerInput(\"source\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this._addDependenciesInput();\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\r\n this.output._typeConnectionSource = () => {\r\n return this.destination.isConnected ? this.destination : this.source;\r\n };\r\n\r\n this._frameGraphTask = new FrameGraphBlackAndWhiteTask(this.name, frameGraph, new ThinBlackAndWhitePostProcess(name, scene.getEngine()));\r\n }\r\n\r\n /** Sampling mode used to sample from the source texture */\r\n @editableInPropertyPage(\"Source sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get sourceSamplingMode() {\r\n return this._frameGraphTask.sourceSamplingMode;\r\n }\r\n\r\n public set sourceSamplingMode(value: number) {\r\n this._frameGraphTask.sourceSamplingMode = value;\r\n }\r\n\r\n /** Degree of conversion to black and white (default: 1 - full b&w conversion) */\r\n @editableInPropertyPage(\"Degree\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 1 })\r\n public get degree(): number {\r\n return this._frameGraphTask.postProcess.degree;\r\n }\r\n\r\n public set degree(value: number) {\r\n this._frameGraphTask.postProcess.degree = 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 \"NodeRenderGraphBlackAndWhitePostProcessBlock\";\r\n }\r\n\r\n /**\r\n * Gets the source input component\r\n */\r\n public get source(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the destination input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the \"output\" texture of the task\r\n\r\n this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value as FrameGraphTextureHandle;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.degree = ${this.degree};`);\r\n codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.degree = this.degree;\r\n serializationObject.sourceSamplingMode = this.sourceSamplingMode;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.degree = serializationObject.degree;\r\n this.sourceSamplingMode = serializationObject.sourceSamplingMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphBlackAndWhitePostProcessBlock\", NodeRenderGraphBlackAndWhitePostProcessBlock);\r\n"]}
|
|
@@ -27,6 +27,7 @@ export class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBlock {
|
|
|
27
27
|
this._additionalConstructionParameters = [hdr, bloomScale];
|
|
28
28
|
this.registerInput("source", NodeRenderGraphBlockConnectionPointTypes.Texture);
|
|
29
29
|
this.registerInput("destination", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
30
|
+
this._addDependenciesInput();
|
|
30
31
|
this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
|
|
31
32
|
this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
|
|
32
33
|
this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);
|
|
@@ -114,16 +115,9 @@ export class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBlock {
|
|
|
114
115
|
}
|
|
115
116
|
_buildBlock(state) {
|
|
116
117
|
super._buildBlock(state);
|
|
117
|
-
this._frameGraphTask.name = this.name;
|
|
118
118
|
this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the "output" texture of the task
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
this._frameGraphTask.sourceTexture = sourceConnectedPoint.value;
|
|
122
|
-
}
|
|
123
|
-
const destinationConnectedPoint = this.destination.connectedPoint;
|
|
124
|
-
if (destinationConnectedPoint) {
|
|
125
|
-
this._frameGraphTask.destinationTexture = destinationConnectedPoint.value;
|
|
126
|
-
}
|
|
119
|
+
this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value;
|
|
120
|
+
this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value;
|
|
127
121
|
}
|
|
128
122
|
_dumpPropertiesCode() {
|
|
129
123
|
const codes = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bloomPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAE7E;;GAEG;AACH,MAAM,OAAO,oCAAqC,SAAQ,oBAAoB;IAG1E;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;;;OAOG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,KAAY,EAAE,GAAG,GAAG,KAAK,EAAE,UAAU,GAAG,GAAG;QAChG,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAE/B,IAAI,CAAC,iCAAiC,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;QAE3D,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,wCAAwC,CAAC,OAAO,CAAC,CAAC;QAC/E,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,wCAAwC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC1F,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,wCAAwC,CAAC,YAAY,CAAC,CAAC;QAErF,IAAI,CAAC,MAAM,CAAC,+BAA+B,CAAC,wCAAwC,CAAC,uBAAuB,CAAC,CAAC;QAC9G,IAAI,CAAC,WAAW,CAAC,+BAA+B,CAAC,wCAAwC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AC,QAAQ,wCAAgC,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;kEAGhG;AAQD;IADC,sBAAsB,CAAC,QAAQ,sCAA8B,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;kEAGhG;AAgFL,aAAa,CAAC,8CAA8C,EAAE,oCAAoC,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraphTextureHandle, FrameGraph } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphBloomTask } from \"../../../Tasks/PostProcesses/bloomTask\";\r\n\r\n/**\r\n * Block that implements the bloom post process\r\n */\r\nexport class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphBloomTask;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphBloomPostProcessBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n * @param hdr If high dynamic range textures should be used (default: false)\r\n * @param bloomScale The scale of the bloom effect (default: 0.5)\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene, hdr = false, bloomScale = 0.5) {\r\n super(name, frameGraph, scene);\r\n\r\n this._additionalConstructionParameters = [hdr, bloomScale];\r\n\r\n this.registerInput(\"source\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\r\n this.output._typeConnectionSource = () => {\r\n return this.destination.isConnected ? this.destination : this.source;\r\n };\r\n\r\n this._frameGraphTask = new FrameGraphBloomTask(this.name, frameGraph, scene.getEngine(), 0.75, 64, 0.2, hdr, bloomScale);\r\n }\r\n\r\n private _createTask(bloomScale: number, hdr: boolean) {\r\n const sourceSamplingMode = this._frameGraphTask.sourceSamplingMode;\r\n const threshold = this._frameGraphTask.bloom.threshold;\r\n const weight = this._frameGraphTask.bloom.weight;\r\n const kernel = this._frameGraphTask.bloom.kernel;\r\n\r\n this._frameGraphTask.dispose();\r\n\r\n this._frameGraphTask = new FrameGraphBloomTask(this.name, this._frameGraph, this._scene.getEngine(), weight, kernel, threshold, hdr, bloomScale);\r\n this._frameGraphTask.sourceSamplingMode = sourceSamplingMode;\r\n\r\n this._additionalConstructionParameters = [hdr, bloomScale];\r\n }\r\n\r\n /** The quality of the blur effect */\r\n @editableInPropertyPage(\"Bloom scale\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get bloomScale() {\r\n return this._frameGraphTask.bloom.scale;\r\n }\r\n\r\n public set bloomScale(value: number) {\r\n this._createTask(value, this._frameGraphTask.hdr);\r\n }\r\n\r\n /** If high dynamic range textures should be used */\r\n @editableInPropertyPage(\"HDR\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get hdr(): boolean {\r\n return this._frameGraphTask.hdr;\r\n }\r\n\r\n public set hdr(value: boolean) {\r\n this._createTask(this._frameGraphTask.bloom.scale, value);\r\n }\r\n\r\n /** Sampling mode used to sample from the source texture */\r\n @editableInPropertyPage(\"Source sampling mode\", PropertyTypeForEdition.SamplingMode)\r\n public get sourceSamplingMode() {\r\n return this._frameGraphTask.sourceSamplingMode;\r\n }\r\n\r\n public set sourceSamplingMode(value: number) {\r\n this._frameGraphTask.sourceSamplingMode = value;\r\n }\r\n\r\n /** The luminance threshold to find bright areas of the image to bloom. */\r\n @editableInPropertyPage(\"Threshold\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 2 })\r\n public get threshold(): number {\r\n return this._frameGraphTask.bloom.threshold;\r\n }\r\n\r\n public set threshold(value: number) {\r\n this._frameGraphTask.bloom.threshold = value;\r\n }\r\n\r\n /** The strength of the bloom. */\r\n @editableInPropertyPage(\"Weight\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 3 })\r\n public get weight(): number {\r\n return this._frameGraphTask.bloom.weight;\r\n }\r\n\r\n public set weight(value: number) {\r\n this._frameGraphTask.bloom.weight = value;\r\n }\r\n\r\n /** Specifies the size of the bloom blur kernel, relative to the final output size */\r\n @editableInPropertyPage(\"Kernel\", PropertyTypeForEdition.Int, \"PROPERTIES\", { min: 1, max: 128 })\r\n public get kernel(): number {\r\n return this._frameGraphTask.bloom.kernel;\r\n }\r\n\r\n public set kernel(value: number) {\r\n this._frameGraphTask.bloom.kernel = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphBloomPostProcessBlock\";\r\n }\r\n\r\n /**\r\n * Gets the source input component\r\n */\r\n public get source(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the destination input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this._frameGraphTask.name = this.name;\r\n\r\n this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the \"output\" texture of the task\r\n\r\n const sourceConnectedPoint = this.source.connectedPoint;\r\n if (sourceConnectedPoint) {\r\n this._frameGraphTask.sourceTexture = sourceConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const destinationConnectedPoint = this.destination.connectedPoint;\r\n if (destinationConnectedPoint) {\r\n this._frameGraphTask.destinationTexture = destinationConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.threshold = ${this.threshold};`);\r\n codes.push(`${this._codeVariableName}.weight = ${this.weight};`);\r\n codes.push(`${this._codeVariableName}.kernel = ${this.kernel};`);\r\n codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.threshold = this.threshold;\r\n serializationObject.weight = this.weight;\r\n serializationObject.kernel = this.kernel;\r\n serializationObject.sourceSamplingMode = this.sourceSamplingMode;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.threshold = serializationObject.threshold;\r\n this.weight = serializationObject.weight;\r\n this.kernel = serializationObject.kernel;\r\n this.sourceSamplingMode = serializationObject.sourceSamplingMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphBloomPostProcessBlock\", NodeRenderGraphBloomPostProcessBlock);\r\n"]}
|
|
1
|
+
{"version":3,"file":"bloomPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAA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B,GAAG,IAAI,CAAC,kBAAkB,CAAC;QACjE,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QACxC,IAAI,CAAC,SAAS,GAAG,mBAAmB,CAAC,SAAS,CAAC;QAC/C,IAAI,CAAC,MAAM,GAAG,mBAAmB,CAAC,MAAM,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG,mBAAmB,CAAC,MAAM,CAAC;QACzC,IAAI,CAAC,kBAAkB,GAAG,mBAAmB,CAAC,kBAAkB,CAAC;IACrE,CAAC;CACJ;AAzHG;IADC,sBAAsB,CAAC,aAAa,wCAAgC,YAAY,CAAC;sEAGjF;AAQD;IADC,sBAAsB,CAAC,KAAK,0CAAkC,YAAY,CAAC;+DAG3E;AAQD;IADC,sBAAsB,CAAC,sBAAsB,8CAAsC;8EAGnF;AAQD;IADC,sBAAsB,CAAC,WAAW,wCAAgC,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;qEAGnG;AAQD;IADC,sBAAsB,CAAC,QAAQ,wCAAgC,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;kEAGhG;AAQD;IADC,sBAAsB,CAAC,QAAQ,sCAA8B,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;kEAGhG;AAuEL,aAAa,CAAC,8CAA8C,EAAE,oCAAoC,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraphTextureHandle, FrameGraph } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphBloomTask } from \"../../../Tasks/PostProcesses/bloomTask\";\r\n\r\n/**\r\n * Block that implements the bloom post process\r\n */\r\nexport class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphBloomTask;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphBloomPostProcessBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n * @param hdr If high dynamic range textures should be used (default: false)\r\n * @param bloomScale The scale of the bloom effect (default: 0.5)\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene, hdr = false, bloomScale = 0.5) {\r\n super(name, frameGraph, scene);\r\n\r\n this._additionalConstructionParameters = [hdr, bloomScale];\r\n\r\n this.registerInput(\"source\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this._addDependenciesInput();\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\r\n this.output._typeConnectionSource = () => {\r\n return this.destination.isConnected ? this.destination : this.source;\r\n };\r\n\r\n this._frameGraphTask = new FrameGraphBloomTask(this.name, frameGraph, scene.getEngine(), 0.75, 64, 0.2, hdr, bloomScale);\r\n }\r\n\r\n private _createTask(bloomScale: number, hdr: boolean) {\r\n const sourceSamplingMode = this._frameGraphTask.sourceSamplingMode;\r\n const threshold = this._frameGraphTask.bloom.threshold;\r\n const weight = this._frameGraphTask.bloom.weight;\r\n const kernel = this._frameGraphTask.bloom.kernel;\r\n\r\n this._frameGraphTask.dispose();\r\n\r\n this._frameGraphTask = new FrameGraphBloomTask(this.name, this._frameGraph, this._scene.getEngine(), weight, kernel, threshold, hdr, bloomScale);\r\n this._frameGraphTask.sourceSamplingMode = sourceSamplingMode;\r\n\r\n this._additionalConstructionParameters = [hdr, bloomScale];\r\n }\r\n\r\n /** The quality of the blur effect */\r\n @editableInPropertyPage(\"Bloom scale\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get bloomScale() {\r\n return this._frameGraphTask.bloom.scale;\r\n }\r\n\r\n public set bloomScale(value: number) {\r\n this._createTask(value, this._frameGraphTask.hdr);\r\n }\r\n\r\n /** If high dynamic range textures should be used */\r\n @editableInPropertyPage(\"HDR\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get hdr(): boolean {\r\n return this._frameGraphTask.hdr;\r\n }\r\n\r\n public set hdr(value: boolean) {\r\n this._createTask(this._frameGraphTask.bloom.scale, value);\r\n }\r\n\r\n /** Sampling mode used to sample from the source texture */\r\n @editableInPropertyPage(\"Source sampling mode\", PropertyTypeForEdition.SamplingMode)\r\n public get sourceSamplingMode() {\r\n return this._frameGraphTask.sourceSamplingMode;\r\n }\r\n\r\n public set sourceSamplingMode(value: number) {\r\n this._frameGraphTask.sourceSamplingMode = value;\r\n }\r\n\r\n /** The luminance threshold to find bright areas of the image to bloom. */\r\n @editableInPropertyPage(\"Threshold\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 2 })\r\n public get threshold(): number {\r\n return this._frameGraphTask.bloom.threshold;\r\n }\r\n\r\n public set threshold(value: number) {\r\n this._frameGraphTask.bloom.threshold = value;\r\n }\r\n\r\n /** The strength of the bloom. */\r\n @editableInPropertyPage(\"Weight\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 3 })\r\n public get weight(): number {\r\n return this._frameGraphTask.bloom.weight;\r\n }\r\n\r\n public set weight(value: number) {\r\n this._frameGraphTask.bloom.weight = value;\r\n }\r\n\r\n /** Specifies the size of the bloom blur kernel, relative to the final output size */\r\n @editableInPropertyPage(\"Kernel\", PropertyTypeForEdition.Int, \"PROPERTIES\", { min: 1, max: 128 })\r\n public get kernel(): number {\r\n return this._frameGraphTask.bloom.kernel;\r\n }\r\n\r\n public set kernel(value: number) {\r\n this._frameGraphTask.bloom.kernel = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphBloomPostProcessBlock\";\r\n }\r\n\r\n /**\r\n * Gets the source input component\r\n */\r\n public get source(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the destination input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the \"output\" texture of the task\r\n\r\n this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value as FrameGraphTextureHandle;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.threshold = ${this.threshold};`);\r\n codes.push(`${this._codeVariableName}.weight = ${this.weight};`);\r\n codes.push(`${this._codeVariableName}.kernel = ${this.kernel};`);\r\n codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.threshold = this.threshold;\r\n serializationObject.weight = this.weight;\r\n serializationObject.kernel = this.kernel;\r\n serializationObject.sourceSamplingMode = this.sourceSamplingMode;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.threshold = serializationObject.threshold;\r\n this.weight = serializationObject.weight;\r\n this.kernel = serializationObject.kernel;\r\n this.sourceSamplingMode = serializationObject.sourceSamplingMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphBloomPostProcessBlock\", NodeRenderGraphBloomPostProcessBlock);\r\n"]}
|
|
@@ -26,6 +26,7 @@ export class NodeRenderGraphBlurPostProcessBlock extends NodeRenderGraphBlock {
|
|
|
26
26
|
super(name, frameGraph, scene);
|
|
27
27
|
this.registerInput("source", NodeRenderGraphBlockConnectionPointTypes.Texture);
|
|
28
28
|
this.registerInput("destination", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
29
|
+
this._addDependenciesInput();
|
|
29
30
|
this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
|
|
30
31
|
this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
|
|
31
32
|
this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);
|
|
@@ -82,16 +83,9 @@ export class NodeRenderGraphBlurPostProcessBlock extends NodeRenderGraphBlock {
|
|
|
82
83
|
}
|
|
83
84
|
_buildBlock(state) {
|
|
84
85
|
super._buildBlock(state);
|
|
85
|
-
this._frameGraphTask.name = this.name;
|
|
86
86
|
this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the "output" texture of the task
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
this._frameGraphTask.sourceTexture = sourceConnectedPoint.value;
|
|
90
|
-
}
|
|
91
|
-
const destinationConnectedPoint = this.destination.connectedPoint;
|
|
92
|
-
if (destinationConnectedPoint) {
|
|
93
|
-
this._frameGraphTask.destinationTexture = destinationConnectedPoint.value;
|
|
94
|
-
}
|
|
87
|
+
this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value;
|
|
88
|
+
this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value;
|
|
95
89
|
}
|
|
96
90
|
_dumpPropertiesCode() {
|
|
97
91
|
const codes = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blurPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,kBAAkB,EAAE,iDAAqD;AAClF,OAAO,EAAE,mBAAmB,EAAE,yDAA+C;AAC7E,OAAO,EAAE,OAAO,EAAE,yCAA+B;AAEjD;;GAEG;AACH,MAAM,OAAO,mCAAoC,SAAQ,oBAAoB;IAGzE;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;OAKG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,KAAY;QACjE,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAE/B,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,wCAAwC,CAAC,OAAO,CAAC,CAAC;QAC/E,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,wCAAwC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC1F,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,wCAAwC,CAAC,YAAY,CAAC,CAAC;QAErF,IAAI,CAAC,MAAM,CAAC,+BAA+B,CAAC,wCAAwC,CA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iB,yBAAyB,IAAI,CAAC,kBAAkB,GAAG,CAAC,CAAC;QACzF,OAAO,KAAK,CAAC,mBAAmB,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;IAEe,SAAS;QACrB,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAC9C,mBAAmB,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;QACzD,mBAAmB,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QACzC,mBAAmB,CAAC,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAC;QACjE,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QACxC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;QACxD,IAAI,CAAC,MAAM,GAAG,mBAAmB,CAAC,MAAM,CAAC;QACzC,IAAI,CAAC,kBAAkB,GAAG,mBAAmB,CAAC,kBAAkB,CAAC;IACrE,CAAC;CACJ;AAjGG;IADC,sBAAsB,CAAC,sBAAsB,+CAAuC,YAAY,CAAC;6EAGjG;AAQD;IADC,sBAAsB,CAAC,WAAW,0CAAkC,YAAY,CAAC;oEAGjF;AAQD;IADC,sBAAsB,CAAC,QAAQ,sCAA8B,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;iEAGhG;AA6EL,aAAa,CAAC,6CAA6C,EAAE,mCAAmC,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraphTextureHandle, FrameGraph } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphBlurTask } from \"core/FrameGraph/Tasks/PostProcesses/blurTask\";\r\nimport { ThinBlurPostProcess } from \"core/PostProcesses/thinBlurPostProcess\";\r\nimport { Vector2 } from \"core/Maths/math.vector\";\r\n\r\n/**\r\n * Block that implements the blur post process\r\n */\r\nexport class NodeRenderGraphBlurPostProcessBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphBlurTask;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphBlurPostProcessBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene) {\r\n super(name, frameGraph, scene);\r\n\r\n this.registerInput(\"source\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\r\n this.output._typeConnectionSource = () => {\r\n return this.destination.isConnected ? this.destination : this.source;\r\n };\r\n\r\n this._frameGraphTask = new FrameGraphBlurTask(this.name, frameGraph, new ThinBlurPostProcess(name, scene.getEngine(), new Vector2(1, 0), 32));\r\n }\r\n\r\n /** Sampling mode used to sample from the source texture */\r\n @editableInPropertyPage(\"Source sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get sourceSamplingMode() {\r\n return this._frameGraphTask.sourceSamplingMode;\r\n }\r\n\r\n public set sourceSamplingMode(value: number) {\r\n this._frameGraphTask.sourceSamplingMode = value;\r\n }\r\n\r\n /** The direction in which to blur the image */\r\n @editableInPropertyPage(\"Direction\", PropertyTypeForEdition.Vector2, \"PROPERTIES\")\r\n public get direction(): Vector2 {\r\n return this._frameGraphTask.postProcess.direction;\r\n }\r\n\r\n public set direction(value: Vector2) {\r\n this._frameGraphTask.postProcess.direction = value;\r\n }\r\n\r\n /** Length in pixels of the blur sample region */\r\n @editableInPropertyPage(\"Kernel\", PropertyTypeForEdition.Int, \"PROPERTIES\", { min: 1, max: 256 })\r\n public get kernel(): number {\r\n return this._frameGraphTask.postProcess.kernel;\r\n }\r\n\r\n public set kernel(value: number) {\r\n this._frameGraphTask.postProcess.kernel = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphBlurPostProcessBlock\";\r\n }\r\n\r\n /**\r\n * Gets the source input component\r\n */\r\n public get source(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the destination input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this._frameGraphTask.name = this.name;\r\n\r\n this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the \"output\" texture of the task\r\n\r\n const sourceConnectedPoint = this.source.connectedPoint;\r\n if (sourceConnectedPoint) {\r\n this._frameGraphTask.sourceTexture = sourceConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const destinationConnectedPoint = this.destination.connectedPoint;\r\n if (destinationConnectedPoint) {\r\n this._frameGraphTask.destinationTexture = destinationConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.direction = new BABYLON.Vector2(${this.direction.x}, ${this.direction.y});`);\r\n codes.push(`${this._codeVariableName}.kernel = ${this.kernel};`);\r\n codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.direction = this.direction.asArray();\r\n serializationObject.kernel = this.kernel;\r\n serializationObject.sourceSamplingMode = this.sourceSamplingMode;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.direction.fromArray(serializationObject.direction);\r\n this.kernel = serializationObject.kernel;\r\n this.sourceSamplingMode = serializationObject.sourceSamplingMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphBlurPostProcessBlock\", NodeRenderGraphBlurPostProcessBlock);\r\n"]}
|
|
1
|
+
{"version":3,"file":"blurPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,kBAAkB,EAAE,iDAAqD;AAClF,OAAO,EAAE,mBAAmB,EAAE,yDAA+C;AAC7E,OAAO,EAAE,OAAO,EAAE,yCAA+B;AAEjD;;GAEG;AACH,MAAM,OAAO,mCAAoC,SAAQ,oBAAoB;IAGzE;;OAEG;IACH,IA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AE,GAAG,EAAE,CAAC;iEAGhG;AAoEL,aAAa,CAAC,6CAA6C,EAAE,mCAAmC,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraphTextureHandle, FrameGraph } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphBlurTask } from \"core/FrameGraph/Tasks/PostProcesses/blurTask\";\r\nimport { ThinBlurPostProcess } from \"core/PostProcesses/thinBlurPostProcess\";\r\nimport { Vector2 } from \"core/Maths/math.vector\";\r\n\r\n/**\r\n * Block that implements the blur post process\r\n */\r\nexport class NodeRenderGraphBlurPostProcessBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphBlurTask;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphBlurPostProcessBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene) {\r\n super(name, frameGraph, scene);\r\n\r\n this.registerInput(\"source\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this._addDependenciesInput();\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\r\n this.output._typeConnectionSource = () => {\r\n return this.destination.isConnected ? this.destination : this.source;\r\n };\r\n\r\n this._frameGraphTask = new FrameGraphBlurTask(this.name, frameGraph, new ThinBlurPostProcess(name, scene.getEngine(), new Vector2(1, 0), 32));\r\n }\r\n\r\n /** Sampling mode used to sample from the source texture */\r\n @editableInPropertyPage(\"Source sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get sourceSamplingMode() {\r\n return this._frameGraphTask.sourceSamplingMode;\r\n }\r\n\r\n public set sourceSamplingMode(value: number) {\r\n this._frameGraphTask.sourceSamplingMode = value;\r\n }\r\n\r\n /** The direction in which to blur the image */\r\n @editableInPropertyPage(\"Direction\", PropertyTypeForEdition.Vector2, \"PROPERTIES\")\r\n public get direction(): Vector2 {\r\n return this._frameGraphTask.postProcess.direction;\r\n }\r\n\r\n public set direction(value: Vector2) {\r\n this._frameGraphTask.postProcess.direction = value;\r\n }\r\n\r\n /** Length in pixels of the blur sample region */\r\n @editableInPropertyPage(\"Kernel\", PropertyTypeForEdition.Int, \"PROPERTIES\", { min: 1, max: 256 })\r\n public get kernel(): number {\r\n return this._frameGraphTask.postProcess.kernel;\r\n }\r\n\r\n public set kernel(value: number) {\r\n this._frameGraphTask.postProcess.kernel = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphBlurPostProcessBlock\";\r\n }\r\n\r\n /**\r\n * Gets the source input component\r\n */\r\n public get source(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the destination input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the \"output\" texture of the task\r\n\r\n this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value as FrameGraphTextureHandle;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.direction = new BABYLON.Vector2(${this.direction.x}, ${this.direction.y});`);\r\n codes.push(`${this._codeVariableName}.kernel = ${this.kernel};`);\r\n codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.direction = this.direction.asArray();\r\n serializationObject.kernel = this.kernel;\r\n serializationObject.sourceSamplingMode = this.sourceSamplingMode;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.direction.fromArray(serializationObject.direction);\r\n this.kernel = serializationObject.kernel;\r\n this.sourceSamplingMode = serializationObject.sourceSamplingMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphBlurPostProcessBlock\", NodeRenderGraphBlurPostProcessBlock);\r\n"]}
|
|
@@ -27,6 +27,7 @@ export class NodeRenderGraphCircleOfConfusionPostProcessBlock extends NodeRender
|
|
|
27
27
|
this.registerInput("geomViewDepth", NodeRenderGraphBlockConnectionPointTypes.TextureViewDepth);
|
|
28
28
|
this.registerInput("destination", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
29
29
|
this.registerInput("camera", NodeRenderGraphBlockConnectionPointTypes.Camera);
|
|
30
|
+
this._addDependenciesInput();
|
|
30
31
|
this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
|
|
31
32
|
this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
|
|
32
33
|
this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);
|
|
@@ -116,24 +117,11 @@ export class NodeRenderGraphCircleOfConfusionPostProcessBlock extends NodeRender
|
|
|
116
117
|
}
|
|
117
118
|
_buildBlock(state) {
|
|
118
119
|
super._buildBlock(state);
|
|
119
|
-
this._frameGraphTask.name = this.name;
|
|
120
120
|
this.output.value = this._frameGraphTask.outputTexture;
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
const geomViewDepthConnectedPoint = this.geomViewDepth.connectedPoint;
|
|
126
|
-
if (geomViewDepthConnectedPoint) {
|
|
127
|
-
this._frameGraphTask.depthTexture = geomViewDepthConnectedPoint.value;
|
|
128
|
-
}
|
|
129
|
-
const destinationConnectedPoint = this.destination.connectedPoint;
|
|
130
|
-
if (destinationConnectedPoint) {
|
|
131
|
-
this._frameGraphTask.destinationTexture = destinationConnectedPoint.value;
|
|
132
|
-
}
|
|
133
|
-
const cameraConnectedPoint = this.camera.connectedPoint;
|
|
134
|
-
if (cameraConnectedPoint) {
|
|
135
|
-
this._frameGraphTask.camera = cameraConnectedPoint.value;
|
|
136
|
-
}
|
|
121
|
+
this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value;
|
|
122
|
+
this._frameGraphTask.depthTexture = this.geomViewDepth.connectedPoint?.value;
|
|
123
|
+
this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value;
|
|
124
|
+
this._frameGraphTask.camera = this.camera.connectedPoint?.value;
|
|
137
125
|
}
|
|
138
126
|
_dumpPropertiesCode() {
|
|
139
127
|
const codes = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"circleOfConfusionPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAo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B,CAAC,gBAAgB,wCAAgC,YAAY,CAAC;qFAGpF;AAQD;IADC,sBAAsB,CAAC,cAAc,wCAAgC,YAAY,CAAC;mFAGlF;AA8GL,aAAa,CAAC,0DAA0D,EAAE,gDAAgD,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraphTextureHandle, FrameGraph, Camera } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphCircleOfConfusionTask } from \"core/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask\";\r\nimport { ThinCircleOfConfusionPostProcess } from \"core/PostProcesses/thinCircleOfConfusionPostProcess\";\r\n\r\n/**\r\n * Block that implements the circle of confusion post process\r\n */\r\nexport class NodeRenderGraphCircleOfConfusionPostProcessBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphCircleOfConfusionTask;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphCircleOfConfusionPostProcessBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene) {\r\n super(name, frameGraph, scene);\r\n\r\n this.registerInput(\"source\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"geomViewDepth\", NodeRenderGraphBlockConnectionPointTypes.TextureViewDepth);\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this.registerInput(\"camera\", NodeRenderGraphBlockConnectionPointTypes.Camera);\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\r\n this.output._typeConnectionSource = () => {\r\n return this.destination.isConnected ? this.destination : this.source;\r\n };\r\n\r\n this._frameGraphTask = new FrameGraphCircleOfConfusionTask(\r\n this.name,\r\n frameGraph,\r\n new ThinCircleOfConfusionPostProcess(name, scene.getEngine(), { depthNotNormalized: true })\r\n );\r\n }\r\n\r\n /** Sampling mode used to sample from the source texture */\r\n @editableInPropertyPage(\"Source sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get sourceSamplingMode() {\r\n return this._frameGraphTask.sourceSamplingMode;\r\n }\r\n\r\n public set sourceSamplingMode(value: number) {\r\n this._frameGraphTask.sourceSamplingMode = value;\r\n }\r\n\r\n /** Sampling mode used to sample from the depth texture */\r\n @editableInPropertyPage(\"Depth sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get depthSamplingMode() {\r\n return this._frameGraphTask.depthSamplingMode;\r\n }\r\n\r\n public set depthSamplingMode(value: number) {\r\n this._frameGraphTask.depthSamplingMode = value;\r\n }\r\n\r\n /** Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. The diameter of the resulting aperture can be computed by lensSize/fStop. */\r\n @editableInPropertyPage(\"Lens size\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get lensSize(): number {\r\n return this._frameGraphTask.postProcess.lensSize;\r\n }\r\n\r\n public set lensSize(value: number) {\r\n this._frameGraphTask.postProcess.lensSize = value;\r\n }\r\n\r\n /** F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop */\r\n @editableInPropertyPage(\"F-Stop\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get fStop(): number {\r\n return this._frameGraphTask.postProcess.fStop;\r\n }\r\n\r\n public set fStop(value: number) {\r\n this._frameGraphTask.postProcess.fStop = value;\r\n }\r\n\r\n /** Distance away from the camera to focus on in scene units/1000 (eg. millimeter) */\r\n @editableInPropertyPage(\"Focus distance\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get focusDistance(): number {\r\n return this._frameGraphTask.postProcess.focusDistance;\r\n }\r\n\r\n public set focusDistance(value: number) {\r\n this._frameGraphTask.postProcess.focusDistance = value;\r\n }\r\n\r\n /** Focal length of the effect's camera in scene units/1000 (eg. millimeter) */\r\n @editableInPropertyPage(\"Focal length\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get focalLength(): number {\r\n return this._frameGraphTask.postProcess.focalLength;\r\n }\r\n\r\n public set focalLength(value: number) {\r\n this._frameGraphTask.postProcess.focalLength = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphCircleOfConfusionPostProcessBlock\";\r\n }\r\n\r\n /**\r\n * Gets the source input component\r\n */\r\n public get source(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the geometry view depth input component\r\n */\r\n public get geomViewDepth(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the destination input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the camera input component\r\n */\r\n public get camera(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this._frameGraphTask.name = this.name;\r\n\r\n this.output.value = this._frameGraphTask.outputTexture;\r\n\r\n const sourceConnectedPoint = this.source.connectedPoint;\r\n if (sourceConnectedPoint) {\r\n this._frameGraphTask.sourceTexture = sourceConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const geomViewDepthConnectedPoint = this.geomViewDepth.connectedPoint;\r\n if (geomViewDepthConnectedPoint) {\r\n this._frameGraphTask.depthTexture = geomViewDepthConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const destinationConnectedPoint = this.destination.connectedPoint;\r\n if (destinationConnectedPoint) {\r\n this._frameGraphTask.destinationTexture = destinationConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const cameraConnectedPoint = this.camera.connectedPoint;\r\n if (cameraConnectedPoint) {\r\n this._frameGraphTask.camera = cameraConnectedPoint.value as Camera;\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.lensSize = ${this.lensSize};`);\r\n codes.push(`${this._codeVariableName}.fStop = ${this.fStop};`);\r\n codes.push(`${this._codeVariableName}.focusDistance = ${this.focusDistance};`);\r\n codes.push(`${this._codeVariableName}.focalLength = ${this.focalLength};`);\r\n codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);\r\n codes.push(`${this._codeVariableName}.depthSamplingMode = ${this.depthSamplingMode};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.lensSize = this.lensSize;\r\n serializationObject.fStop = this.fStop;\r\n serializationObject.focusDistance = this.focusDistance;\r\n serializationObject.focalLength = this.focalLength;\r\n serializationObject.sourceSamplingMode = this.sourceSamplingMode;\r\n serializationObject.depthSamplingMode = this.depthSamplingMode;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.lensSize = serializationObject.lensSize;\r\n this.fStop = serializationObject.fStop;\r\n this.focusDistance = serializationObject.focusDistance;\r\n this.focalLength = serializationObject.focalLength;\r\n this.sourceSamplingMode = serializationObject.sourceSamplingMode;\r\n this.depthSamplingMode = serializationObject.depthSamplingMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphCircleOfConfusionPostProcessBlock\", NodeRenderGraphCircleOfConfusionPostProcessBlock);\r\n"]}
|
|
1
|
+
{"version":3,"file":"circleOfConfusionPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,+BAA+B,EAAE,8DAAkE;AAC5G,OAAO,EAAE,gCAAgC,EAAE,sEAA4D;AAEvG;;GAEG;AACH,MAAM,OAAO,gDAAiD,SAAQ,oBAAoB;IAGtF;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;OAKG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,KAAY;QACjE,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAE/B,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,wCAAwC,CAAC,OAAO,CAAC,CAAC;QAC/E,IAAI,CAAC,aAAa,CAAC,eAAe,EAAE,wCAAwC,CAAC,gBAAgB,CAAC,CAAC;QAC/F,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,wCAAwC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC1F,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,wCAAwC,CAAC,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YAAY,CAAC;6EAG5E;AAQD;IADC,sBAAsB,CAAC,gBAAgB,wCAAgC,YAAY,CAAC;qFAGpF;AAQD;IADC,sBAAsB,CAAC,cAAc,wCAAgC,YAAY,CAAC;mFAGlF;AA6FL,aAAa,CAAC,0DAA0D,EAAE,gDAAgD,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraphTextureHandle, FrameGraph, Camera } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphCircleOfConfusionTask } from \"core/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask\";\r\nimport { ThinCircleOfConfusionPostProcess } from \"core/PostProcesses/thinCircleOfConfusionPostProcess\";\r\n\r\n/**\r\n * Block that implements the circle of confusion post process\r\n */\r\nexport class NodeRenderGraphCircleOfConfusionPostProcessBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphCircleOfConfusionTask;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphCircleOfConfusionPostProcessBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene) {\r\n super(name, frameGraph, scene);\r\n\r\n this.registerInput(\"source\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"geomViewDepth\", NodeRenderGraphBlockConnectionPointTypes.TextureViewDepth);\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this.registerInput(\"camera\", NodeRenderGraphBlockConnectionPointTypes.Camera);\r\n this._addDependenciesInput();\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\r\n this.output._typeConnectionSource = () => {\r\n return this.destination.isConnected ? this.destination : this.source;\r\n };\r\n\r\n this._frameGraphTask = new FrameGraphCircleOfConfusionTask(\r\n this.name,\r\n frameGraph,\r\n new ThinCircleOfConfusionPostProcess(name, scene.getEngine(), { depthNotNormalized: true })\r\n );\r\n }\r\n\r\n /** Sampling mode used to sample from the source texture */\r\n @editableInPropertyPage(\"Source sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get sourceSamplingMode() {\r\n return this._frameGraphTask.sourceSamplingMode;\r\n }\r\n\r\n public set sourceSamplingMode(value: number) {\r\n this._frameGraphTask.sourceSamplingMode = value;\r\n }\r\n\r\n /** Sampling mode used to sample from the depth texture */\r\n @editableInPropertyPage(\"Depth sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get depthSamplingMode() {\r\n return this._frameGraphTask.depthSamplingMode;\r\n }\r\n\r\n public set depthSamplingMode(value: number) {\r\n this._frameGraphTask.depthSamplingMode = value;\r\n }\r\n\r\n /** Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. The diameter of the resulting aperture can be computed by lensSize/fStop. */\r\n @editableInPropertyPage(\"Lens size\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get lensSize(): number {\r\n return this._frameGraphTask.postProcess.lensSize;\r\n }\r\n\r\n public set lensSize(value: number) {\r\n this._frameGraphTask.postProcess.lensSize = value;\r\n }\r\n\r\n /** F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop */\r\n @editableInPropertyPage(\"F-Stop\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get fStop(): number {\r\n return this._frameGraphTask.postProcess.fStop;\r\n }\r\n\r\n public set fStop(value: number) {\r\n this._frameGraphTask.postProcess.fStop = value;\r\n }\r\n\r\n /** Distance away from the camera to focus on in scene units/1000 (eg. millimeter) */\r\n @editableInPropertyPage(\"Focus distance\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get focusDistance(): number {\r\n return this._frameGraphTask.postProcess.focusDistance;\r\n }\r\n\r\n public set focusDistance(value: number) {\r\n this._frameGraphTask.postProcess.focusDistance = value;\r\n }\r\n\r\n /** Focal length of the effect's camera in scene units/1000 (eg. millimeter) */\r\n @editableInPropertyPage(\"Focal length\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get focalLength(): number {\r\n return this._frameGraphTask.postProcess.focalLength;\r\n }\r\n\r\n public set focalLength(value: number) {\r\n this._frameGraphTask.postProcess.focalLength = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphCircleOfConfusionPostProcessBlock\";\r\n }\r\n\r\n /**\r\n * Gets the source input component\r\n */\r\n public get source(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the geometry view depth input component\r\n */\r\n public get geomViewDepth(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the destination input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the camera input component\r\n */\r\n public get camera(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this.output.value = this._frameGraphTask.outputTexture;\r\n\r\n this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.depthTexture = this.geomViewDepth.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.camera = this.camera.connectedPoint?.value as Camera;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.lensSize = ${this.lensSize};`);\r\n codes.push(`${this._codeVariableName}.fStop = ${this.fStop};`);\r\n codes.push(`${this._codeVariableName}.focusDistance = ${this.focusDistance};`);\r\n codes.push(`${this._codeVariableName}.focalLength = ${this.focalLength};`);\r\n codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);\r\n codes.push(`${this._codeVariableName}.depthSamplingMode = ${this.depthSamplingMode};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.lensSize = this.lensSize;\r\n serializationObject.fStop = this.fStop;\r\n serializationObject.focusDistance = this.focusDistance;\r\n serializationObject.focalLength = this.focalLength;\r\n serializationObject.sourceSamplingMode = this.sourceSamplingMode;\r\n serializationObject.depthSamplingMode = this.depthSamplingMode;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.lensSize = serializationObject.lensSize;\r\n this.fStop = serializationObject.fStop;\r\n this.focusDistance = serializationObject.focusDistance;\r\n this.focalLength = serializationObject.focalLength;\r\n this.sourceSamplingMode = serializationObject.sourceSamplingMode;\r\n this.depthSamplingMode = serializationObject.depthSamplingMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphCircleOfConfusionPostProcessBlock\", NodeRenderGraphCircleOfConfusionPostProcessBlock);\r\n"]}
|
|
@@ -29,6 +29,7 @@ export class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRenderGraph
|
|
|
29
29
|
this.registerInput("geomViewDepth", NodeRenderGraphBlockConnectionPointTypes.TextureViewDepth);
|
|
30
30
|
this.registerInput("destination", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
31
31
|
this.registerInput("camera", NodeRenderGraphBlockConnectionPointTypes.Camera);
|
|
32
|
+
this._addDependenciesInput();
|
|
32
33
|
this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
|
|
33
34
|
this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
|
|
34
35
|
this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);
|
|
@@ -149,24 +150,11 @@ export class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRenderGraph
|
|
|
149
150
|
}
|
|
150
151
|
_buildBlock(state) {
|
|
151
152
|
super._buildBlock(state);
|
|
152
|
-
this._frameGraphTask.name = this.name;
|
|
153
153
|
this.output.value = this._frameGraphTask.outputTexture;
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
const geomViewDepthConnectedPoint = this.geomViewDepth.connectedPoint;
|
|
159
|
-
if (geomViewDepthConnectedPoint) {
|
|
160
|
-
this._frameGraphTask.depthTexture = geomViewDepthConnectedPoint.value;
|
|
161
|
-
}
|
|
162
|
-
const destinationConnectedPoint = this.destination.connectedPoint;
|
|
163
|
-
if (destinationConnectedPoint) {
|
|
164
|
-
this._frameGraphTask.destinationTexture = destinationConnectedPoint.value;
|
|
165
|
-
}
|
|
166
|
-
const cameraConnectedPoint = this.camera.connectedPoint;
|
|
167
|
-
if (cameraConnectedPoint) {
|
|
168
|
-
this._frameGraphTask.camera = cameraConnectedPoint.value;
|
|
169
|
-
}
|
|
154
|
+
this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value;
|
|
155
|
+
this._frameGraphTask.depthTexture = this.geomViewDepth.connectedPoint?.value;
|
|
156
|
+
this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value;
|
|
157
|
+
this._frameGraphTask.camera = this.camera.connectedPoint?.value;
|
|
170
158
|
}
|
|
171
159
|
_dumpPropertiesCode() {
|
|
172
160
|
const codes = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"depthOfFieldPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAG3F;;GAEG;AACH,MAAM,OAAO,2CAA4C,SAAQ,oBAAoB;IAGjF;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;;;OAOG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,KAAY,EAAE,uDAAgF,EAAE,GAAG,GAAG,KAAK;QAChK,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAE/B,IAAI,CAAC,iCAAiC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;QAE1D,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,wCAAwC,CAAC,OAAO,CAAC,CAAC;QAC/E,IAAI,CAAC,aAAa,CAAC,eAAe,EAAE,wCAAwC,CAAC,gBAAgB,CAAC,CAAC;QAC/F,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,wCAAwC,CAAC,OAAO,EAAE,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C;2EAG/E;AA8GL,aAAa,CAAC,qDAAqD,EAAE,2CAA2C,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraphTextureHandle, FrameGraph, Camera } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphDepthOfFieldTask } from \"../../../Tasks/PostProcesses/depthOfFieldTask\";\r\nimport { ThinDepthOfFieldEffectBlurLevel } from \"core/PostProcesses/thinDepthOfFieldEffect\";\r\n\r\n/**\r\n * Block that implements the depth of field post process\r\n */\r\nexport class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphDepthOfFieldTask;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphDepthOfFieldPostProcessBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n * @param blurLevel The quality of the depth of field effect (default: ThinDepthOfFieldEffectBlurLevel.Low)\r\n * @param hdr If high dynamic range textures should be used (default: false)\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene, blurLevel: ThinDepthOfFieldEffectBlurLevel = ThinDepthOfFieldEffectBlurLevel.Low, hdr = false) {\r\n super(name, frameGraph, scene);\r\n\r\n this._additionalConstructionParameters = [blurLevel, hdr];\r\n\r\n this.registerInput(\"source\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"geomViewDepth\", NodeRenderGraphBlockConnectionPointTypes.TextureViewDepth);\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this.registerInput(\"camera\", NodeRenderGraphBlockConnectionPointTypes.Camera);\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\r\n this.output._typeConnectionSource = () => {\r\n return this.destination.isConnected ? this.destination : this.source;\r\n };\r\n\r\n this._frameGraphTask = new FrameGraphDepthOfFieldTask(this.name, frameGraph, scene.getEngine(), blurLevel, hdr);\r\n }\r\n\r\n private _createTask(blurLevel: ThinDepthOfFieldEffectBlurLevel, hdr: boolean) {\r\n const sourceSamplingMode = this._frameGraphTask.sourceSamplingMode;\r\n const depthSamplingMode = this._frameGraphTask.depthSamplingMode;\r\n const focalLength = this._frameGraphTask.depthOfField.focalLength;\r\n const fStop = this._frameGraphTask.depthOfField.fStop;\r\n const focusDistance = this._frameGraphTask.depthOfField.focusDistance;\r\n const lensSize = this._frameGraphTask.depthOfField.lensSize;\r\n\r\n this._frameGraphTask.dispose();\r\n\r\n this._frameGraphTask = new FrameGraphDepthOfFieldTask(this.name, this._frameGraph, this._scene.getEngine(), blurLevel, hdr);\r\n this._frameGraphTask.sourceSamplingMode = sourceSamplingMode;\r\n this._frameGraphTask.depthSamplingMode = depthSamplingMode;\r\n this._frameGraphTask.depthOfField.focalLength = focalLength;\r\n this._frameGraphTask.depthOfField.fStop = fStop;\r\n this._frameGraphTask.depthOfField.focusDistance = focusDistance;\r\n this._frameGraphTask.depthOfField.lensSize = lensSize;\r\n\r\n this._additionalConstructionParameters = [blurLevel, hdr];\r\n }\r\n\r\n /** The quality of the blur effect */\r\n @editableInPropertyPage(\"Blur level\", PropertyTypeForEdition.List, \"PROPERTIES\", {\r\n options: [\r\n { label: \"Low\", value: ThinDepthOfFieldEffectBlurLevel.Low },\r\n { label: \"Medium\", value: ThinDepthOfFieldEffectBlurLevel.Medium },\r\n { label: \"High\", value: ThinDepthOfFieldEffectBlurLevel.High },\r\n ],\r\n })\r\n public get blurLevel(): ThinDepthOfFieldEffectBlurLevel {\r\n return this._frameGraphTask.depthOfField.blurLevel;\r\n }\r\n\r\n public set blurLevel(value: ThinDepthOfFieldEffectBlurLevel) {\r\n this._createTask(value, this._frameGraphTask.hdr);\r\n }\r\n\r\n /** If high dynamic range textures should be used */\r\n @editableInPropertyPage(\"HDR\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get hdr(): boolean {\r\n return this._frameGraphTask.hdr;\r\n }\r\n\r\n public set hdr(value: boolean) {\r\n this._createTask(this._frameGraphTask.depthOfField.blurLevel, value);\r\n }\r\n\r\n /** Sampling mode used to sample from the source texture */\r\n @editableInPropertyPage(\"Source sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get sourceSamplingMode() {\r\n return this._frameGraphTask.sourceSamplingMode;\r\n }\r\n\r\n public set sourceSamplingMode(value: number) {\r\n this._frameGraphTask.sourceSamplingMode = value;\r\n }\r\n\r\n /** Sampling mode used to sample from the depth texture */\r\n @editableInPropertyPage(\"Depth sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get depthSamplingMode() {\r\n return this._frameGraphTask.depthSamplingMode;\r\n }\r\n\r\n public set depthSamplingMode(value: number) {\r\n this._frameGraphTask.depthSamplingMode = value;\r\n }\r\n\r\n /** The focal the length of the camera used in the effect in scene units/1000 (eg. millimeter). */\r\n @editableInPropertyPage(\"Focal length\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get focalLength(): number {\r\n return this._frameGraphTask.depthOfField.focalLength;\r\n }\r\n\r\n public set focalLength(value: number) {\r\n this._frameGraphTask.depthOfField.focalLength = value;\r\n }\r\n\r\n /** F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop. */\r\n @editableInPropertyPage(\"F-Stop\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get fStop(): number {\r\n return this._frameGraphTask.depthOfField.fStop;\r\n }\r\n\r\n public set fStop(value: number) {\r\n this._frameGraphTask.depthOfField.fStop = value;\r\n }\r\n\r\n /** Distance away from the camera to focus on in scene units/1000 (eg. millimeter). */\r\n @editableInPropertyPage(\"Focus distance\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get focusDistance(): number {\r\n return this._frameGraphTask.depthOfField.focusDistance;\r\n }\r\n\r\n public set focusDistance(value: number) {\r\n this._frameGraphTask.depthOfField.focusDistance = value;\r\n }\r\n\r\n /** Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. The diameter of the resulting aperture can be computed by lensSize/fStop. */\r\n @editableInPropertyPage(\"Lens size\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get lensSize(): number {\r\n return this._frameGraphTask.depthOfField.lensSize;\r\n }\r\n\r\n public set lensSize(value: number) {\r\n this._frameGraphTask.depthOfField.lensSize = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphDepthOfFieldPostProcessBlock\";\r\n }\r\n\r\n /**\r\n * Gets the source input component\r\n */\r\n public get source(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the geometry view depth input component\r\n */\r\n public get geomViewDepth(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the destination input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the camera input component\r\n */\r\n public get camera(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this._frameGraphTask.name = this.name;\r\n\r\n this.output.value = this._frameGraphTask.outputTexture;\r\n\r\n const sourceConnectedPoint = this.source.connectedPoint;\r\n if (sourceConnectedPoint) {\r\n this._frameGraphTask.sourceTexture = sourceConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const geomViewDepthConnectedPoint = this.geomViewDepth.connectedPoint;\r\n if (geomViewDepthConnectedPoint) {\r\n this._frameGraphTask.depthTexture = geomViewDepthConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const destinationConnectedPoint = this.destination.connectedPoint;\r\n if (destinationConnectedPoint) {\r\n this._frameGraphTask.destinationTexture = destinationConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const cameraConnectedPoint = this.camera.connectedPoint;\r\n if (cameraConnectedPoint) {\r\n this._frameGraphTask.camera = cameraConnectedPoint.value as Camera;\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.lensSize = ${this.lensSize};`);\r\n codes.push(`${this._codeVariableName}.fStop = ${this.fStop};`);\r\n codes.push(`${this._codeVariableName}.focusDistance = ${this.focusDistance};`);\r\n codes.push(`${this._codeVariableName}.focalLength = ${this.focalLength};`);\r\n codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);\r\n codes.push(`${this._codeVariableName}.depthSamplingMode = ${this.depthSamplingMode};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.lensSize = this.lensSize;\r\n serializationObject.fStop = this.fStop;\r\n serializationObject.focusDistance = this.focusDistance;\r\n serializationObject.focalLength = this.focalLength;\r\n serializationObject.sourceSamplingMode = this.sourceSamplingMode;\r\n serializationObject.depthSamplingMode = this.depthSamplingMode;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.lensSize = serializationObject.lensSize;\r\n this.fStop = serializationObject.fStop;\r\n this.focusDistance = serializationObject.focusDistance;\r\n this.focalLength = serializationObject.focalLength;\r\n this.sourceSamplingMode = serializationObject.sourceSamplingMode;\r\n this.depthSamplingMode = serializationObject.depthSamplingMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphDepthOfFieldPostProcessBlock\", NodeRenderGraphDepthOfFieldPostProcessBlock);\r\n"]}
|
|
1
|
+
{"version":3,"file":"depthOfFieldPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAG3F;;GAEG;AACH,MAAM,OAAO,2CAA4C,SAAQ,oBAAoB;IAGjF;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;;;OAOG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,KAAY,EAAE,uDAAgF,EAAE,GAAG,GAAG,KAAK;QAChK,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAE/B,IAAI,CAAC,iCAAiC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;QAE1D,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,wCAAwC,CAAC,OAAO,CAAC,CAAC;QAC/E,IAAI,CAAC,aAAa,CAAC,eAAe,EAAE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AAG,mBAAmB,CAAC,KAAK,CAAC;QACvC,IAAI,CAAC,aAAa,GAAG,mBAAmB,CAAC,aAAa,CAAC;QACvD,IAAI,CAAC,WAAW,GAAG,mBAAmB,CAAC,WAAW,CAAC;QACnD,IAAI,CAAC,kBAAkB,GAAG,mBAAmB,CAAC,kBAAkB,CAAC;QACjE,IAAI,CAAC,iBAAiB,GAAG,mBAAmB,CAAC,iBAAiB,CAAC;IACnE,CAAC;CACJ;AAnKG;IAPC,sBAAsB,CAAC,YAAY,uCAA+B,YAAY,EAAE;QAC7E,OAAO,EAAE;YACL,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,6CAAqC,EAAE;YAC5D,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,gDAAwC,EAAE;YAClE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,8CAAsC,EAAE;SACjE;KACJ,CAAC;4EAGD;AAQD;IADC,sBAAsB,CAAC,KAAK,0CAAkC,YAAY,CAAC;sEAG3E;AAQD;IADC,sBAAsB,CAAC,sBAAsB,+CAAuC,YAAY,CAAC;qFAGjG;AAQD;IADC,sBAAsB,CAAC,qBAAqB,+CAAuC,YAAY,CAAC;oFAGhG;AAQD;IADC,sBAAsB,CAAC,cAAc,wCAAgC,YAAY,CAAC;8EAGlF;AAQD;IADC,sBAAsB,CAAC,QAAQ,wCAAgC,YAAY,CAAC;wEAG5E;AAQD;IADC,sBAAsB,CAAC,gBAAgB,wCAAgC,YAAY,CAAC;gFAGpF;AAQD;IADC,sBAAsB,CAAC,WAAW,wCAAgC,YAAY,CAAC;2EAG/E;AA6FL,aAAa,CAAC,qDAAqD,EAAE,2CAA2C,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraphTextureHandle, FrameGraph, Camera } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphDepthOfFieldTask } from \"../../../Tasks/PostProcesses/depthOfFieldTask\";\r\nimport { ThinDepthOfFieldEffectBlurLevel } from \"core/PostProcesses/thinDepthOfFieldEffect\";\r\n\r\n/**\r\n * Block that implements the depth of field post process\r\n */\r\nexport class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphDepthOfFieldTask;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphDepthOfFieldPostProcessBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n * @param blurLevel The quality of the depth of field effect (default: ThinDepthOfFieldEffectBlurLevel.Low)\r\n * @param hdr If high dynamic range textures should be used (default: false)\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene, blurLevel: ThinDepthOfFieldEffectBlurLevel = ThinDepthOfFieldEffectBlurLevel.Low, hdr = false) {\r\n super(name, frameGraph, scene);\r\n\r\n this._additionalConstructionParameters = [blurLevel, hdr];\r\n\r\n this.registerInput(\"source\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"geomViewDepth\", NodeRenderGraphBlockConnectionPointTypes.TextureViewDepth);\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this.registerInput(\"camera\", NodeRenderGraphBlockConnectionPointTypes.Camera);\r\n this._addDependenciesInput();\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\r\n this.output._typeConnectionSource = () => {\r\n return this.destination.isConnected ? this.destination : this.source;\r\n };\r\n\r\n this._frameGraphTask = new FrameGraphDepthOfFieldTask(this.name, frameGraph, scene.getEngine(), blurLevel, hdr);\r\n }\r\n\r\n private _createTask(blurLevel: ThinDepthOfFieldEffectBlurLevel, hdr: boolean) {\r\n const sourceSamplingMode = this._frameGraphTask.sourceSamplingMode;\r\n const depthSamplingMode = this._frameGraphTask.depthSamplingMode;\r\n const focalLength = this._frameGraphTask.depthOfField.focalLength;\r\n const fStop = this._frameGraphTask.depthOfField.fStop;\r\n const focusDistance = this._frameGraphTask.depthOfField.focusDistance;\r\n const lensSize = this._frameGraphTask.depthOfField.lensSize;\r\n\r\n this._frameGraphTask.dispose();\r\n\r\n this._frameGraphTask = new FrameGraphDepthOfFieldTask(this.name, this._frameGraph, this._scene.getEngine(), blurLevel, hdr);\r\n this._frameGraphTask.sourceSamplingMode = sourceSamplingMode;\r\n this._frameGraphTask.depthSamplingMode = depthSamplingMode;\r\n this._frameGraphTask.depthOfField.focalLength = focalLength;\r\n this._frameGraphTask.depthOfField.fStop = fStop;\r\n this._frameGraphTask.depthOfField.focusDistance = focusDistance;\r\n this._frameGraphTask.depthOfField.lensSize = lensSize;\r\n\r\n this._additionalConstructionParameters = [blurLevel, hdr];\r\n }\r\n\r\n /** The quality of the blur effect */\r\n @editableInPropertyPage(\"Blur level\", PropertyTypeForEdition.List, \"PROPERTIES\", {\r\n options: [\r\n { label: \"Low\", value: ThinDepthOfFieldEffectBlurLevel.Low },\r\n { label: \"Medium\", value: ThinDepthOfFieldEffectBlurLevel.Medium },\r\n { label: \"High\", value: ThinDepthOfFieldEffectBlurLevel.High },\r\n ],\r\n })\r\n public get blurLevel(): ThinDepthOfFieldEffectBlurLevel {\r\n return this._frameGraphTask.depthOfField.blurLevel;\r\n }\r\n\r\n public set blurLevel(value: ThinDepthOfFieldEffectBlurLevel) {\r\n this._createTask(value, this._frameGraphTask.hdr);\r\n }\r\n\r\n /** If high dynamic range textures should be used */\r\n @editableInPropertyPage(\"HDR\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get hdr(): boolean {\r\n return this._frameGraphTask.hdr;\r\n }\r\n\r\n public set hdr(value: boolean) {\r\n this._createTask(this._frameGraphTask.depthOfField.blurLevel, value);\r\n }\r\n\r\n /** Sampling mode used to sample from the source texture */\r\n @editableInPropertyPage(\"Source sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get sourceSamplingMode() {\r\n return this._frameGraphTask.sourceSamplingMode;\r\n }\r\n\r\n public set sourceSamplingMode(value: number) {\r\n this._frameGraphTask.sourceSamplingMode = value;\r\n }\r\n\r\n /** Sampling mode used to sample from the depth texture */\r\n @editableInPropertyPage(\"Depth sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get depthSamplingMode() {\r\n return this._frameGraphTask.depthSamplingMode;\r\n }\r\n\r\n public set depthSamplingMode(value: number) {\r\n this._frameGraphTask.depthSamplingMode = value;\r\n }\r\n\r\n /** The focal the length of the camera used in the effect in scene units/1000 (eg. millimeter). */\r\n @editableInPropertyPage(\"Focal length\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get focalLength(): number {\r\n return this._frameGraphTask.depthOfField.focalLength;\r\n }\r\n\r\n public set focalLength(value: number) {\r\n this._frameGraphTask.depthOfField.focalLength = value;\r\n }\r\n\r\n /** F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop. */\r\n @editableInPropertyPage(\"F-Stop\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get fStop(): number {\r\n return this._frameGraphTask.depthOfField.fStop;\r\n }\r\n\r\n public set fStop(value: number) {\r\n this._frameGraphTask.depthOfField.fStop = value;\r\n }\r\n\r\n /** Distance away from the camera to focus on in scene units/1000 (eg. millimeter). */\r\n @editableInPropertyPage(\"Focus distance\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get focusDistance(): number {\r\n return this._frameGraphTask.depthOfField.focusDistance;\r\n }\r\n\r\n public set focusDistance(value: number) {\r\n this._frameGraphTask.depthOfField.focusDistance = value;\r\n }\r\n\r\n /** Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. The diameter of the resulting aperture can be computed by lensSize/fStop. */\r\n @editableInPropertyPage(\"Lens size\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get lensSize(): number {\r\n return this._frameGraphTask.depthOfField.lensSize;\r\n }\r\n\r\n public set lensSize(value: number) {\r\n this._frameGraphTask.depthOfField.lensSize = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphDepthOfFieldPostProcessBlock\";\r\n }\r\n\r\n /**\r\n * Gets the source input component\r\n */\r\n public get source(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the geometry view depth input component\r\n */\r\n public get geomViewDepth(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the destination input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the camera input component\r\n */\r\n public get camera(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this.output.value = this._frameGraphTask.outputTexture;\r\n\r\n this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.depthTexture = this.geomViewDepth.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.camera = this.camera.connectedPoint?.value as Camera;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.lensSize = ${this.lensSize};`);\r\n codes.push(`${this._codeVariableName}.fStop = ${this.fStop};`);\r\n codes.push(`${this._codeVariableName}.focusDistance = ${this.focusDistance};`);\r\n codes.push(`${this._codeVariableName}.focalLength = ${this.focalLength};`);\r\n codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);\r\n codes.push(`${this._codeVariableName}.depthSamplingMode = ${this.depthSamplingMode};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.lensSize = this.lensSize;\r\n serializationObject.fStop = this.fStop;\r\n serializationObject.focusDistance = this.focusDistance;\r\n serializationObject.focalLength = this.focalLength;\r\n serializationObject.sourceSamplingMode = this.sourceSamplingMode;\r\n serializationObject.depthSamplingMode = this.depthSamplingMode;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.lensSize = serializationObject.lensSize;\r\n this.fStop = serializationObject.fStop;\r\n this.focusDistance = serializationObject.focusDistance;\r\n this.focalLength = serializationObject.focalLength;\r\n this.sourceSamplingMode = serializationObject.sourceSamplingMode;\r\n this.depthSamplingMode = serializationObject.depthSamplingMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphDepthOfFieldPostProcessBlock\", NodeRenderGraphDepthOfFieldPostProcessBlock);\r\n"]}
|
|
@@ -25,6 +25,7 @@ export class NodeRenderGraphExtractHighlightsPostProcessBlock extends NodeRender
|
|
|
25
25
|
super(name, frameGraph, scene);
|
|
26
26
|
this.registerInput("source", NodeRenderGraphBlockConnectionPointTypes.Texture);
|
|
27
27
|
this.registerInput("destination", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
28
|
+
this._addDependenciesInput();
|
|
28
29
|
this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
|
|
29
30
|
this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
|
|
30
31
|
this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);
|
|
@@ -74,16 +75,9 @@ export class NodeRenderGraphExtractHighlightsPostProcessBlock extends NodeRender
|
|
|
74
75
|
}
|
|
75
76
|
_buildBlock(state) {
|
|
76
77
|
super._buildBlock(state);
|
|
77
|
-
this._frameGraphTask.name = this.name;
|
|
78
78
|
this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the "output" texture of the task
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
this._frameGraphTask.sourceTexture = sourceConnectedPoint.value;
|
|
82
|
-
}
|
|
83
|
-
const destinationConnectedPoint = this.destination.connectedPoint;
|
|
84
|
-
if (destinationConnectedPoint) {
|
|
85
|
-
this._frameGraphTask.destinationTexture = destinationConnectedPoint.value;
|
|
86
|
-
}
|
|
79
|
+
this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value;
|
|
80
|
+
this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value;
|
|
87
81
|
}
|
|
88
82
|
_dumpPropertiesCode() {
|
|
89
83
|
const codes = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractHighlightsPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAA0B,M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W,kBAAkB,CAAC,KAAa;QACvC,IAAI,CAAC,eAAe,CAAC,kBAAkB,GAAG,KAAK,CAAC;IACpD,CAAC;IAED,6EAA6E;IAE7E,IAAW,SAAS;QAChB,OAAO,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,SAAS,CAAC;IACtD,CAAC;IAED,IAAW,SAAS,CAAC,KAAa;QAC9B,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,SAAS,GAAG,KAAK,CAAC;IACvD,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,OAAO,kDAAkD,CAAC;IAC9D,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,WAAW;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAEkB,WAAW,CAAC,KAAgC;QAC3D,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"extractHighlightsPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,+BAA+B,EAAE,8DAAkE;AAC5G,OAAO,EAAE,gCAAgC,EAAE,sEAA4D;AAEvG;;GAEG;AACH,MAAM,OAAO,gDAAiD,SA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,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;IAEe,SAAS;QACrB,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAC9C,mBAAmB,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAC/C,mBAAmB,CAAC,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAC;QACjE,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QACxC,IAAI,CAAC,SAAS,GAAG,mBAAmB,CAAC,SAAS,CAAC;QAC/C,IAAI,CAAC,kBAAkB,GAAG,mBAAmB,CAAC,kBAAkB,CAAC;IACrE,CAAC;CACJ;AA3EG;IADC,sBAAsB,CAAC,sBAAsB,+CAAuC,YAAY,CAAC;0FAGjG;AAQD;IADC,sBAAsB,CAAC,WAAW,wCAAgC,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;iFAGnG;AAiEL,aAAa,CAAC,0DAA0D,EAAE,gDAAgD,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraphTextureHandle, FrameGraph } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphExtractHighlightsTask } from \"core/FrameGraph/Tasks/PostProcesses/extractHighlightsTask\";\r\nimport { ThinExtractHighlightsPostProcess } from \"core/PostProcesses/thinExtractHighlightsPostProcess\";\r\n\r\n/**\r\n * Block that implements the extract highlights post process\r\n */\r\nexport class NodeRenderGraphExtractHighlightsPostProcessBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphExtractHighlightsTask;\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 ExtractHighlightsPostProcessBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene) {\r\n super(name, frameGraph, scene);\r\n\r\n this.registerInput(\"source\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this._addDependenciesInput();\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\r\n this.output._typeConnectionSource = () => {\r\n return this.destination.isConnected ? this.destination : this.source;\r\n };\r\n\r\n this._frameGraphTask = new FrameGraphExtractHighlightsTask(this.name, frameGraph, new ThinExtractHighlightsPostProcess(name, scene.getEngine()));\r\n }\r\n\r\n /** Sampling mode used to sample from the source texture */\r\n @editableInPropertyPage(\"Source sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get sourceSamplingMode() {\r\n return this._frameGraphTask.sourceSamplingMode;\r\n }\r\n\r\n public set sourceSamplingMode(value: number) {\r\n this._frameGraphTask.sourceSamplingMode = value;\r\n }\r\n\r\n /** The luminance threshold, pixels below this value will be set to black. */\r\n @editableInPropertyPage(\"Threshold\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 1 })\r\n public get threshold(): number {\r\n return this._frameGraphTask.postProcess.threshold;\r\n }\r\n\r\n public set threshold(value: number) {\r\n this._frameGraphTask.postProcess.threshold = 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 \"NodeRenderGraphExtractHighlightsPostProcessBlock\";\r\n }\r\n\r\n /**\r\n * Gets the source input component\r\n */\r\n public get source(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the destination input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the \"output\" texture of the task\r\n\r\n this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value as FrameGraphTextureHandle;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.threshold = ${this.threshold};`);\r\n codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.threshold = this.threshold;\r\n serializationObject.sourceSamplingMode = this.sourceSamplingMode;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.threshold = serializationObject.threshold;\r\n this.sourceSamplingMode = serializationObject.sourceSamplingMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphExtractHighlightsPostProcessBlock\", NodeRenderGraphExtractHighlightsPostProcessBlock);\r\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Scene, NodeRenderGraphBuildState, FrameGraph, FrameGraphObjectRendererTask } from "../../../../index.js";
|
|
2
2
|
import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock";
|
|
3
|
+
import { NodeRenderGraphConnectionPoint } from "../../nodeRenderGraphBlockConnectionPoint";
|
|
3
4
|
/**
|
|
4
5
|
* @internal
|
|
5
6
|
*/
|
|
@@ -47,6 +48,10 @@ export declare class NodeRenderGraphBaseObjectRendererBlock extends NodeRenderGr
|
|
|
47
48
|
* Gets the dependencies input component
|
|
48
49
|
*/
|
|
49
50
|
get dependencies(): NodeRenderGraphConnectionPoint;
|
|
51
|
+
/**
|
|
52
|
+
* Gets the shadowGenerators input component
|
|
53
|
+
*/
|
|
54
|
+
get shadowGenerators(): NodeRenderGraphConnectionPoint;
|
|
50
55
|
/**
|
|
51
56
|
* Gets the output component
|
|
52
57
|
*/
|