@babylonjs/core 7.53.0 → 7.53.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.js +7 -2
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.js.map +1 -1
- package/FlowGraph/CustomTypes/flowGraphMatrix.d.ts +1 -0
- package/FlowGraph/CustomTypes/flowGraphMatrix.js +18 -17
- package/FlowGraph/CustomTypes/flowGraphMatrix.js.map +1 -1
- package/FlowGraph/flowGraphDataConnection.d.ts +10 -1
- package/FlowGraph/flowGraphDataConnection.js +23 -13
- package/FlowGraph/flowGraphDataConnection.js.map +1 -1
- package/FlowGraph/flowGraphRichTypes.d.ts +5 -0
- package/FlowGraph/flowGraphRichTypes.js +12 -0
- package/FlowGraph/flowGraphRichTypes.js.map +1 -1
- package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.d.ts +2 -2
- package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js +6 -6
- package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.d.ts +2 -2
- package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js +6 -6
- package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/anaglyphPostProcessBlock.d.ts +30 -0
- package/FrameGraph/Node/Blocks/PostProcesses/anaglyphPostProcessBlock.js +48 -0
- package/FrameGraph/Node/Blocks/PostProcesses/anaglyphPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.d.ts +3 -3
- package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js +6 -6
- package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.d.ts +38 -0
- package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.js +88 -0
- package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.d.ts +2 -2
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +6 -6
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.d.ts +2 -2
- package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.js +6 -6
- package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Textures/clearBlock.d.ts +2 -2
- package/FrameGraph/Node/Blocks/Textures/clearBlock.js +7 -7
- package/FrameGraph/Node/Blocks/Textures/clearBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.d.ts +2 -2
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js +6 -6
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.d.ts +2 -2
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js +7 -7
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/index.d.ts +2 -0
- package/FrameGraph/Node/Blocks/index.js +2 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js +2 -2
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/Tasks/Layers/baseLayerTask.d.ts +3 -3
- package/FrameGraph/Tasks/Layers/baseLayerTask.js +12 -12
- package/FrameGraph/Tasks/Layers/baseLayerTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/anaglyphTask.d.ts +21 -0
- package/FrameGraph/Tasks/PostProcesses/anaglyphTask.js +27 -0
- package/FrameGraph/Tasks/PostProcesses/anaglyphTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/bloomTask.d.ts +2 -2
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js +5 -5
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask.d.ts +17 -0
- package/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask.js +23 -0
- package/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.d.ts +2 -2
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js +5 -5
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.d.ts +2 -2
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +1 -1
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.d.ts +2 -2
- package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js +8 -8
- package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +3 -3
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js +9 -9
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js +7 -7
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.d.ts +3 -3
- package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.js +3 -3
- package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/clearTextureTask.d.ts +3 -3
- package/FrameGraph/Tasks/Texture/clearTextureTask.js +8 -8
- package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/copyToTextureTask.d.ts +3 -3
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js +3 -3
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/generateMipMapsTask.d.ts +2 -2
- package/FrameGraph/Tasks/Texture/generateMipMapsTask.js +5 -5
- package/FrameGraph/Tasks/Texture/generateMipMapsTask.js.map +1 -1
- package/FrameGraph/index.d.ts +2 -0
- package/FrameGraph/index.js +2 -0
- package/FrameGraph/index.js.map +1 -1
- package/Materials/materialDefines.js +1 -1
- package/Materials/materialDefines.js.map +1 -1
- package/Meshes/Builders/shapeBuilder.d.ts +6 -2
- package/Meshes/Builders/shapeBuilder.js.map +1 -1
- package/PostProcesses/anaglyphPostProcess.d.ts +0 -1
- package/PostProcesses/anaglyphPostProcess.js +14 -11
- package/PostProcesses/anaglyphPostProcess.js.map +1 -1
- package/PostProcesses/chromaticAberrationPostProcess.d.ts +15 -8
- package/PostProcesses/chromaticAberrationPostProcess.js +72 -42
- package/PostProcesses/chromaticAberrationPostProcess.js.map +1 -1
- package/PostProcesses/index.d.ts +2 -0
- package/PostProcesses/index.js +2 -0
- package/PostProcesses/index.js.map +1 -1
- package/PostProcesses/thinAnaglyphPostProcess.d.ts +23 -0
- package/PostProcesses/thinAnaglyphPostProcess.js +42 -0
- package/PostProcesses/thinAnaglyphPostProcess.js.map +1 -0
- package/PostProcesses/thinChromaticAberrationPostProcess.d.ts +45 -0
- package/PostProcesses/thinChromaticAberrationPostProcess.js +69 -0
- package/PostProcesses/thinChromaticAberrationPostProcess.js.map +1 -0
- package/package.json +1 -1
|
@@ -31,14 +31,14 @@ export class NodeRenderGraphHighlightLayerBlock extends NodeRenderGraphBlock {
|
|
|
31
31
|
constructor(name, frameGraph, scene, layerTextureRatio = 0.5, layerTextureFixedSize, blurTextureSizeRatio = 0.5, isStroke = false, layerTextureType = 0) {
|
|
32
32
|
super(name, frameGraph, scene);
|
|
33
33
|
this._additionalConstructionParameters = [layerTextureRatio, layerTextureFixedSize, blurTextureSizeRatio, isStroke, layerTextureType];
|
|
34
|
-
this.registerInput("
|
|
34
|
+
this.registerInput("target", NodeRenderGraphBlockConnectionPointTypes.Texture);
|
|
35
35
|
this.registerInput("layer", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
36
36
|
this.registerInput("objectRenderer", NodeRenderGraphBlockConnectionPointTypes.Object, true, new NodeRenderGraphConnectionPointCustomObject("objectRenderer", this, 0 /* NodeRenderGraphConnectionPointDirection.Input */, NodeRenderGraphBaseObjectRendererBlock, "NodeRenderGraphBaseObjectRendererBlock"));
|
|
37
37
|
this._addDependenciesInput();
|
|
38
38
|
this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
|
|
39
|
-
this.
|
|
39
|
+
this.target.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBufferDepthStencil);
|
|
40
40
|
this.layer.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
|
|
41
|
-
this.output._typeConnectionSource = this.
|
|
41
|
+
this.output._typeConnectionSource = this.target;
|
|
42
42
|
this._frameGraphTask = new FrameGraphHighlightLayerTask(this.name, this._frameGraph, this._scene, {
|
|
43
43
|
mainTextureRatio: layerTextureRatio,
|
|
44
44
|
mainTextureFixedSize: layerTextureFixedSize,
|
|
@@ -124,9 +124,9 @@ export class NodeRenderGraphHighlightLayerBlock extends NodeRenderGraphBlock {
|
|
|
124
124
|
return "NodeRenderGraphHighlightLayerBlock";
|
|
125
125
|
}
|
|
126
126
|
/**
|
|
127
|
-
* Gets the
|
|
127
|
+
* Gets the target texture input component
|
|
128
128
|
*/
|
|
129
|
-
get
|
|
129
|
+
get target() {
|
|
130
130
|
return this._inputs[0];
|
|
131
131
|
}
|
|
132
132
|
/**
|
|
@@ -150,7 +150,7 @@ export class NodeRenderGraphHighlightLayerBlock extends NodeRenderGraphBlock {
|
|
|
150
150
|
_buildBlock(state) {
|
|
151
151
|
super._buildBlock(state);
|
|
152
152
|
this.output.value = this._frameGraphTask.outputTexture;
|
|
153
|
-
this._frameGraphTask.
|
|
153
|
+
this._frameGraphTask.targetTexture = this.target.connectedPoint?.value;
|
|
154
154
|
this._frameGraphTask.layerTexture = this.layer.connectedPoint?.value;
|
|
155
155
|
this._frameGraphTask.objectRendererTask = this.objectRenderer.connectedPoint?.value;
|
|
156
156
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"highlightLayerBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.ts"],"names":[],"mappings":";AASA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,wCAAwC,EAA2C,MAAM,kCAAkC,CAAC;AACrI,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,4BAA4B,EAAE,oDAAwD;AAC/F,OAAO,EAAE,SAAS,EAAE,yCAA+B;AACnD,OAAO,EAAE,0CAA0C,EAAE,MAAM,kDAAkD,CAAC;AAC9G,OAAO,EAAE,sCAAsC,EAAE,MAAM,sCAAsC,CAAC;AAE9F;;GAEG;AACH,MAAM,OAAO,kCAAmC,SAAQ,oBAAoB;IAGxE;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;;;;;;OAUG;I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qB,wCAAgC,YAAY,CAAC;2EAGzF;AAUD;IADC,sBAAsB,CAAC,0BAA0B,wCAAgC,YAAY,CAAC;+EAG9F;AAUD;IADC,sBAAsB,CAAC,yBAAyB,wCAAgC,YAAY,CAAC;8EAG7F;AAUD;IADC,sBAAsB,CAAC,WAAW,0CAAkC,YAAY,CAAC;kEAGjF;AAUD;IADC,sBAAsB,CAAC,oBAAoB,8CAAsC,YAAY,CAAC;0EAG9F;AAUD;IADC,sBAAsB,CAAC,sBAAsB,wCAAgC,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;4EAG9G;AAQD;IADC,sBAAsB,CAAC,oBAAoB,wCAAgC,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;0EAG5G;AAyEL,aAAa,CAAC,4CAA4C,EAAE,kCAAkC,CAAC,CAAC","sourcesContent":["import type {\r\n Scene,\r\n NodeRenderGraphBuildState,\r\n FrameGraph,\r\n FrameGraphTextureHandle,\r\n NodeRenderGraphConnectionPoint,\r\n FrameGraphObjectRendererTask,\r\n // eslint-disable-next-line import/no-internal-modules\r\n} from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes, NodeRenderGraphConnectionPointDirection } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphHighlightLayerTask } from \"core/FrameGraph/Tasks/Layers/highlightLayerTask\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { NodeRenderGraphConnectionPointCustomObject } from \"../../nodeRenderGraphConnectionPointCustomObject\";\r\nimport { NodeRenderGraphBaseObjectRendererBlock } from \"../Rendering/baseObjectRendererBlock\";\r\n\r\n/**\r\n * Block that implements the highlight layer\r\n */\r\nexport class NodeRenderGraphHighlightLayerBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphHighlightLayerTask;\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 NodeRenderGraphHighlightLayerBlock\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 layerTextureRatio multiplication factor applied to the main texture size to compute the size of the layer render target texture (default: 0.5)\r\n * @param layerTextureFixedSize defines the fixed size of the layer render target texture. Takes precedence over layerTextureRatio if provided (default: undefined)\r\n * @param blurTextureSizeRatio defines the factor to apply to the layer texture size to create the blur textures (default: 0.5)\r\n * @param isStroke should we display highlight as a solid stroke? (default: false)\r\n * @param layerTextureType defines the type of the layer texture (default: Constants.TEXTURETYPE_UNSIGNED_BYTE)\r\n */\r\n public constructor(\r\n name: string,\r\n frameGraph: FrameGraph,\r\n scene: Scene,\r\n layerTextureRatio = 0.5,\r\n layerTextureFixedSize?: number,\r\n blurTextureSizeRatio = 0.5,\r\n isStroke = false,\r\n layerTextureType = Constants.TEXTURETYPE_UNSIGNED_BYTE\r\n ) {\r\n super(name, frameGraph, scene);\r\n\r\n this._additionalConstructionParameters = [layerTextureRatio, layerTextureFixedSize, blurTextureSizeRatio, isStroke, layerTextureType];\r\n\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"layer\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this.registerInput(\r\n \"objectRenderer\",\r\n NodeRenderGraphBlockConnectionPointTypes.Object,\r\n true,\r\n new NodeRenderGraphConnectionPointCustomObject(\r\n \"objectRenderer\",\r\n this,\r\n NodeRenderGraphConnectionPointDirection.Input,\r\n NodeRenderGraphBaseObjectRendererBlock,\r\n \"NodeRenderGraphBaseObjectRendererBlock\"\r\n )\r\n );\r\n this._addDependenciesInput();\r\n\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBufferDepthStencil);\r\n this.layer.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n\r\n this.output._typeConnectionSource = this.destination;\r\n\r\n this._frameGraphTask = new FrameGraphHighlightLayerTask(this.name, this._frameGraph, this._scene, {\r\n mainTextureRatio: layerTextureRatio,\r\n mainTextureFixedSize: layerTextureFixedSize,\r\n blurTextureSizeRatio,\r\n isStroke,\r\n mainTextureType: layerTextureType,\r\n });\r\n }\r\n\r\n private _createTask(layerTextureRatio: number, layerTextureFixedSize: number, blurTextureSizeRatio: number, isStroke: boolean, layerTextureType: number) {\r\n const blurHorizontalSize = this.blurHorizontalSize;\r\n const blurVerticalSize = this.blurVerticalSize;\r\n\r\n this._frameGraphTask?.dispose();\r\n\r\n this._frameGraphTask = new FrameGraphHighlightLayerTask(this.name, this._frameGraph, this._scene, {\r\n mainTextureRatio: layerTextureRatio,\r\n mainTextureFixedSize: layerTextureFixedSize,\r\n blurTextureSizeRatio,\r\n isStroke,\r\n mainTextureType: layerTextureType,\r\n });\r\n\r\n this.blurHorizontalSize = blurHorizontalSize;\r\n this.blurVerticalSize = blurVerticalSize;\r\n\r\n this._additionalConstructionParameters = [layerTextureRatio, layerTextureFixedSize, blurTextureSizeRatio, isStroke, layerTextureType];\r\n }\r\n\r\n /** Multiplication factor applied to the main texture size to compute the size of the layer render target texture */\r\n @editableInPropertyPage(\"Layer texture ratio\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get layerTextureRatio() {\r\n return this._frameGraphTask.layer._options.mainTextureRatio;\r\n }\r\n\r\n public set layerTextureRatio(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(value, options.mainTextureFixedSize, options.blurTextureSizeRatio, options.isStroke, options.mainTextureType);\r\n }\r\n\r\n /** Defines the fixed size of the layer render target texture. Takes precedence over layerTextureRatio if provided */\r\n @editableInPropertyPage(\"Layer texture fixed size\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get layerTextureFixedSize() {\r\n return this._frameGraphTask.layer._options.mainTextureFixedSize;\r\n }\r\n\r\n public set layerTextureFixedSize(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.mainTextureRatio, value, options.blurTextureSizeRatio, options.isStroke, options.mainTextureType);\r\n }\r\n\r\n /** Defines the factor to apply to the layer texture size to create the blur textures */\r\n @editableInPropertyPage(\"Blur texture size ratio\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get blurTextureSizeRatio() {\r\n return this._frameGraphTask.layer._options.blurTextureSizeRatio;\r\n }\r\n\r\n public set blurTextureSizeRatio(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.mainTextureRatio, options.mainTextureFixedSize, value, options.isStroke, options.mainTextureType);\r\n }\r\n\r\n /** Should we display highlight as a solid stroke? */\r\n @editableInPropertyPage(\"Is stroke\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get isStroke() {\r\n return this._frameGraphTask.layer._options.isStroke;\r\n }\r\n\r\n public set isStroke(value: boolean) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.mainTextureRatio, options.mainTextureFixedSize, options.blurTextureSizeRatio, value, options.mainTextureType);\r\n }\r\n\r\n /** Defines the type of the layer texture */\r\n @editableInPropertyPage(\"Layer texture type\", PropertyTypeForEdition.TextureType, \"PROPERTIES\")\r\n public get layerTextureType() {\r\n return this._frameGraphTask.layer._options.mainTextureType;\r\n }\r\n\r\n public set layerTextureType(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.mainTextureRatio, options.mainTextureFixedSize, options.blurTextureSizeRatio, options.isStroke, value);\r\n }\r\n\r\n /** How big is the horizontal kernel of the blur texture */\r\n @editableInPropertyPage(\"Blur horizontal size\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 4 })\r\n public get blurHorizontalSize() {\r\n return this._frameGraphTask.layer.blurHorizontalSize;\r\n }\r\n\r\n public set blurHorizontalSize(value: number) {\r\n this._frameGraphTask.layer.blurHorizontalSize = value;\r\n }\r\n\r\n /** How big is the vertical kernel of the blur texture */\r\n @editableInPropertyPage(\"Blur vertical size\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 4 })\r\n public get blurVerticalSize() {\r\n return this._frameGraphTask.layer.blurVerticalSize;\r\n }\r\n\r\n public set blurVerticalSize(value: number) {\r\n this._frameGraphTask.layer.blurVerticalSize = 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 \"NodeRenderGraphHighlightLayerBlock\";\r\n }\r\n\r\n /**\r\n * Gets the destination texture input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the layer input component\r\n */\r\n public get layer(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the objectRenderer input component\r\n */\r\n public get objectRenderer(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\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.destinationTexture = this.destination.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.layerTexture = this.layer.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.objectRendererTask = this.objectRenderer.connectedPoint?.value as FrameGraphObjectRendererTask;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.blurHorizontalSize = ${this.blurHorizontalSize};`);\r\n codes.push(`${this._codeVariableName}.blurVerticalSize = ${this.blurVerticalSize};`);\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.blurHorizontalSize = this.blurHorizontalSize;\r\n serializationObject.blurVerticalSize = this.blurVerticalSize;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.blurHorizontalSize = serializationObject.blurHorizontalSize;\r\n this.blurVerticalSize = serializationObject.blurVerticalSize;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphHighlightLayerBlock\", NodeRenderGraphHighlightLayerBlock);\r\n"]}
|
|
1
|
+
{"version":3,"file":"highlightLayerBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.ts"],"names":[],"mappings":";AASA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,wCAAwC,EAA2C,MAAM,kCAAkC,CAAC;AACrI,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,4BAA4B,EAAE,oDAAwD;AAC/F,OAAO,EAAE,SAAS,EAAE,yCAA+B;AACnD,OAAO,EAAE,0CAA0C,EAAE,MAAM,kDAAkD,CAAC;AAC9G,OAAO,EAAE,sCAAsC,EAAE,MAAM,sCAAsC,CAAC;AAE9F;;GAEG;AACH,MAAM,OAAO,kCAAmC,SAAQ,oBAAoB;IAGxE;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;;;;;;OAUG;IACH,YACI,IAAY,EACZ,UAAsB,EACtB,KAAY,EAC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sBAAsB,CAAC,0BAA0B,wCAAgC,YAAY,CAAC;+EAG9F;AAUD;IADC,sBAAsB,CAAC,yBAAyB,wCAAgC,YAAY,CAAC;8EAG7F;AAUD;IADC,sBAAsB,CAAC,WAAW,0CAAkC,YAAY,CAAC;kEAGjF;AAUD;IADC,sBAAsB,CAAC,oBAAoB,8CAAsC,YAAY,CAAC;0EAG9F;AAUD;IADC,sBAAsB,CAAC,sBAAsB,wCAAgC,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;4EAG9G;AAQD;IADC,sBAAsB,CAAC,oBAAoB,wCAAgC,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;0EAG5G;AAyEL,aAAa,CAAC,4CAA4C,EAAE,kCAAkC,CAAC,CAAC","sourcesContent":["import type {\r\n Scene,\r\n NodeRenderGraphBuildState,\r\n FrameGraph,\r\n FrameGraphTextureHandle,\r\n NodeRenderGraphConnectionPoint,\r\n FrameGraphObjectRendererTask,\r\n // eslint-disable-next-line import/no-internal-modules\r\n} from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes, NodeRenderGraphConnectionPointDirection } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphHighlightLayerTask } from \"core/FrameGraph/Tasks/Layers/highlightLayerTask\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { NodeRenderGraphConnectionPointCustomObject } from \"../../nodeRenderGraphConnectionPointCustomObject\";\r\nimport { NodeRenderGraphBaseObjectRendererBlock } from \"../Rendering/baseObjectRendererBlock\";\r\n\r\n/**\r\n * Block that implements the highlight layer\r\n */\r\nexport class NodeRenderGraphHighlightLayerBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphHighlightLayerTask;\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 NodeRenderGraphHighlightLayerBlock\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 layerTextureRatio multiplication factor applied to the main texture size to compute the size of the layer render target texture (default: 0.5)\r\n * @param layerTextureFixedSize defines the fixed size of the layer render target texture. Takes precedence over layerTextureRatio if provided (default: undefined)\r\n * @param blurTextureSizeRatio defines the factor to apply to the layer texture size to create the blur textures (default: 0.5)\r\n * @param isStroke should we display highlight as a solid stroke? (default: false)\r\n * @param layerTextureType defines the type of the layer texture (default: Constants.TEXTURETYPE_UNSIGNED_BYTE)\r\n */\r\n public constructor(\r\n name: string,\r\n frameGraph: FrameGraph,\r\n scene: Scene,\r\n layerTextureRatio = 0.5,\r\n layerTextureFixedSize?: number,\r\n blurTextureSizeRatio = 0.5,\r\n isStroke = false,\r\n layerTextureType = Constants.TEXTURETYPE_UNSIGNED_BYTE\r\n ) {\r\n super(name, frameGraph, scene);\r\n\r\n this._additionalConstructionParameters = [layerTextureRatio, layerTextureFixedSize, blurTextureSizeRatio, isStroke, layerTextureType];\r\n\r\n this.registerInput(\"target\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"layer\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this.registerInput(\r\n \"objectRenderer\",\r\n NodeRenderGraphBlockConnectionPointTypes.Object,\r\n true,\r\n new NodeRenderGraphConnectionPointCustomObject(\r\n \"objectRenderer\",\r\n this,\r\n NodeRenderGraphConnectionPointDirection.Input,\r\n NodeRenderGraphBaseObjectRendererBlock,\r\n \"NodeRenderGraphBaseObjectRendererBlock\"\r\n )\r\n );\r\n this._addDependenciesInput();\r\n\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.target.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBufferDepthStencil);\r\n this.layer.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n\r\n this.output._typeConnectionSource = this.target;\r\n\r\n this._frameGraphTask = new FrameGraphHighlightLayerTask(this.name, this._frameGraph, this._scene, {\r\n mainTextureRatio: layerTextureRatio,\r\n mainTextureFixedSize: layerTextureFixedSize,\r\n blurTextureSizeRatio,\r\n isStroke,\r\n mainTextureType: layerTextureType,\r\n });\r\n }\r\n\r\n private _createTask(layerTextureRatio: number, layerTextureFixedSize: number, blurTextureSizeRatio: number, isStroke: boolean, layerTextureType: number) {\r\n const blurHorizontalSize = this.blurHorizontalSize;\r\n const blurVerticalSize = this.blurVerticalSize;\r\n\r\n this._frameGraphTask?.dispose();\r\n\r\n this._frameGraphTask = new FrameGraphHighlightLayerTask(this.name, this._frameGraph, this._scene, {\r\n mainTextureRatio: layerTextureRatio,\r\n mainTextureFixedSize: layerTextureFixedSize,\r\n blurTextureSizeRatio,\r\n isStroke,\r\n mainTextureType: layerTextureType,\r\n });\r\n\r\n this.blurHorizontalSize = blurHorizontalSize;\r\n this.blurVerticalSize = blurVerticalSize;\r\n\r\n this._additionalConstructionParameters = [layerTextureRatio, layerTextureFixedSize, blurTextureSizeRatio, isStroke, layerTextureType];\r\n }\r\n\r\n /** Multiplication factor applied to the main texture size to compute the size of the layer render target texture */\r\n @editableInPropertyPage(\"Layer texture ratio\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get layerTextureRatio() {\r\n return this._frameGraphTask.layer._options.mainTextureRatio;\r\n }\r\n\r\n public set layerTextureRatio(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(value, options.mainTextureFixedSize, options.blurTextureSizeRatio, options.isStroke, options.mainTextureType);\r\n }\r\n\r\n /** Defines the fixed size of the layer render target texture. Takes precedence over layerTextureRatio if provided */\r\n @editableInPropertyPage(\"Layer texture fixed size\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get layerTextureFixedSize() {\r\n return this._frameGraphTask.layer._options.mainTextureFixedSize;\r\n }\r\n\r\n public set layerTextureFixedSize(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.mainTextureRatio, value, options.blurTextureSizeRatio, options.isStroke, options.mainTextureType);\r\n }\r\n\r\n /** Defines the factor to apply to the layer texture size to create the blur textures */\r\n @editableInPropertyPage(\"Blur texture size ratio\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get blurTextureSizeRatio() {\r\n return this._frameGraphTask.layer._options.blurTextureSizeRatio;\r\n }\r\n\r\n public set blurTextureSizeRatio(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.mainTextureRatio, options.mainTextureFixedSize, value, options.isStroke, options.mainTextureType);\r\n }\r\n\r\n /** Should we display highlight as a solid stroke? */\r\n @editableInPropertyPage(\"Is stroke\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get isStroke() {\r\n return this._frameGraphTask.layer._options.isStroke;\r\n }\r\n\r\n public set isStroke(value: boolean) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.mainTextureRatio, options.mainTextureFixedSize, options.blurTextureSizeRatio, value, options.mainTextureType);\r\n }\r\n\r\n /** Defines the type of the layer texture */\r\n @editableInPropertyPage(\"Layer texture type\", PropertyTypeForEdition.TextureType, \"PROPERTIES\")\r\n public get layerTextureType() {\r\n return this._frameGraphTask.layer._options.mainTextureType;\r\n }\r\n\r\n public set layerTextureType(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.mainTextureRatio, options.mainTextureFixedSize, options.blurTextureSizeRatio, options.isStroke, value);\r\n }\r\n\r\n /** How big is the horizontal kernel of the blur texture */\r\n @editableInPropertyPage(\"Blur horizontal size\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 4 })\r\n public get blurHorizontalSize() {\r\n return this._frameGraphTask.layer.blurHorizontalSize;\r\n }\r\n\r\n public set blurHorizontalSize(value: number) {\r\n this._frameGraphTask.layer.blurHorizontalSize = value;\r\n }\r\n\r\n /** How big is the vertical kernel of the blur texture */\r\n @editableInPropertyPage(\"Blur vertical size\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 4 })\r\n public get blurVerticalSize() {\r\n return this._frameGraphTask.layer.blurVerticalSize;\r\n }\r\n\r\n public set blurVerticalSize(value: number) {\r\n this._frameGraphTask.layer.blurVerticalSize = 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 \"NodeRenderGraphHighlightLayerBlock\";\r\n }\r\n\r\n /**\r\n * Gets the target texture input component\r\n */\r\n public get target(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the layer input component\r\n */\r\n public get layer(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the objectRenderer input component\r\n */\r\n public get objectRenderer(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this.output.value = this._frameGraphTask.outputTexture;\r\n\r\n this._frameGraphTask.targetTexture = this.target.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.layerTexture = this.layer.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.objectRendererTask = this.objectRenderer.connectedPoint?.value as FrameGraphObjectRendererTask;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.blurHorizontalSize = ${this.blurHorizontalSize};`);\r\n codes.push(`${this._codeVariableName}.blurVerticalSize = ${this.blurVerticalSize};`);\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.blurHorizontalSize = this.blurHorizontalSize;\r\n serializationObject.blurVerticalSize = this.blurVerticalSize;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.blurHorizontalSize = serializationObject.blurHorizontalSize;\r\n this.blurVerticalSize = serializationObject.blurVerticalSize;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphHighlightLayerBlock\", NodeRenderGraphHighlightLayerBlock);\r\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraph } from "../../../../index.js";
|
|
2
|
+
import { FrameGraphAnaglyphTask } from "../../../Tasks/PostProcesses/anaglyphTask.js";
|
|
3
|
+
import { NodeRenderGraphBasePostProcessBlock } from "./basePostProcessBlock";
|
|
4
|
+
/**
|
|
5
|
+
* Block that implements the anaglyph post process
|
|
6
|
+
*/
|
|
7
|
+
export declare class NodeRenderGraphAnaglyphPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {
|
|
8
|
+
protected _frameGraphTask: FrameGraphAnaglyphTask;
|
|
9
|
+
/**
|
|
10
|
+
* Gets the frame graph task associated with this block
|
|
11
|
+
*/
|
|
12
|
+
get task(): FrameGraphAnaglyphTask;
|
|
13
|
+
/**
|
|
14
|
+
* Create a new NodeRenderAnaglyphPostProcessBlock
|
|
15
|
+
* @param name defines the block name
|
|
16
|
+
* @param frameGraph defines the hosting frame graph
|
|
17
|
+
* @param scene defines the hosting scene
|
|
18
|
+
*/
|
|
19
|
+
constructor(name: string, frameGraph: FrameGraph, scene: Scene);
|
|
20
|
+
/**
|
|
21
|
+
* Gets the current class name
|
|
22
|
+
* @returns the class name
|
|
23
|
+
*/
|
|
24
|
+
getClassName(): string;
|
|
25
|
+
/**
|
|
26
|
+
* Gets the left texture input component
|
|
27
|
+
*/
|
|
28
|
+
get leftTexture(): NodeRenderGraphConnectionPoint;
|
|
29
|
+
protected _buildBlock(state: NodeRenderGraphBuildState): void;
|
|
30
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
2
|
+
import { NodeRenderGraphBlockConnectionPointTypes } from "../../Types/nodeRenderGraphTypes.js";
|
|
3
|
+
import { FrameGraphAnaglyphTask } from "../../../Tasks/PostProcesses/anaglyphTask.js";
|
|
4
|
+
import { ThinAnaglyphPostProcess } from "../../../../PostProcesses/thinAnaglyphPostProcess.js";
|
|
5
|
+
import { NodeRenderGraphBasePostProcessBlock } from "./basePostProcessBlock.js";
|
|
6
|
+
/**
|
|
7
|
+
* Block that implements the anaglyph post process
|
|
8
|
+
*/
|
|
9
|
+
export class NodeRenderGraphAnaglyphPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {
|
|
10
|
+
/**
|
|
11
|
+
* Gets the frame graph task associated with this block
|
|
12
|
+
*/
|
|
13
|
+
get task() {
|
|
14
|
+
return this._frameGraphTask;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Create a new NodeRenderAnaglyphPostProcessBlock
|
|
18
|
+
* @param name defines the block name
|
|
19
|
+
* @param frameGraph defines the hosting frame graph
|
|
20
|
+
* @param scene defines the hosting scene
|
|
21
|
+
*/
|
|
22
|
+
constructor(name, frameGraph, scene) {
|
|
23
|
+
super(name, frameGraph, scene);
|
|
24
|
+
this.registerInput("leftTexture", NodeRenderGraphBlockConnectionPointTypes.Texture);
|
|
25
|
+
this.leftTexture.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
|
|
26
|
+
this._finalizeInputOutputRegistering();
|
|
27
|
+
this._frameGraphTask = new FrameGraphAnaglyphTask(this.name, frameGraph, new ThinAnaglyphPostProcess(name, scene.getEngine()));
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Gets the current class name
|
|
31
|
+
* @returns the class name
|
|
32
|
+
*/
|
|
33
|
+
getClassName() {
|
|
34
|
+
return "NodeRenderGraphAnaglyphPostProcessBlock";
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Gets the left texture input component
|
|
38
|
+
*/
|
|
39
|
+
get leftTexture() {
|
|
40
|
+
return this._inputs[2];
|
|
41
|
+
}
|
|
42
|
+
_buildBlock(state) {
|
|
43
|
+
super._buildBlock(state);
|
|
44
|
+
this._frameGraphTask.leftTexture = this.leftTexture.connectedPoint?.value;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
RegisterClass("BABYLON.NodeRenderGraphAnaglyphPostProcessBlock", NodeRenderGraphAnaglyphPostProcessBlock);
|
|
48
|
+
//# sourceMappingURL=anaglyphPostProcessBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anaglyphPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/anaglyphPostProcessBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAAE,qDAAyD;AAC1F,OAAO,EAAE,uBAAuB,EAAE,6DAAmD;AACrF,OAAO,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC;AAE7E;;GAEG;AACH,MAAM,OAAO,uCAAwC,SAAQ,mCAAmC;IAG5F;;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,aAAa,EAAE,wCAAwC,CAAC,OAAO,CAAC,CAAC;QAEpF,IAAI,CAAC,WAAW,CAAC,+BAA+B,CAAC,wCAAwC,CAAC,uBAAuB,CAAC,CAAC;QAEnH,IAAI,CAAC,+BAA+B,EAAE,CAAC;QAEvC,IAAI,CAAC,eAAe,GAAG,IAAI,sBAAsB,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,uBAAuB,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IACnI,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,OAAO,yCAAyC,CAAC;IACrD,CAAC;IAED;;OAEG;IACH,IAAW,WAAW;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAEkB,WAAW,CAAC,KAAgC;QAC3D,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,IAAI,CAAC,eAAe,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE,KAAgC,CAAC;IACzG,CAAC;CACJ;AAED,aAAa,CAAC,iDAAiD,EAAE,uCAAuC,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraphTextureHandle, FrameGraph } from \"core/index\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { FrameGraphAnaglyphTask } from \"core/FrameGraph/Tasks/PostProcesses/anaglyphTask\";\r\nimport { ThinAnaglyphPostProcess } from \"core/PostProcesses/thinAnaglyphPostProcess\";\r\nimport { NodeRenderGraphBasePostProcessBlock } from \"./basePostProcessBlock\";\r\n\r\n/**\r\n * Block that implements the anaglyph post process\r\n */\r\nexport class NodeRenderGraphAnaglyphPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {\r\n protected override _frameGraphTask: FrameGraphAnaglyphTask;\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 NodeRenderAnaglyphPostProcessBlock\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(\"leftTexture\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n\r\n this.leftTexture.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n\r\n this._finalizeInputOutputRegistering();\r\n\r\n this._frameGraphTask = new FrameGraphAnaglyphTask(this.name, frameGraph, new ThinAnaglyphPostProcess(name, scene.getEngine()));\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 \"NodeRenderGraphAnaglyphPostProcessBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left texture input component\r\n */\r\n public get leftTexture(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this._frameGraphTask.leftTexture = this.leftTexture.connectedPoint?.value as FrameGraphTextureHandle;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphAnaglyphPostProcessBlock\", NodeRenderGraphAnaglyphPostProcessBlock);\r\n"]}
|
|
@@ -3,7 +3,7 @@ import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock";
|
|
|
3
3
|
interface IPostProcessLike {
|
|
4
4
|
sourceSamplingMode: number;
|
|
5
5
|
sourceTexture: FrameGraphTextureHandle;
|
|
6
|
-
|
|
6
|
+
targetTexture?: FrameGraphTextureHandle;
|
|
7
7
|
outputTexture: FrameGraphTextureHandle;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
@@ -32,9 +32,9 @@ export declare class NodeRenderGraphBasePostProcessBlock extends NodeRenderGraph
|
|
|
32
32
|
*/
|
|
33
33
|
get source(): NodeRenderGraphConnectionPoint;
|
|
34
34
|
/**
|
|
35
|
-
* Gets the
|
|
35
|
+
* Gets the target input component
|
|
36
36
|
*/
|
|
37
|
-
get
|
|
37
|
+
get target(): NodeRenderGraphConnectionPoint;
|
|
38
38
|
/**
|
|
39
39
|
* Gets the output component
|
|
40
40
|
*/
|
|
@@ -15,15 +15,15 @@ export class NodeRenderGraphBasePostProcessBlock extends NodeRenderGraphBlock {
|
|
|
15
15
|
constructor(name, frameGraph, scene) {
|
|
16
16
|
super(name, frameGraph, scene);
|
|
17
17
|
this.registerInput("source", NodeRenderGraphBlockConnectionPointTypes.Texture);
|
|
18
|
-
this.registerInput("
|
|
18
|
+
this.registerInput("target", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
19
19
|
this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
|
|
20
|
-
this.
|
|
20
|
+
this.target.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);
|
|
21
21
|
}
|
|
22
22
|
_finalizeInputOutputRegistering() {
|
|
23
23
|
this._addDependenciesInput();
|
|
24
24
|
this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
|
|
25
25
|
this.output._typeConnectionSource = () => {
|
|
26
|
-
return this.
|
|
26
|
+
return this.target.isConnected ? this.target : this.source;
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
/** Sampling mode used to sample from the source texture */
|
|
@@ -47,9 +47,9 @@ export class NodeRenderGraphBasePostProcessBlock extends NodeRenderGraphBlock {
|
|
|
47
47
|
return this._inputs[0];
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
|
-
* Gets the
|
|
50
|
+
* Gets the target input component
|
|
51
51
|
*/
|
|
52
|
-
get
|
|
52
|
+
get target() {
|
|
53
53
|
return this._inputs[1];
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
@@ -62,7 +62,7 @@ export class NodeRenderGraphBasePostProcessBlock extends NodeRenderGraphBlock {
|
|
|
62
62
|
super._buildBlock(state);
|
|
63
63
|
this.output.value = this._frameGraphTask.outputTexture;
|
|
64
64
|
this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value;
|
|
65
|
-
this._frameGraphTask.
|
|
65
|
+
this._frameGraphTask.targetTexture = this.target.connectedPoint?.value;
|
|
66
66
|
}
|
|
67
67
|
_dumpPropertiesCode() {
|
|
68
68
|
const codes = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basePostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AAStG;;GAEG;AACH,MAAM,OAAO,mCAAoC,SAAQ,oBAAoB;IAGzE;;;;;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,
|
|
1
|
+
{"version":3,"file":"basePostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;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BAAsB,+CAAuC,YAAY,CAAC;6EAGjG","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraphTextureHandle, FrameGraph, FrameGraphTask } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\n\r\ninterface IPostProcessLike {\r\n sourceSamplingMode: number;\r\n sourceTexture: FrameGraphTextureHandle;\r\n targetTexture?: FrameGraphTextureHandle;\r\n outputTexture: FrameGraphTextureHandle;\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class NodeRenderGraphBasePostProcessBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: IPostProcessLike & FrameGraphTask;\r\n\r\n /**\r\n * Create a new NodeRenderGraphBasePostProcessBlock\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(\"target\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n\r\n this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n this.target.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\r\n }\r\n\r\n protected _finalizeInputOutputRegistering() {\r\n this._addDependenciesInput();\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.output._typeConnectionSource = () => {\r\n return this.target.isConnected ? this.target : this.source;\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 /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphBasePostProcessBlock\";\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 target input component\r\n */\r\n public get target(): 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;\r\n\r\n this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.targetTexture = this.target.connectedPoint?.value as FrameGraphTextureHandle;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\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.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.sourceSamplingMode = serializationObject.sourceSamplingMode;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Scene, FrameGraph } from "../../../../index.js";
|
|
2
|
+
import { Vector2 } from "../../../../Maths/math.vector.js";
|
|
3
|
+
import { FrameGraphChromaticAberrationTask } from "../../../Tasks/PostProcesses/chromaticAberrationTask.js";
|
|
4
|
+
import { NodeRenderGraphBasePostProcessBlock } from "./basePostProcessBlock";
|
|
5
|
+
/**
|
|
6
|
+
* Block that implements the chromatic aberration post process
|
|
7
|
+
*/
|
|
8
|
+
export declare class NodeRenderGraphChromaticAberrationPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {
|
|
9
|
+
protected _frameGraphTask: FrameGraphChromaticAberrationTask;
|
|
10
|
+
/**
|
|
11
|
+
* Gets the frame graph task associated with this block
|
|
12
|
+
*/
|
|
13
|
+
get task(): FrameGraphChromaticAberrationTask;
|
|
14
|
+
/**
|
|
15
|
+
* Create a new chromatic aberration post process block
|
|
16
|
+
* @param name defines the block name
|
|
17
|
+
* @param frameGraph defines the hosting frame graph
|
|
18
|
+
* @param scene defines the hosting scene
|
|
19
|
+
*/
|
|
20
|
+
constructor(name: string, frameGraph: FrameGraph, scene: Scene);
|
|
21
|
+
/** The amount of separation of rgb channels */
|
|
22
|
+
get aberrationAmount(): number;
|
|
23
|
+
set aberrationAmount(value: number);
|
|
24
|
+
/** The amount the effect will increase for pixels closer to the edge of the screen */
|
|
25
|
+
get radialIntensity(): number;
|
|
26
|
+
set radialIntensity(value: number);
|
|
27
|
+
/** The normalized direction in which the rgb channels should be separated. If set to 0,0 radial direction will be used. */
|
|
28
|
+
get direction(): Vector2;
|
|
29
|
+
set direction(value: Vector2);
|
|
30
|
+
/**
|
|
31
|
+
* Gets the current class name
|
|
32
|
+
* @returns the class name
|
|
33
|
+
*/
|
|
34
|
+
getClassName(): string;
|
|
35
|
+
protected _dumpPropertiesCode(): string;
|
|
36
|
+
serialize(): any;
|
|
37
|
+
_deserialize(serializationObject: any): void;
|
|
38
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { __decorate } from "../../../../tslib.es6.js";
|
|
2
|
+
import { Vector2 } from "../../../../Maths/math.vector.js";
|
|
3
|
+
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
4
|
+
import { editableInPropertyPage } from "../../../../Decorators/nodeDecorator.js";
|
|
5
|
+
import { FrameGraphChromaticAberrationTask } from "../../../Tasks/PostProcesses/chromaticAberrationTask.js";
|
|
6
|
+
import { ThinChromaticAberrationPostProcess } from "../../../../PostProcesses/thinChromaticAberrationPostProcess.js";
|
|
7
|
+
import { NodeRenderGraphBasePostProcessBlock } from "./basePostProcessBlock.js";
|
|
8
|
+
/**
|
|
9
|
+
* Block that implements the chromatic aberration post process
|
|
10
|
+
*/
|
|
11
|
+
export class NodeRenderGraphChromaticAberrationPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {
|
|
12
|
+
/**
|
|
13
|
+
* Gets the frame graph task associated with this block
|
|
14
|
+
*/
|
|
15
|
+
get task() {
|
|
16
|
+
return this._frameGraphTask;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Create a new chromatic aberration post process block
|
|
20
|
+
* @param name defines the block name
|
|
21
|
+
* @param frameGraph defines the hosting frame graph
|
|
22
|
+
* @param scene defines the hosting scene
|
|
23
|
+
*/
|
|
24
|
+
constructor(name, frameGraph, scene) {
|
|
25
|
+
super(name, frameGraph, scene);
|
|
26
|
+
this._finalizeInputOutputRegistering();
|
|
27
|
+
this._frameGraphTask = new FrameGraphChromaticAberrationTask(this.name, frameGraph, new ThinChromaticAberrationPostProcess(name, scene.getEngine()));
|
|
28
|
+
}
|
|
29
|
+
/** The amount of separation of rgb channels */
|
|
30
|
+
get aberrationAmount() {
|
|
31
|
+
return this._frameGraphTask.postProcess.aberrationAmount;
|
|
32
|
+
}
|
|
33
|
+
set aberrationAmount(value) {
|
|
34
|
+
this._frameGraphTask.postProcess.aberrationAmount = value;
|
|
35
|
+
}
|
|
36
|
+
/** The amount the effect will increase for pixels closer to the edge of the screen */
|
|
37
|
+
get radialIntensity() {
|
|
38
|
+
return this._frameGraphTask.postProcess.radialIntensity;
|
|
39
|
+
}
|
|
40
|
+
set radialIntensity(value) {
|
|
41
|
+
this._frameGraphTask.postProcess.radialIntensity = value;
|
|
42
|
+
}
|
|
43
|
+
/** The normalized direction in which the rgb channels should be separated. If set to 0,0 radial direction will be used. */
|
|
44
|
+
get direction() {
|
|
45
|
+
return this._frameGraphTask.postProcess.direction;
|
|
46
|
+
}
|
|
47
|
+
set direction(value) {
|
|
48
|
+
this._frameGraphTask.postProcess.direction = value;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Gets the current class name
|
|
52
|
+
* @returns the class name
|
|
53
|
+
*/
|
|
54
|
+
getClassName() {
|
|
55
|
+
return "NodeRenderGraphChromaticAberrationPostProcessBlock";
|
|
56
|
+
}
|
|
57
|
+
_dumpPropertiesCode() {
|
|
58
|
+
const codes = [];
|
|
59
|
+
codes.push(`${this._codeVariableName}.aberrationAmount = ${this.aberrationAmount};`);
|
|
60
|
+
codes.push(`${this._codeVariableName}.radialIntensity = ${this.radialIntensity};`);
|
|
61
|
+
codes.push(`${this._codeVariableName}.direction = new BABYLON.Vector2(${this.direction.x}, ${this.direction.y});`);
|
|
62
|
+
return super._dumpPropertiesCode() + codes.join("\n");
|
|
63
|
+
}
|
|
64
|
+
serialize() {
|
|
65
|
+
const serializationObject = super.serialize();
|
|
66
|
+
serializationObject.aberrationAmount = this.aberrationAmount;
|
|
67
|
+
serializationObject.radialIntensity = this.radialIntensity;
|
|
68
|
+
serializationObject.direction = this.direction.asArray();
|
|
69
|
+
return serializationObject;
|
|
70
|
+
}
|
|
71
|
+
_deserialize(serializationObject) {
|
|
72
|
+
super._deserialize(serializationObject);
|
|
73
|
+
this.aberrationAmount = serializationObject.aberrationAmount;
|
|
74
|
+
this.radialIntensity = serializationObject.radialIntensity;
|
|
75
|
+
this.direction = Vector2.FromArray(serializationObject.direction);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
__decorate([
|
|
79
|
+
editableInPropertyPage("Amount", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES", { min: -1000, max: 1000 })
|
|
80
|
+
], NodeRenderGraphChromaticAberrationPostProcessBlock.prototype, "aberrationAmount", null);
|
|
81
|
+
__decorate([
|
|
82
|
+
editableInPropertyPage("Radial intensity", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES", { min: 0.1, max: 5 })
|
|
83
|
+
], NodeRenderGraphChromaticAberrationPostProcessBlock.prototype, "radialIntensity", null);
|
|
84
|
+
__decorate([
|
|
85
|
+
editableInPropertyPage("Direction", 3 /* PropertyTypeForEdition.Vector2 */, "PROPERTIES")
|
|
86
|
+
], NodeRenderGraphChromaticAberrationPostProcessBlock.prototype, "direction", null);
|
|
87
|
+
RegisterClass("BABYLON.NodeRenderGraphChromaticAberrationPostProcessBlock", NodeRenderGraphChromaticAberrationPostProcessBlock);
|
|
88
|
+
//# sourceMappingURL=chromaticAberrationPostProcessBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chromaticAberrationPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,yCAA+B;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,iCAAiC,EAAE,gEAAoE;AAChH,OAAO,EAAE,kCAAkC,EAAE,wEAA8D;AAC3G,OAAO,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC;AAE7E;;GAEG;AACH,MAAM,OAAO,kDAAmD,SAAQ,mCAAmC;IAGvG;;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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index\";\r\nimport { Vector2 } from \"core/Maths/math.vector\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphChromaticAberrationTask } from \"core/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask\";\r\nimport { ThinChromaticAberrationPostProcess } from \"core/PostProcesses/thinChromaticAberrationPostProcess\";\r\nimport { NodeRenderGraphBasePostProcessBlock } from \"./basePostProcessBlock\";\r\n\r\n/**\r\n * Block that implements the chromatic aberration post process\r\n */\r\nexport class NodeRenderGraphChromaticAberrationPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {\r\n protected override _frameGraphTask: FrameGraphChromaticAberrationTask;\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 chromatic aberration post process block\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene) {\r\n super(name, frameGraph, scene);\r\n\r\n this._finalizeInputOutputRegistering();\r\n\r\n this._frameGraphTask = new FrameGraphChromaticAberrationTask(this.name, frameGraph, new ThinChromaticAberrationPostProcess(name, scene.getEngine()));\r\n }\r\n\r\n /** The amount of separation of rgb channels */\r\n @editableInPropertyPage(\"Amount\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: -1000, max: 1000 })\r\n public get aberrationAmount(): number {\r\n return this._frameGraphTask.postProcess.aberrationAmount;\r\n }\r\n\r\n public set aberrationAmount(value: number) {\r\n this._frameGraphTask.postProcess.aberrationAmount = value;\r\n }\r\n\r\n /** The amount the effect will increase for pixels closer to the edge of the screen */\r\n @editableInPropertyPage(\"Radial intensity\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0.1, max: 5 })\r\n public get radialIntensity(): number {\r\n return this._frameGraphTask.postProcess.radialIntensity;\r\n }\r\n\r\n public set radialIntensity(value: number) {\r\n this._frameGraphTask.postProcess.radialIntensity = value;\r\n }\r\n\r\n /** The normalized direction in which the rgb channels should be separated. If set to 0,0 radial direction will be used. */\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 /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphChromaticAberrationPostProcessBlock\";\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.aberrationAmount = ${this.aberrationAmount};`);\r\n codes.push(`${this._codeVariableName}.radialIntensity = ${this.radialIntensity};`);\r\n codes.push(`${this._codeVariableName}.direction = new BABYLON.Vector2(${this.direction.x}, ${this.direction.y});`);\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.aberrationAmount = this.aberrationAmount;\r\n serializationObject.radialIntensity = this.radialIntensity;\r\n serializationObject.direction = this.direction.asArray();\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.aberrationAmount = serializationObject.aberrationAmount;\r\n this.radialIntensity = serializationObject.radialIntensity;\r\n this.direction = Vector2.FromArray(serializationObject.direction);\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphChromaticAberrationPostProcessBlock\", NodeRenderGraphChromaticAberrationPostProcessBlock);\r\n"]}
|
|
@@ -32,9 +32,9 @@ export declare class NodeRenderGraphBaseObjectRendererBlock extends NodeRenderGr
|
|
|
32
32
|
*/
|
|
33
33
|
getClassName(): string;
|
|
34
34
|
/**
|
|
35
|
-
* Gets the
|
|
35
|
+
* Gets the target texture input component
|
|
36
36
|
*/
|
|
37
|
-
get
|
|
37
|
+
get target(): NodeRenderGraphConnectionPoint;
|
|
38
38
|
/**
|
|
39
39
|
* Gets the depth texture input component
|
|
40
40
|
*/
|
|
@@ -22,7 +22,7 @@ export class NodeRenderGraphBaseObjectRendererBlock extends NodeRenderGraphBlock
|
|
|
22
22
|
*/
|
|
23
23
|
constructor(name, frameGraph, scene) {
|
|
24
24
|
super(name, frameGraph, scene);
|
|
25
|
-
this.registerInput("
|
|
25
|
+
this.registerInput("target", NodeRenderGraphBlockConnectionPointTypes.Texture);
|
|
26
26
|
this.registerInput("depth", NodeRenderGraphBlockConnectionPointTypes.TextureBackBufferDepthStencilAttachment, true);
|
|
27
27
|
this.registerInput("camera", NodeRenderGraphBlockConnectionPointTypes.Camera);
|
|
28
28
|
this.registerInput("objects", NodeRenderGraphBlockConnectionPointTypes.ObjectList);
|
|
@@ -31,10 +31,10 @@ export class NodeRenderGraphBaseObjectRendererBlock extends NodeRenderGraphBlock
|
|
|
31
31
|
this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
|
|
32
32
|
this.registerOutput("outputDepth", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
|
|
33
33
|
this.registerOutput("objectRenderer", NodeRenderGraphBlockConnectionPointTypes.Object, new NodeRenderGraphConnectionPointCustomObject("objectRenderer", this, 1 /* NodeRenderGraphConnectionPointDirection.Output */, NodeRenderGraphBaseObjectRendererBlock, "NodeRenderGraphBaseObjectRendererBlock"));
|
|
34
|
-
this.
|
|
34
|
+
this.target.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBufferDepthStencil);
|
|
35
35
|
this.depth.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureDepthStencilAttachment);
|
|
36
36
|
this.shadowGenerators.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.ResourceContainer);
|
|
37
|
-
this.output._typeConnectionSource = this.
|
|
37
|
+
this.output._typeConnectionSource = this.target;
|
|
38
38
|
this.outputDepth._typeConnectionSource = this.depth;
|
|
39
39
|
}
|
|
40
40
|
/** Indicates if depth testing must be enabled or disabled */
|
|
@@ -66,9 +66,9 @@ export class NodeRenderGraphBaseObjectRendererBlock extends NodeRenderGraphBlock
|
|
|
66
66
|
return "NodeRenderGraphBaseObjectRendererBlock";
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
69
|
-
* Gets the
|
|
69
|
+
* Gets the target texture input component
|
|
70
70
|
*/
|
|
71
|
-
get
|
|
71
|
+
get target() {
|
|
72
72
|
return this._inputs[0];
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
@@ -124,7 +124,7 @@ export class NodeRenderGraphBaseObjectRendererBlock extends NodeRenderGraphBlock
|
|
|
124
124
|
this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the "output" texture of the task
|
|
125
125
|
this.outputDepth.value = this._frameGraphTask.outputDepthTexture; // the value of the outputDepth connection point is the "outputDepth" texture of the task
|
|
126
126
|
this.objectRenderer.value = this._frameGraphTask; // the value of the objectRenderer connection point is the task itself
|
|
127
|
-
this._frameGraphTask.
|
|
127
|
+
this._frameGraphTask.targetTexture = this.target.connectedPoint?.value;
|
|
128
128
|
this._frameGraphTask.depthTexture = this.depth.connectedPoint?.value;
|
|
129
129
|
this._frameGraphTask.camera = this.camera.connectedPoint?.value;
|
|
130
130
|
this._frameGraphTask.objectList = this.objects.connectedPoint?.value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseObjectRendererBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.ts"],"names":[],"mappings":";AAYA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,wCAAwC,EAA2C,MAAM,kCAAkC,CAAC;AACrI,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCA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BAAqB,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC;QACjF,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;QAC/C,mBAAmB,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACjD,mBAAmB,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;QACzD,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,UAAU,GAAG,mBAAmB,CAAC,UAAU,CAAC;QACjD,IAAI,CAAC,cAAc,GAAG,mBAAmB,CAAC,cAAc,CAAC;IAC7D,CAAC;CACJ;AAtJG;IADC,sBAAsB,CAAC,YAAY,0CAAkC,YAAY,CAAC;uEAGlF;AAQD;IADC,sBAAsB,CAAC,aAAa,0CAAkC,YAAY,CAAC;wEAGnF;AAQD;IADC,sBAAsB,CAAC,iBAAiB,0CAAkC,YAAY,CAAC;4EAGvF","sourcesContent":["import type {\r\n Scene,\r\n NodeRenderGraphBuildState,\r\n FrameGraph,\r\n FrameGraphTextureHandle,\r\n FrameGraphObjectList,\r\n Camera,\r\n FrameGraphObjectRendererTask,\r\n NodeRenderGraphResourceContainerBlock,\r\n FrameGraphShadowGeneratorTask,\r\n // eslint-disable-next-line import/no-internal-modules\r\n} from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes, NodeRenderGraphConnectionPointDirection } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { NodeRenderGraphConnectionPoint } from \"../../nodeRenderGraphBlockConnectionPoint\";\r\nimport { NodeRenderGraphConnectionPointCustomObject } from \"../../nodeRenderGraphConnectionPointCustomObject\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class NodeRenderGraphBaseObjectRendererBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphObjectRendererTask;\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 NodeRenderGraphBaseObjectRendererBlock\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(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"depth\", NodeRenderGraphBlockConnectionPointTypes.TextureBackBufferDepthStencilAttachment, true);\r\n this.registerInput(\"camera\", NodeRenderGraphBlockConnectionPointTypes.Camera);\r\n this.registerInput(\"objects\", NodeRenderGraphBlockConnectionPointTypes.ObjectList);\r\n this._addDependenciesInput();\r\n this.registerInput(\"shadowGenerators\", NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator, true);\r\n\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n this.registerOutput(\"outputDepth\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n this.registerOutput(\r\n \"objectRenderer\",\r\n NodeRenderGraphBlockConnectionPointTypes.Object,\r\n new NodeRenderGraphConnectionPointCustomObject(\r\n \"objectRenderer\",\r\n this,\r\n NodeRenderGraphConnectionPointDirection.Output,\r\n NodeRenderGraphBaseObjectRendererBlock,\r\n \"NodeRenderGraphBaseObjectRendererBlock\"\r\n )\r\n );\r\n\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBufferDepthStencil);\r\n this.depth.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureDepthStencilAttachment);\r\n this.shadowGenerators.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.ResourceContainer);\r\n\r\n this.output._typeConnectionSource = this.destination;\r\n this.outputDepth._typeConnectionSource = this.depth;\r\n }\r\n\r\n /** Indicates if depth testing must be enabled or disabled */\r\n @editableInPropertyPage(\"Depth test\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get depthTest() {\r\n return this._frameGraphTask.depthTest;\r\n }\r\n\r\n public set depthTest(value: boolean) {\r\n this._frameGraphTask.depthTest = value;\r\n }\r\n\r\n /** Indicates if depth writing must be enabled or disabled */\r\n @editableInPropertyPage(\"Depth write\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get depthWrite() {\r\n return this._frameGraphTask.depthWrite;\r\n }\r\n\r\n public set depthWrite(value: boolean) {\r\n this._frameGraphTask.depthWrite = value;\r\n }\r\n\r\n /** Indicates if shadows must be enabled or disabled */\r\n @editableInPropertyPage(\"Disable shadows\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get disableShadows() {\r\n return this._frameGraphTask.disableShadows;\r\n }\r\n\r\n public set disableShadows(value: boolean) {\r\n this._frameGraphTask.disableShadows = 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 \"NodeRenderGraphBaseObjectRendererBlock\";\r\n }\r\n\r\n /**\r\n * Gets the destination texture input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the depth texture input component\r\n */\r\n public get depth(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the camera input component\r\n */\r\n public get camera(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the objects input component\r\n */\r\n public get objects(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the dependencies input component\r\n */\r\n public get dependencies(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the shadowGenerators input component\r\n */\r\n public get shadowGenerators(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[5];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n /**\r\n * Gets the output depth component\r\n */\r\n public get outputDepth(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[1];\r\n }\r\n\r\n /**\r\n * Gets the objectRenderer component\r\n */\r\n public get objectRenderer(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[2];\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 this.outputDepth.value = this._frameGraphTask.outputDepthTexture; // the value of the outputDepth connection point is the \"outputDepth\" texture of the task\r\n this.objectRenderer.value = this._frameGraphTask; // the value of the objectRenderer connection point is the task itself\r\n\r\n this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.depthTexture = this.depth.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.camera = this.camera.connectedPoint?.value as Camera;\r\n this._frameGraphTask.objectList = this.objects.connectedPoint?.value as FrameGraphObjectList;\r\n\r\n this._frameGraphTask.shadowGenerators = [];\r\n\r\n const shadowGeneratorsConnectedPoint = this.shadowGenerators.connectedPoint;\r\n if (shadowGeneratorsConnectedPoint) {\r\n if (shadowGeneratorsConnectedPoint.type === NodeRenderGraphBlockConnectionPointTypes.ResourceContainer) {\r\n const container = shadowGeneratorsConnectedPoint.ownerBlock as NodeRenderGraphResourceContainerBlock;\r\n container.inputs.forEach((input) => {\r\n if (input.connectedPoint && input.connectedPoint.value !== undefined && NodeRenderGraphConnectionPoint.IsShadowGenerator(input.connectedPoint.value)) {\r\n this._frameGraphTask.shadowGenerators!.push(input.connectedPoint.value as FrameGraphShadowGeneratorTask);\r\n }\r\n });\r\n } else if (NodeRenderGraphConnectionPoint.IsShadowGenerator(shadowGeneratorsConnectedPoint.value)) {\r\n this._frameGraphTask.shadowGenerators[0] = shadowGeneratorsConnectedPoint.value as FrameGraphShadowGeneratorTask;\r\n }\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.depthTest = ${this.depthTest};`);\r\n codes.push(`${this._codeVariableName}.depthWrite = ${this.depthWrite};`);\r\n codes.push(`${this._codeVariableName}.disableShadows = ${this.disableShadows};`);\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.depthTest = this.depthTest;\r\n serializationObject.depthWrite = this.depthWrite;\r\n serializationObject.disableShadows = this.disableShadows;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.depthTest = serializationObject.depthTest;\r\n this.depthWrite = serializationObject.depthWrite;\r\n this.disableShadows = serializationObject.disableShadows;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"baseObjectRendererBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.ts"],"names":[],"mappings":";AAYA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,wCAAwC,EAA2C,MAAM,kCAAkC,CAAC;AACrI,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AAC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AC,cAAc,GAAG,CAAC,CAAC;QACjF,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;QAC/C,mBAAmB,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACjD,mBAAmB,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;QACzD,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,UAAU,GAAG,mBAAmB,CAAC,UAAU,CAAC;QACjD,IAAI,CAAC,cAAc,GAAG,mBAAmB,CAAC,cAAc,CAAC;IAC7D,CAAC;CACJ;AAtJG;IADC,sBAAsB,CAAC,YAAY,0CAAkC,YAAY,CAAC;uEAGlF;AAQD;IADC,sBAAsB,CAAC,aAAa,0CAAkC,YAAY,CAAC;wEAGnF;AAQD;IADC,sBAAsB,CAAC,iBAAiB,0CAAkC,YAAY,CAAC;4EAGvF","sourcesContent":["import type {\r\n Scene,\r\n NodeRenderGraphBuildState,\r\n FrameGraph,\r\n FrameGraphTextureHandle,\r\n FrameGraphObjectList,\r\n Camera,\r\n FrameGraphObjectRendererTask,\r\n NodeRenderGraphResourceContainerBlock,\r\n FrameGraphShadowGeneratorTask,\r\n // eslint-disable-next-line import/no-internal-modules\r\n} from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes, NodeRenderGraphConnectionPointDirection } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { NodeRenderGraphConnectionPoint } from \"../../nodeRenderGraphBlockConnectionPoint\";\r\nimport { NodeRenderGraphConnectionPointCustomObject } from \"../../nodeRenderGraphConnectionPointCustomObject\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class NodeRenderGraphBaseObjectRendererBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphObjectRendererTask;\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 NodeRenderGraphBaseObjectRendererBlock\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(\"target\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"depth\", NodeRenderGraphBlockConnectionPointTypes.TextureBackBufferDepthStencilAttachment, true);\r\n this.registerInput(\"camera\", NodeRenderGraphBlockConnectionPointTypes.Camera);\r\n this.registerInput(\"objects\", NodeRenderGraphBlockConnectionPointTypes.ObjectList);\r\n this._addDependenciesInput();\r\n this.registerInput(\"shadowGenerators\", NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator, true);\r\n\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n this.registerOutput(\"outputDepth\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n this.registerOutput(\r\n \"objectRenderer\",\r\n NodeRenderGraphBlockConnectionPointTypes.Object,\r\n new NodeRenderGraphConnectionPointCustomObject(\r\n \"objectRenderer\",\r\n this,\r\n NodeRenderGraphConnectionPointDirection.Output,\r\n NodeRenderGraphBaseObjectRendererBlock,\r\n \"NodeRenderGraphBaseObjectRendererBlock\"\r\n )\r\n );\r\n\r\n this.target.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBufferDepthStencil);\r\n this.depth.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureDepthStencilAttachment);\r\n this.shadowGenerators.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.ResourceContainer);\r\n\r\n this.output._typeConnectionSource = this.target;\r\n this.outputDepth._typeConnectionSource = this.depth;\r\n }\r\n\r\n /** Indicates if depth testing must be enabled or disabled */\r\n @editableInPropertyPage(\"Depth test\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get depthTest() {\r\n return this._frameGraphTask.depthTest;\r\n }\r\n\r\n public set depthTest(value: boolean) {\r\n this._frameGraphTask.depthTest = value;\r\n }\r\n\r\n /** Indicates if depth writing must be enabled or disabled */\r\n @editableInPropertyPage(\"Depth write\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get depthWrite() {\r\n return this._frameGraphTask.depthWrite;\r\n }\r\n\r\n public set depthWrite(value: boolean) {\r\n this._frameGraphTask.depthWrite = value;\r\n }\r\n\r\n /** Indicates if shadows must be enabled or disabled */\r\n @editableInPropertyPage(\"Disable shadows\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get disableShadows() {\r\n return this._frameGraphTask.disableShadows;\r\n }\r\n\r\n public set disableShadows(value: boolean) {\r\n this._frameGraphTask.disableShadows = 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 \"NodeRenderGraphBaseObjectRendererBlock\";\r\n }\r\n\r\n /**\r\n * Gets the target texture input component\r\n */\r\n public get target(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the depth texture input component\r\n */\r\n public get depth(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the camera input component\r\n */\r\n public get camera(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the objects input component\r\n */\r\n public get objects(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the dependencies input component\r\n */\r\n public get dependencies(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the shadowGenerators input component\r\n */\r\n public get shadowGenerators(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[5];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n /**\r\n * Gets the output depth component\r\n */\r\n public get outputDepth(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[1];\r\n }\r\n\r\n /**\r\n * Gets the objectRenderer component\r\n */\r\n public get objectRenderer(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[2];\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 this.outputDepth.value = this._frameGraphTask.outputDepthTexture; // the value of the outputDepth connection point is the \"outputDepth\" texture of the task\r\n this.objectRenderer.value = this._frameGraphTask; // the value of the objectRenderer connection point is the task itself\r\n\r\n this._frameGraphTask.targetTexture = this.target.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.depthTexture = this.depth.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.camera = this.camera.connectedPoint?.value as Camera;\r\n this._frameGraphTask.objectList = this.objects.connectedPoint?.value as FrameGraphObjectList;\r\n\r\n this._frameGraphTask.shadowGenerators = [];\r\n\r\n const shadowGeneratorsConnectedPoint = this.shadowGenerators.connectedPoint;\r\n if (shadowGeneratorsConnectedPoint) {\r\n if (shadowGeneratorsConnectedPoint.type === NodeRenderGraphBlockConnectionPointTypes.ResourceContainer) {\r\n const container = shadowGeneratorsConnectedPoint.ownerBlock as NodeRenderGraphResourceContainerBlock;\r\n container.inputs.forEach((input) => {\r\n if (input.connectedPoint && input.connectedPoint.value !== undefined && NodeRenderGraphConnectionPoint.IsShadowGenerator(input.connectedPoint.value)) {\r\n this._frameGraphTask.shadowGenerators!.push(input.connectedPoint.value as FrameGraphShadowGeneratorTask);\r\n }\r\n });\r\n } else if (NodeRenderGraphConnectionPoint.IsShadowGenerator(shadowGeneratorsConnectedPoint.value)) {\r\n this._frameGraphTask.shadowGenerators[0] = shadowGeneratorsConnectedPoint.value as FrameGraphShadowGeneratorTask;\r\n }\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.depthTest = ${this.depthTest};`);\r\n codes.push(`${this._codeVariableName}.depthWrite = ${this.depthWrite};`);\r\n codes.push(`${this._codeVariableName}.disableShadows = ${this.disableShadows};`);\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.depthTest = this.depthTest;\r\n serializationObject.depthWrite = this.depthWrite;\r\n serializationObject.disableShadows = this.disableShadows;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.depthTest = serializationObject.depthTest;\r\n this.depthWrite = serializationObject.depthWrite;\r\n this.disableShadows = serializationObject.disableShadows;\r\n }\r\n}\r\n"]}
|
|
@@ -28,9 +28,9 @@ export declare class NodeRenderGraphUtilityLayerRendererBlock extends NodeRender
|
|
|
28
28
|
*/
|
|
29
29
|
getClassName(): string;
|
|
30
30
|
/**
|
|
31
|
-
* Gets the
|
|
31
|
+
* Gets the target input component
|
|
32
32
|
*/
|
|
33
|
-
get
|
|
33
|
+
get target(): NodeRenderGraphConnectionPoint;
|
|
34
34
|
/**
|
|
35
35
|
* Gets the camera input component
|
|
36
36
|
*/
|