@babylonjs/core 7.44.0 → 7.44.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/Debug/debugLayer.d.ts +4 -0
- package/Debug/debugLayer.js +9 -0
- package/Debug/debugLayer.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +2 -4
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +2 -4
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/abstractEngine.d.ts +19 -1
- package/Engines/abstractEngine.js +48 -9
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/engine.d.ts +1 -1
- package/Engines/engine.js +2 -20
- package/Engines/engine.js.map +1 -1
- package/Engines/renderTargetWrapper.js +2 -2
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.js +1 -5
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +1 -0
- package/Engines/webgpuEngine.js.map +1 -1
- package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.d.ts +16 -12
- package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js +63 -27
- package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.d.ts +72 -0
- package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js +197 -0
- package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.d.ts +4 -0
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +9 -0
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/index.d.ts +1 -0
- package/FrameGraph/Node/Blocks/index.js +1 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +4 -2
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +2 -0
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.d.ts +3 -2
- package/FrameGraph/Node/nodeRenderGraph.js +4 -3
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraphBlock.js +4 -4
- package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.d.ts +8 -0
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js +10 -0
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraphConnectionPointCustomObject.d.ts +21 -0
- package/FrameGraph/Node/nodeRenderGraphConnectionPointCustomObject.js +31 -0
- package/FrameGraph/Node/nodeRenderGraphConnectionPointCustomObject.js.map +1 -0
- package/FrameGraph/Passes/pass.d.ts +1 -0
- package/FrameGraph/Passes/pass.js +4 -1
- package/FrameGraph/Passes/pass.js.map +1 -1
- package/FrameGraph/Tasks/Layers/baseLayerTask.d.ts +81 -0
- package/FrameGraph/Tasks/Layers/baseLayerTask.js +304 -0
- package/FrameGraph/Tasks/Layers/baseLayerTask.js.map +1 -0
- package/FrameGraph/Tasks/Layers/glowLayerTask.d.ts +3 -40
- package/FrameGraph/Tasks/Layers/glowLayerTask.js +4 -158
- package/FrameGraph/Tasks/Layers/glowLayerTask.js.map +1 -1
- package/FrameGraph/Tasks/Layers/highlightLayerTask.d.ts +21 -0
- package/FrameGraph/Tasks/Layers/highlightLayerTask.js +32 -0
- package/FrameGraph/Tasks/Layers/highlightLayerTask.js.map +1 -0
- package/FrameGraph/Tasks/Misc/executeTask.d.ts +2 -2
- package/FrameGraph/Tasks/Misc/executeTask.js +1 -0
- package/FrameGraph/Tasks/Misc/executeTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js +1 -1
- package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js +1 -1
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js +5 -4
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js +5 -4
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js +2 -4
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +4 -2
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +2 -2
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js +1 -0
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.d.ts +2 -2
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js +1 -0
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/clearTextureTask.d.ts +2 -2
- package/FrameGraph/Tasks/Texture/clearTextureTask.js +1 -0
- package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js +1 -1
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js.map +1 -1
- package/FrameGraph/frameGraph.d.ts +8 -2
- package/FrameGraph/frameGraph.js +31 -5
- package/FrameGraph/frameGraph.js.map +1 -1
- package/FrameGraph/frameGraphRenderContext.d.ts +10 -0
- package/FrameGraph/frameGraphRenderContext.js +14 -0
- package/FrameGraph/frameGraphRenderContext.js.map +1 -1
- package/FrameGraph/frameGraphTask.d.ts +3 -2
- package/FrameGraph/frameGraphTask.js +12 -2
- package/FrameGraph/frameGraphTask.js.map +1 -1
- package/FrameGraph/frameGraphTypes.d.ts +4 -0
- package/FrameGraph/frameGraphTypes.js.map +1 -1
- package/FrameGraph/index.d.ts +1 -0
- package/FrameGraph/index.js +1 -0
- package/FrameGraph/index.js.map +1 -1
- package/Helpers/environmentHelper.js +7 -6
- package/Helpers/environmentHelper.js.map +1 -1
- package/Layers/effectLayer.d.ts +1 -1
- package/Layers/effectLayer.js.map +1 -1
- package/Layers/glowLayer.d.ts +2 -14
- package/Layers/glowLayer.js +34 -36
- package/Layers/glowLayer.js.map +1 -1
- package/Layers/highlightLayer.d.ts +13 -74
- package/Layers/highlightLayer.js +123 -309
- package/Layers/highlightLayer.js.map +1 -1
- package/Layers/index.d.ts +1 -0
- package/Layers/index.js +1 -0
- package/Layers/index.js.map +1 -1
- package/Layers/thinEffectLayer.d.ts +55 -2
- package/Layers/thinEffectLayer.js +66 -0
- package/Layers/thinEffectLayer.js.map +1 -1
- package/Layers/thinGlowLayer.d.ts +3 -6
- package/Layers/thinGlowLayer.js +4 -1
- package/Layers/thinGlowLayer.js.map +1 -1
- package/Layers/thinHighlightLayer.d.ts +197 -0
- package/Layers/thinHighlightLayer.js +417 -0
- package/Layers/thinHighlightLayer.js.map +1 -0
- package/Materials/Node/nodeMaterial.js +2 -1
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/effect.d.ts +5 -0
- package/Materials/effect.js +15 -0
- package/Materials/effect.js.map +1 -1
- package/Meshes/Compression/dracoCompression.d.ts +4 -2
- package/Meshes/Compression/dracoCompression.js +24 -11
- package/Meshes/Compression/dracoCompression.js.map +1 -1
- package/Meshes/Compression/dracoCompressionWorker.js +4 -4
- package/Meshes/Compression/dracoCompressionWorker.js.map +1 -1
- package/Meshes/Compression/dracoEncoder.d.ts +5 -1
- package/Meshes/Compression/dracoEncoder.js +23 -17
- package/Meshes/Compression/dracoEncoder.js.map +1 -1
- package/Meshes/Compression/dracoEncoder.types.d.ts +4 -4
- package/Meshes/Compression/dracoEncoder.types.js.map +1 -1
- package/Meshes/Compression/meshoptCompression.js +17 -2
- package/Meshes/Compression/meshoptCompression.js.map +1 -1
- package/Meshes/Compression/test/integration/draco.test.d.ts +1 -0
- package/Meshes/Compression/test/integration/draco.test.js +30 -0
- package/Meshes/Compression/test/integration/draco.test.js.map +1 -0
- package/Meshes/csg.js +4 -0
- package/Meshes/csg.js.map +1 -1
- package/Meshes/transformNode.d.ts +4 -1
- package/Meshes/transformNode.js +4 -1
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/copyTextureToTexture.js +1 -1
- package/Misc/copyTextureToTexture.js.map +1 -1
- package/Misc/screenshotTools.js +58 -5
- package/Misc/screenshotTools.js.map +1 -1
- package/Misc/tools.d.ts +21 -1
- package/Misc/tools.js +33 -0
- package/Misc/tools.js.map +1 -1
- package/Particles/particleHelper.js +2 -1
- package/Particles/particleHelper.js.map +1 -1
- package/Particles/particleSystemSet.d.ts +1 -0
- package/Particles/particleSystemSet.js +1 -0
- package/Particles/particleSystemSet.js.map +1 -1
- package/Particles/webgl2ParticleSystem.d.ts +1 -1
- package/Particles/webgl2ParticleSystem.js +1 -2
- package/Particles/webgl2ParticleSystem.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +2 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
- package/Rendering/depthRenderer.js +1 -1
- package/Rendering/depthRenderer.js.map +1 -1
- package/Rendering/objectRenderer.d.ts +5 -3
- package/Rendering/objectRenderer.js +5 -3
- package/Rendering/objectRenderer.js.map +1 -1
- package/Rendering/renderingManager.d.ts +4 -0
- package/Rendering/renderingManager.js +1 -0
- package/Rendering/renderingManager.js.map +1 -1
- package/Shaders/ShadersInclude/intersectionFunctions.d.ts +5 -0
- package/Shaders/ShadersInclude/intersectionFunctions.js +14 -0
- package/Shaders/ShadersInclude/intersectionFunctions.js.map +1 -0
- package/Shaders/background.fragment.d.ts +1 -0
- package/Shaders/background.fragment.js +3 -5
- package/Shaders/background.fragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/intersectionFunctions.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/intersectionFunctions.js +14 -0
- package/ShadersWGSL/ShadersInclude/intersectionFunctions.js.map +1 -0
- package/ShadersWGSL/background.fragment.d.ts +1 -0
- package/ShadersWGSL/background.fragment.js +3 -5
- package/ShadersWGSL/background.fragment.js.map +1 -1
- package/XR/features/WebXRHandTracking.js +8 -7
- package/XR/features/WebXRHandTracking.js.map +1 -1
- package/package.json +1 -1
- package/types.d.ts +4 -0
- package/types.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeRenderGraphBlock.js","sourceRoot":"","sources":["../../../../../dev/core/src/FrameGraph/Node/nodeRenderGraphBlock.ts"],"names":[],"mappings":";AAYA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,wCAAwC,EAA2C,MAAM,8BAA8B,CAAC;AACjI,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,8BAA8B,EAAE,MAAM,uCAAuC,CAAC;AAEvF;;GAEG;AACH,MAAM,OAAO,oBAAoB;IAa7B;;OAEG;IACH,IAAW,QAAQ;QACf,OAAO,CAAC,CAAC,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC;IAC5C,CAAC;IAED,IAAW,QAAQ,CAAC,KAAc;QAC9B,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,eAAe,CAAC,QAAQ,GA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,IAAI,CAAC,MAAM,CAAC,CAAC;YACvD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;YACxC,OAAO,KAAK,CAAC;QACjB,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;OAEG;IACI,OAAO;QACV,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAC9B,KAAK,CAAC,OAAO,EAAE,CAAC;QACpB,CAAC;QAED,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAChC,MAAM,CAAC,OAAO,EAAE,CAAC;QACrB,CAAC;QAED,IAAI,CAAC,eAAe,EAAE,OAAO,EAAE,CAAC;QAChC,IAAI,CAAC,eAAe,GAAG,SAAgB,CAAC;QAExC,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAC;IACnC,CAAC;CACJ;AAhgBU;IADN,SAAS,CAAC,SAAS,CAAC;sDACG","sourcesContent":["import type {\r\n NodeRenderGraphBuildState,\r\n Nullable,\r\n NodeRenderGraphInputBlock,\r\n AbstractEngine,\r\n Scene,\r\n FrameGraphTask,\r\n FrameGraph,\r\n NodeRenderGraphResourceContainerBlock,\r\n FrameGraphTextureHandle,\r\n // eslint-disable-next-line import/no-internal-modules\r\n} from \"core/index\";\r\nimport { GetClass } from \"../../Misc/typeStore\";\r\nimport { serialize } from \"../../Misc/decorators\";\r\nimport { UniqueIdGenerator } from \"../../Misc/uniqueIdGenerator\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes, NodeRenderGraphConnectionPointDirection } from \"./Types/nodeRenderGraphTypes\";\r\nimport { Observable } from \"../../Misc/observable\";\r\nimport { Logger } from \"../../Misc/logger\";\r\nimport { NodeRenderGraphConnectionPoint } from \"./nodeRenderGraphBlockConnectionPoint\";\r\n\r\n/**\r\n * Defines a block that can be used inside a node render graph\r\n */\r\nexport class NodeRenderGraphBlock {\r\n private _name = \"\";\r\n private _buildId: number;\r\n protected _isInput = false;\r\n protected _isTeleportOut = false;\r\n protected _isTeleportIn = false;\r\n protected _isDebug = false;\r\n protected _isUnique = false;\r\n protected _scene: Scene;\r\n protected _engine: AbstractEngine;\r\n protected _frameGraph: FrameGraph;\r\n protected _frameGraphTask?: FrameGraphTask;\r\n\r\n /**\r\n * Gets or sets the disable flag of the task associated with this block\r\n */\r\n public get disabled() {\r\n return !!this._frameGraphTask?.disabled;\r\n }\r\n\r\n public set disabled(value: boolean) {\r\n if (this._frameGraphTask) {\r\n this._frameGraphTask.disabled = value;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Gets an observable raised when the block is built\r\n */\r\n public onBuildObservable = new Observable<NodeRenderGraphBlock>();\r\n\r\n /** @internal */\r\n public _inputs = new Array<NodeRenderGraphConnectionPoint>();\r\n\r\n /** @internal */\r\n public _outputs = new Array<NodeRenderGraphConnectionPoint>();\r\n\r\n /** @internal */\r\n public _codeVariableName = \"\";\r\n\r\n /** @internal */\r\n public _additionalConstructionParameters: Nullable<unknown[]> = null;\r\n\r\n /**\r\n * Gets the list of input points\r\n */\r\n public get inputs(): NodeRenderGraphConnectionPoint[] {\r\n return this._inputs;\r\n }\r\n\r\n /** Gets the list of output points */\r\n public get outputs(): NodeRenderGraphConnectionPoint[] {\r\n return this._outputs;\r\n }\r\n\r\n /**\r\n * Gets or sets the unique id of the node\r\n */\r\n public uniqueId: number;\r\n\r\n /**\r\n * Gets or set the name of the block\r\n */\r\n public get name(): string {\r\n return this._name;\r\n }\r\n\r\n public set name(value: string) {\r\n this._name = value;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if this block is an input\r\n */\r\n public get isInput(): boolean {\r\n return this._isInput;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if this block is a teleport out\r\n */\r\n public get isTeleportOut(): boolean {\r\n return this._isTeleportOut;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if this block is a teleport in\r\n */\r\n public get isTeleportIn(): boolean {\r\n return this._isTeleportIn;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if this block is a debug block\r\n */\r\n public get isDebug(): boolean {\r\n return this._isDebug;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating that this block can only be used once per node render graph\r\n */\r\n public get isUnique() {\r\n return this._isUnique;\r\n }\r\n\r\n /**\r\n * A free comment about the block\r\n */\r\n @serialize(\"comment\")\r\n public comments: string;\r\n\r\n /** Gets or sets a boolean indicating that this input can be edited from a collapsed frame */\r\n public visibleOnFrame = false;\r\n\r\n /**\r\n * Gets the current class name e.g. \"NodeRenderGraphBlock\"\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"NodeRenderGraphBlock\";\r\n }\r\n\r\n protected _inputRename(name: string) {\r\n return name;\r\n }\r\n\r\n protected _outputRename(name: string) {\r\n return name;\r\n }\r\n\r\n /**\r\n * Checks if the current block is an ancestor of a given block\r\n * @param block defines the potential descendant block to check\r\n * @returns true if block is a descendant\r\n */\r\n public isAnAncestorOf(block: NodeRenderGraphBlock): boolean {\r\n for (const output of this._outputs) {\r\n if (!output.hasEndpoints) {\r\n continue;\r\n }\r\n\r\n for (const endpoint of output.endpoints) {\r\n if (endpoint.ownerBlock === block) {\r\n return true;\r\n }\r\n\r\n if (endpoint.ownerBlock.isAnAncestorOf(block)) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Checks if the current block is an ancestor of a given type\r\n * @param type defines the potential type to check\r\n * @returns true if block is a descendant\r\n */\r\n public isAnAncestorOfType(type: string): boolean {\r\n if (this.getClassName() === type) {\r\n return true;\r\n }\r\n\r\n for (const output of this._outputs) {\r\n if (!output.hasEndpoints) {\r\n continue;\r\n }\r\n\r\n for (const endpoint of output.endpoints) {\r\n if (endpoint.ownerBlock.isAnAncestorOfType(type)) {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Get the first descendant using a predicate\r\n * @param predicate defines the predicate to check\r\n * @returns descendant or null if none found\r\n */\r\n public getDescendantOfPredicate(predicate: (block: NodeRenderGraphBlock) => boolean): Nullable<NodeRenderGraphBlock> {\r\n if (predicate(this)) {\r\n return this;\r\n }\r\n\r\n for (const output of this._outputs) {\r\n if (!output.hasEndpoints) {\r\n continue;\r\n }\r\n\r\n for (const endpoint of output.endpoints) {\r\n const descendant = endpoint.ownerBlock.getDescendantOfPredicate(predicate);\r\n if (descendant) {\r\n return descendant;\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Creates a new NodeRenderGraphBlock\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 _additionalConstructionParameters defines additional parameters to pass to the block constructor\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene, ..._additionalConstructionParameters: unknown[]) {\r\n this._name = name;\r\n this._frameGraph = frameGraph;\r\n this._scene = scene;\r\n this._engine = scene.getEngine();\r\n this.uniqueId = UniqueIdGenerator.UniqueId;\r\n }\r\n\r\n /**\r\n * Register a new input. Must be called inside a block constructor\r\n * @param name defines the connection point name\r\n * @param type defines the connection point type\r\n * @param isOptional defines a boolean indicating that this input can be omitted\r\n * @param point an already created connection point. If not provided, create a new one\r\n * @returns the current block\r\n */\r\n public registerInput(name: string, type: NodeRenderGraphBlockConnectionPointTypes, isOptional: boolean = false, point?: NodeRenderGraphConnectionPoint) {\r\n point = point ?? new NodeRenderGraphConnectionPoint(name, this, NodeRenderGraphConnectionPointDirection.Input);\r\n point.type = type;\r\n point.isOptional = isOptional;\r\n\r\n this._inputs.push(point);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Register a new output. Must be called inside a block constructor\r\n * @param name defines the connection point name\r\n * @param type defines the connection point type\r\n * @param point an already created connection point. If not provided, create a new one\r\n * @returns the current block\r\n */\r\n public registerOutput(name: string, type: NodeRenderGraphBlockConnectionPointTypes, point?: NodeRenderGraphConnectionPoint) {\r\n point = point ?? new NodeRenderGraphConnectionPoint(name, this, NodeRenderGraphConnectionPointDirection.Output);\r\n point.type = type;\r\n\r\n this._outputs.push(point);\r\n\r\n return this;\r\n }\r\n\r\n protected _addDependenciesInput() {\r\n this.registerInput(\"dependencies\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n\r\n const dependencies = this.getInputByName(\"dependencies\")!;\r\n\r\n dependencies.addAcceptedConnectionPointTypes(\r\n NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer |\r\n NodeRenderGraphBlockConnectionPointTypes.ResourceContainer |\r\n NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator\r\n );\r\n\r\n return dependencies;\r\n }\r\n\r\n protected _buildBlock(_state: NodeRenderGraphBuildState) {\r\n // Empty. Must be defined by child nodes\r\n }\r\n\r\n protected _customBuildStep(_state: NodeRenderGraphBuildState): void {\r\n // Must be implemented by children\r\n }\r\n\r\n protected _propagateInputValueToOutput(inputConnectionPoint: NodeRenderGraphConnectionPoint, outputConnectionPoint: NodeRenderGraphConnectionPoint) {\r\n if (inputConnectionPoint.connectedPoint) {\r\n outputConnectionPoint.value = inputConnectionPoint.connectedPoint.value;\r\n }\r\n }\r\n\r\n /**\r\n * Build the current node and generate the vertex data\r\n * @param state defines the current generation state\r\n * @returns true if already built\r\n */\r\n public build(state: NodeRenderGraphBuildState): boolean {\r\n if (this._buildId === state.buildId) {\r\n return true;\r\n }\r\n\r\n this._buildId = state.buildId;\r\n\r\n // Check if \"parent\" blocks are compiled\r\n for (const input of this._inputs) {\r\n if (!input.connectedPoint) {\r\n if (!input.isOptional) {\r\n // Emit a warning\r\n state._notConnectedNonOptionalInputs.push(input);\r\n }\r\n continue;\r\n }\r\n\r\n const block = input.connectedPoint.ownerBlock;\r\n if (block && block !== this) {\r\n block.build(state);\r\n }\r\n }\r\n\r\n this._customBuildStep(state);\r\n\r\n // Logs\r\n if (state.verbose) {\r\n Logger.Log(`Building ${this.name} [${this.getClassName()}]`);\r\n }\r\n\r\n if (this._frameGraphTask) {\r\n this._frameGraphTask.name = this.name;\r\n }\r\n\r\n this._buildBlock(state);\r\n\r\n if (this._frameGraphTask) {\r\n const dependenciesConnectedPoint = this.getInputByName(\"dependencies\")?.connectedPoint;\r\n if (dependenciesConnectedPoint) {\r\n if (dependenciesConnectedPoint.type === NodeRenderGraphBlockConnectionPointTypes.ResourceContainer) {\r\n const container = dependenciesConnectedPoint.ownerBlock as NodeRenderGraphResourceContainerBlock;\r\n for (let i = 0; i < container.inputs.length; i++) {\r\n const input = container.inputs[i];\r\n if (input.connectedPoint && input.connectedPoint.value !== undefined && NodeRenderGraphConnectionPoint.IsTextureHandle(input.connectedPoint.value)) {\r\n this._frameGraphTask.dependencies = this._frameGraphTask.dependencies || [];\r\n this._frameGraphTask.dependencies.push(input.connectedPoint.value as FrameGraphTextureHandle);\r\n }\r\n }\r\n } else if (NodeRenderGraphConnectionPoint.IsTextureHandle(dependenciesConnectedPoint.value)) {\r\n this._frameGraphTask.dependencies = this._frameGraphTask.dependencies || [];\r\n this._frameGraphTask.dependencies[0] = dependenciesConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n }\r\n this._frameGraph.addTask(this._frameGraphTask);\r\n }\r\n\r\n this.onBuildObservable.notifyObservers(this);\r\n\r\n return false;\r\n }\r\n\r\n protected _linkConnectionTypes(inputIndex0: number, inputIndex1: number, looseCoupling = false) {\r\n if (looseCoupling) {\r\n this._inputs[inputIndex1]._acceptedConnectionPointType = this._inputs[inputIndex0];\r\n } else {\r\n this._inputs[inputIndex0]._linkedConnectionSource = this._inputs[inputIndex1];\r\n this._inputs[inputIndex0]._isMainLinkSource = true;\r\n }\r\n\r\n this._inputs[inputIndex1]._linkedConnectionSource = this._inputs[inputIndex0];\r\n }\r\n\r\n /**\r\n * Initialize the block and prepare the context for build\r\n */\r\n public initialize() {\r\n // Do nothing\r\n }\r\n\r\n /**\r\n * Lets the block try to connect some inputs automatically\r\n */\r\n public autoConfigure() {\r\n // Do nothing\r\n }\r\n\r\n /**\r\n * Find an input by its name\r\n * @param name defines the name of the input to look for\r\n * @returns the input or null if not found\r\n */\r\n public getInputByName(name: string) {\r\n const filter = this._inputs.filter((e) => e.name === name);\r\n\r\n if (filter.length) {\r\n return filter[0];\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Find an output by its name\r\n * @param name defines the name of the output to look for\r\n * @returns the output or null if not found\r\n */\r\n public getOutputByName(name: string) {\r\n const filter = this._outputs.filter((e) => e.name === name);\r\n\r\n if (filter.length) {\r\n return filter[0];\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public serialize(): any {\r\n const serializationObject: any = {};\r\n\r\n serializationObject.customType = \"BABYLON.\" + this.getClassName();\r\n serializationObject.id = this.uniqueId;\r\n serializationObject.name = this.name;\r\n serializationObject.visibleOnFrame = this.visibleOnFrame;\r\n serializationObject.disabled = this.disabled;\r\n if (this._additionalConstructionParameters) {\r\n serializationObject.additionalConstructionParameters = this._additionalConstructionParameters;\r\n }\r\n\r\n serializationObject.inputs = [];\r\n serializationObject.outputs = [];\r\n\r\n for (const input of this.inputs) {\r\n serializationObject.inputs.push(input.serialize());\r\n }\r\n\r\n for (const output of this.outputs) {\r\n serializationObject.outputs.push(output.serialize(false));\r\n }\r\n\r\n return serializationObject;\r\n }\r\n /**\r\n * @internal\r\n */\r\n public _deserialize(serializationObject: any) {\r\n this._name = serializationObject.name;\r\n this.comments = serializationObject.comments;\r\n this.visibleOnFrame = serializationObject.visibleOnFrame;\r\n this.disabled = serializationObject.disabled;\r\n\r\n this._deserializePortDisplayNamesAndExposedOnFrame(serializationObject);\r\n }\r\n\r\n private _deserializePortDisplayNamesAndExposedOnFrame(serializationObject: any) {\r\n const serializedInputs = serializationObject.inputs;\r\n const serializedOutputs = serializationObject.outputs;\r\n\r\n if (serializedInputs) {\r\n serializedInputs.forEach((port: any) => {\r\n const input = this.inputs.find((i) => i.name === port.name);\r\n if (!input) {\r\n return;\r\n }\r\n if (port.displayName) {\r\n input.displayName = port.displayName;\r\n }\r\n if (port.isExposedOnFrame) {\r\n input.isExposedOnFrame = port.isExposedOnFrame;\r\n input.exposedPortPosition = port.exposedPortPosition;\r\n }\r\n });\r\n }\r\n\r\n if (serializedOutputs) {\r\n serializedOutputs.forEach((port: any, i: number) => {\r\n if (port.displayName) {\r\n this.outputs[i].displayName = port.displayName;\r\n }\r\n if (port.isExposedOnFrame) {\r\n this.outputs[i].isExposedOnFrame = port.isExposedOnFrame;\r\n this.outputs[i].exposedPortPosition = port.exposedPortPosition;\r\n }\r\n });\r\n }\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n const variableName = this._codeVariableName;\r\n return `${variableName}.visibleOnFrame = ${this.visibleOnFrame};\\n${variableName}.disabled = ${this.disabled};\\n`;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _dumpCodeForOutputConnections(alreadyDumped: NodeRenderGraphBlock[]) {\r\n let codeString = \"\";\r\n\r\n if (alreadyDumped.indexOf(this) !== -1) {\r\n return codeString;\r\n }\r\n\r\n alreadyDumped.push(this);\r\n\r\n for (const input of this.inputs) {\r\n if (!input.isConnected) {\r\n continue;\r\n }\r\n\r\n const connectedOutput = input.connectedPoint!;\r\n const connectedBlock = connectedOutput.ownerBlock;\r\n\r\n codeString += connectedBlock._dumpCodeForOutputConnections(alreadyDumped);\r\n codeString += `${connectedBlock._codeVariableName}.${connectedBlock._outputRename(connectedOutput.name)}.connectTo(${this._codeVariableName}.${this._inputRename(\r\n input.name\r\n )});\\n`;\r\n }\r\n\r\n return codeString;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _dumpCode(uniqueNames: string[], alreadyDumped: NodeRenderGraphBlock[]) {\r\n alreadyDumped.push(this);\r\n\r\n // Get unique name\r\n const nameAsVariableName = this.name.replace(/[^A-Za-z_]+/g, \"\");\r\n this._codeVariableName = nameAsVariableName || `${this.getClassName()}_${this.uniqueId}`;\r\n\r\n if (uniqueNames.indexOf(this._codeVariableName) !== -1) {\r\n let index = 0;\r\n do {\r\n index++;\r\n this._codeVariableName = nameAsVariableName + index;\r\n } while (uniqueNames.indexOf(this._codeVariableName) !== -1);\r\n }\r\n\r\n uniqueNames.push(this._codeVariableName);\r\n\r\n // Declaration\r\n let codeString = `\\n// ${this.getClassName()}\\n`;\r\n if (this.comments) {\r\n codeString += `// ${this.comments}\\n`;\r\n }\r\n const className = this.getClassName();\r\n if (className === \"RenderGraphInputBlock\") {\r\n const block = this as unknown as NodeRenderGraphInputBlock;\r\n const blockType = block.type;\r\n\r\n codeString += `var ${this._codeVariableName} = new BABYLON.NodeRenderGraphInputBlock(\"${this.name}\", nodeRenderGraph.frameGraph, scene, BABYLON.NodeRenderGraphBlockConnectionPointTypes.${NodeRenderGraphBlockConnectionPointTypes[blockType]});\\n`;\r\n } else {\r\n if (this._additionalConstructionParameters) {\r\n codeString += `var ${this._codeVariableName} = new BABYLON.${className}(\"${this.name}\", nodeRenderGraph.frameGraph, scene, ...${JSON.stringify(this._additionalConstructionParameters)});\\n`;\r\n } else {\r\n codeString += `var ${this._codeVariableName} = new BABYLON.${className}(\"${this.name}\", nodeRenderGraph.frameGraph, scene);\\n`;\r\n }\r\n }\r\n\r\n // Properties\r\n codeString += this._dumpPropertiesCode() + \"\\n\";\r\n\r\n // Inputs\r\n for (const input of this.inputs) {\r\n if (!input.isConnected) {\r\n continue;\r\n }\r\n\r\n const connectedOutput = input.connectedPoint!;\r\n const connectedBlock = connectedOutput.ownerBlock;\r\n\r\n if (alreadyDumped.indexOf(connectedBlock) === -1) {\r\n codeString += connectedBlock._dumpCode(uniqueNames, alreadyDumped);\r\n }\r\n }\r\n\r\n // Outputs\r\n for (const output of this.outputs) {\r\n if (!output.hasEndpoints) {\r\n continue;\r\n }\r\n\r\n for (const endpoint of output.endpoints) {\r\n const connectedBlock = endpoint.ownerBlock;\r\n if (connectedBlock && alreadyDumped.indexOf(connectedBlock) === -1) {\r\n codeString += connectedBlock._dumpCode(uniqueNames, alreadyDumped);\r\n }\r\n }\r\n }\r\n\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Clone the current block to a new identical block\r\n * @returns a copy of the current block\r\n */\r\n public clone() {\r\n const serializationObject = this.serialize();\r\n const blockType: typeof NodeRenderGraphBlock = GetClass(serializationObject.customType);\r\n\r\n if (blockType) {\r\n const additionalConstructionParameters = serializationObject.additionalConstructionParameters;\r\n const block: NodeRenderGraphBlock = additionalConstructionParameters\r\n ? new blockType(\"\", this._frameGraph, this._scene, ...additionalConstructionParameters)\r\n : new blockType(\"\", this._frameGraph, this._scene);\r\n block._deserialize(serializationObject);\r\n return block;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Release resources\r\n */\r\n public dispose() {\r\n for (const input of this.inputs) {\r\n input.dispose();\r\n }\r\n\r\n for (const output of this.outputs) {\r\n output.dispose();\r\n }\r\n\r\n this._frameGraphTask?.dispose();\r\n this._frameGraphTask = undefined as any;\r\n\r\n this.onBuildObservable.clear();\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"nodeRenderGraphBlock.js","sourceRoot":"","sources":["../../../../../dev/core/src/FrameGraph/Node/nodeRenderGraphBlock.ts"],"names":[],"mappings":";AAYA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,wCAAwC,EAA2C,MAAM,8BAA8B,CAAC;AACjI,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,8BAA8B,EAAE,MAAM,uCAAuC,CAAC;AAEvF;;GAEG;AACH,MAAM,OAAO,oBAAoB;IAa7B;;OAEG;IACH,IA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,MAAM,KAAK,GAAyB,gCAAgC;gBAChE,CAAC,CAAC,IAAI,SAAS,CAAC,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,gCAAgC,CAAC;gBACvF,CAAC,CAAC,IAAI,SAAS,CAAC,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YACvD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;YACxC,OAAO,KAAK,CAAC;QACjB,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;OAEG;IACI,OAAO;QACV,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAC9B,KAAK,CAAC,OAAO,EAAE,CAAC;QACpB,CAAC;QAED,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAChC,MAAM,CAAC,OAAO,EAAE,CAAC;QACrB,CAAC;QAED,IAAI,CAAC,eAAe,EAAE,OAAO,EAAE,CAAC;QAChC,IAAI,CAAC,eAAe,GAAG,SAAgB,CAAC;QAExC,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAC;IACnC,CAAC;CACJ;AAhgBU;IADN,SAAS,CAAC,SAAS,CAAC;sDACG","sourcesContent":["import type {\r\n NodeRenderGraphBuildState,\r\n Nullable,\r\n NodeRenderGraphInputBlock,\r\n AbstractEngine,\r\n Scene,\r\n FrameGraphTask,\r\n FrameGraph,\r\n NodeRenderGraphResourceContainerBlock,\r\n FrameGraphTextureHandle,\r\n // eslint-disable-next-line import/no-internal-modules\r\n} from \"core/index\";\r\nimport { GetClass } from \"../../Misc/typeStore\";\r\nimport { serialize } from \"../../Misc/decorators\";\r\nimport { UniqueIdGenerator } from \"../../Misc/uniqueIdGenerator\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes, NodeRenderGraphConnectionPointDirection } from \"./Types/nodeRenderGraphTypes\";\r\nimport { Observable } from \"../../Misc/observable\";\r\nimport { Logger } from \"../../Misc/logger\";\r\nimport { NodeRenderGraphConnectionPoint } from \"./nodeRenderGraphBlockConnectionPoint\";\r\n\r\n/**\r\n * Defines a block that can be used inside a node render graph\r\n */\r\nexport class NodeRenderGraphBlock {\r\n private _name = \"\";\r\n private _buildId: number;\r\n protected _isInput = false;\r\n protected _isTeleportOut = false;\r\n protected _isTeleportIn = false;\r\n protected _isDebug = false;\r\n protected _isUnique = false;\r\n protected _scene: Scene;\r\n protected _engine: AbstractEngine;\r\n protected _frameGraph: FrameGraph;\r\n protected _frameGraphTask?: FrameGraphTask;\r\n\r\n /**\r\n * Gets or sets the disable flag of the task associated with this block\r\n */\r\n public get disabled() {\r\n return !!this._frameGraphTask?.disabled;\r\n }\r\n\r\n public set disabled(value: boolean) {\r\n if (this._frameGraphTask) {\r\n this._frameGraphTask.disabled = value;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Gets an observable raised when the block is built\r\n */\r\n public onBuildObservable = new Observable<NodeRenderGraphBlock>();\r\n\r\n /** @internal */\r\n public _inputs = new Array<NodeRenderGraphConnectionPoint>();\r\n\r\n /** @internal */\r\n public _outputs = new Array<NodeRenderGraphConnectionPoint>();\r\n\r\n /** @internal */\r\n public _codeVariableName = \"\";\r\n\r\n /** @internal */\r\n public _additionalConstructionParameters: Nullable<unknown[]> = null;\r\n\r\n /**\r\n * Gets the list of input points\r\n */\r\n public get inputs(): NodeRenderGraphConnectionPoint[] {\r\n return this._inputs;\r\n }\r\n\r\n /** Gets the list of output points */\r\n public get outputs(): NodeRenderGraphConnectionPoint[] {\r\n return this._outputs;\r\n }\r\n\r\n /**\r\n * Gets or sets the unique id of the node\r\n */\r\n public uniqueId: number;\r\n\r\n /**\r\n * Gets or set the name of the block\r\n */\r\n public get name(): string {\r\n return this._name;\r\n }\r\n\r\n public set name(value: string) {\r\n this._name = value;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if this block is an input\r\n */\r\n public get isInput(): boolean {\r\n return this._isInput;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if this block is a teleport out\r\n */\r\n public get isTeleportOut(): boolean {\r\n return this._isTeleportOut;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if this block is a teleport in\r\n */\r\n public get isTeleportIn(): boolean {\r\n return this._isTeleportIn;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if this block is a debug block\r\n */\r\n public get isDebug(): boolean {\r\n return this._isDebug;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating that this block can only be used once per node render graph\r\n */\r\n public get isUnique() {\r\n return this._isUnique;\r\n }\r\n\r\n /**\r\n * A free comment about the block\r\n */\r\n @serialize(\"comment\")\r\n public comments: string;\r\n\r\n /** Gets or sets a boolean indicating that this input can be edited from a collapsed frame */\r\n public visibleOnFrame = false;\r\n\r\n /**\r\n * Gets the current class name e.g. \"NodeRenderGraphBlock\"\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"NodeRenderGraphBlock\";\r\n }\r\n\r\n protected _inputRename(name: string) {\r\n return name;\r\n }\r\n\r\n protected _outputRename(name: string) {\r\n return name;\r\n }\r\n\r\n /**\r\n * Checks if the current block is an ancestor of a given block\r\n * @param block defines the potential descendant block to check\r\n * @returns true if block is a descendant\r\n */\r\n public isAnAncestorOf(block: NodeRenderGraphBlock): boolean {\r\n for (const output of this._outputs) {\r\n if (!output.hasEndpoints) {\r\n continue;\r\n }\r\n\r\n for (const endpoint of output.endpoints) {\r\n if (endpoint.ownerBlock === block) {\r\n return true;\r\n }\r\n\r\n if (endpoint.ownerBlock.isAnAncestorOf(block)) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Checks if the current block is an ancestor of a given type\r\n * @param type defines the potential type to check\r\n * @returns true if block is a descendant\r\n */\r\n public isAnAncestorOfType(type: string): boolean {\r\n if (this.getClassName() === type) {\r\n return true;\r\n }\r\n\r\n for (const output of this._outputs) {\r\n if (!output.hasEndpoints) {\r\n continue;\r\n }\r\n\r\n for (const endpoint of output.endpoints) {\r\n if (endpoint.ownerBlock.isAnAncestorOfType(type)) {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Get the first descendant using a predicate\r\n * @param predicate defines the predicate to check\r\n * @returns descendant or null if none found\r\n */\r\n public getDescendantOfPredicate(predicate: (block: NodeRenderGraphBlock) => boolean): Nullable<NodeRenderGraphBlock> {\r\n if (predicate(this)) {\r\n return this;\r\n }\r\n\r\n for (const output of this._outputs) {\r\n if (!output.hasEndpoints) {\r\n continue;\r\n }\r\n\r\n for (const endpoint of output.endpoints) {\r\n const descendant = endpoint.ownerBlock.getDescendantOfPredicate(predicate);\r\n if (descendant) {\r\n return descendant;\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Creates a new NodeRenderGraphBlock\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 _additionalConstructionParameters defines additional parameters to pass to the block constructor\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene, ..._additionalConstructionParameters: unknown[]) {\r\n this._name = name;\r\n this._frameGraph = frameGraph;\r\n this._scene = scene;\r\n this._engine = scene.getEngine();\r\n this.uniqueId = UniqueIdGenerator.UniqueId;\r\n }\r\n\r\n /**\r\n * Register a new input. Must be called inside a block constructor\r\n * @param name defines the connection point name\r\n * @param type defines the connection point type\r\n * @param isOptional defines a boolean indicating that this input can be omitted\r\n * @param point an already created connection point. If not provided, create a new one\r\n * @returns the current block\r\n */\r\n public registerInput(name: string, type: NodeRenderGraphBlockConnectionPointTypes, isOptional: boolean = false, point?: NodeRenderGraphConnectionPoint) {\r\n point = point ?? new NodeRenderGraphConnectionPoint(name, this, NodeRenderGraphConnectionPointDirection.Input);\r\n point.type = type;\r\n point.isOptional = isOptional;\r\n\r\n this._inputs.push(point);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Register a new output. Must be called inside a block constructor\r\n * @param name defines the connection point name\r\n * @param type defines the connection point type\r\n * @param point an already created connection point. If not provided, create a new one\r\n * @returns the current block\r\n */\r\n public registerOutput(name: string, type: NodeRenderGraphBlockConnectionPointTypes, point?: NodeRenderGraphConnectionPoint) {\r\n point = point ?? new NodeRenderGraphConnectionPoint(name, this, NodeRenderGraphConnectionPointDirection.Output);\r\n point.type = type;\r\n\r\n this._outputs.push(point);\r\n\r\n return this;\r\n }\r\n\r\n protected _addDependenciesInput() {\r\n this.registerInput(\"dependencies\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n\r\n const dependencies = this.getInputByName(\"dependencies\")!;\r\n\r\n dependencies.addAcceptedConnectionPointTypes(\r\n NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer |\r\n NodeRenderGraphBlockConnectionPointTypes.ResourceContainer |\r\n NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator\r\n );\r\n\r\n return dependencies;\r\n }\r\n\r\n protected _buildBlock(_state: NodeRenderGraphBuildState) {\r\n // Empty. Must be defined by child nodes\r\n }\r\n\r\n protected _customBuildStep(_state: NodeRenderGraphBuildState): void {\r\n // Must be implemented by children\r\n }\r\n\r\n protected _propagateInputValueToOutput(inputConnectionPoint: NodeRenderGraphConnectionPoint, outputConnectionPoint: NodeRenderGraphConnectionPoint) {\r\n if (inputConnectionPoint.connectedPoint) {\r\n outputConnectionPoint.value = inputConnectionPoint.connectedPoint.value;\r\n }\r\n }\r\n\r\n /**\r\n * Build the current node and generate the vertex data\r\n * @param state defines the current generation state\r\n * @returns true if already built\r\n */\r\n public build(state: NodeRenderGraphBuildState): boolean {\r\n if (this._buildId === state.buildId) {\r\n return true;\r\n }\r\n\r\n this._buildId = state.buildId;\r\n\r\n // Check if \"parent\" blocks are compiled\r\n for (const input of this._inputs) {\r\n if (!input.connectedPoint) {\r\n if (!input.isOptional) {\r\n // Emit a warning\r\n state._notConnectedNonOptionalInputs.push(input);\r\n }\r\n continue;\r\n }\r\n\r\n const block = input.connectedPoint.ownerBlock;\r\n if (block && block !== this) {\r\n block.build(state);\r\n }\r\n }\r\n\r\n this._customBuildStep(state);\r\n\r\n // Logs\r\n if (state.verbose) {\r\n Logger.Log(`Building ${this.name} [${this.getClassName()}]`);\r\n }\r\n\r\n if (this._frameGraphTask) {\r\n this._frameGraphTask.name = this.name;\r\n }\r\n\r\n this._buildBlock(state);\r\n\r\n if (this._frameGraphTask) {\r\n const dependenciesConnectedPoint = this.getInputByName(\"dependencies\")?.connectedPoint;\r\n if (dependenciesConnectedPoint) {\r\n if (dependenciesConnectedPoint.type === NodeRenderGraphBlockConnectionPointTypes.ResourceContainer) {\r\n const container = dependenciesConnectedPoint.ownerBlock as NodeRenderGraphResourceContainerBlock;\r\n for (let i = 0; i < container.inputs.length; i++) {\r\n const input = container.inputs[i];\r\n if (input.connectedPoint && input.connectedPoint.value !== undefined && NodeRenderGraphConnectionPoint.IsTextureHandle(input.connectedPoint.value)) {\r\n this._frameGraphTask.dependencies = this._frameGraphTask.dependencies || new Set();\r\n this._frameGraphTask.dependencies.add(input.connectedPoint.value as FrameGraphTextureHandle);\r\n }\r\n }\r\n } else if (NodeRenderGraphConnectionPoint.IsTextureHandle(dependenciesConnectedPoint.value)) {\r\n this._frameGraphTask.dependencies = this._frameGraphTask.dependencies || new Set();\r\n this._frameGraphTask.dependencies.add(dependenciesConnectedPoint.value as FrameGraphTextureHandle);\r\n }\r\n }\r\n this._frameGraph.addTask(this._frameGraphTask);\r\n }\r\n\r\n this.onBuildObservable.notifyObservers(this);\r\n\r\n return false;\r\n }\r\n\r\n protected _linkConnectionTypes(inputIndex0: number, inputIndex1: number, looseCoupling = false) {\r\n if (looseCoupling) {\r\n this._inputs[inputIndex1]._acceptedConnectionPointType = this._inputs[inputIndex0];\r\n } else {\r\n this._inputs[inputIndex0]._linkedConnectionSource = this._inputs[inputIndex1];\r\n this._inputs[inputIndex0]._isMainLinkSource = true;\r\n }\r\n\r\n this._inputs[inputIndex1]._linkedConnectionSource = this._inputs[inputIndex0];\r\n }\r\n\r\n /**\r\n * Initialize the block and prepare the context for build\r\n */\r\n public initialize() {\r\n // Do nothing\r\n }\r\n\r\n /**\r\n * Lets the block try to connect some inputs automatically\r\n */\r\n public autoConfigure() {\r\n // Do nothing\r\n }\r\n\r\n /**\r\n * Find an input by its name\r\n * @param name defines the name of the input to look for\r\n * @returns the input or null if not found\r\n */\r\n public getInputByName(name: string) {\r\n const filter = this._inputs.filter((e) => e.name === name);\r\n\r\n if (filter.length) {\r\n return filter[0];\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Find an output by its name\r\n * @param name defines the name of the output to look for\r\n * @returns the output or null if not found\r\n */\r\n public getOutputByName(name: string) {\r\n const filter = this._outputs.filter((e) => e.name === name);\r\n\r\n if (filter.length) {\r\n return filter[0];\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public serialize(): any {\r\n const serializationObject: any = {};\r\n\r\n serializationObject.customType = \"BABYLON.\" + this.getClassName();\r\n serializationObject.id = this.uniqueId;\r\n serializationObject.name = this.name;\r\n serializationObject.visibleOnFrame = this.visibleOnFrame;\r\n serializationObject.disabled = this.disabled;\r\n if (this._additionalConstructionParameters) {\r\n serializationObject.additionalConstructionParameters = this._additionalConstructionParameters;\r\n }\r\n\r\n serializationObject.inputs = [];\r\n serializationObject.outputs = [];\r\n\r\n for (const input of this.inputs) {\r\n serializationObject.inputs.push(input.serialize());\r\n }\r\n\r\n for (const output of this.outputs) {\r\n serializationObject.outputs.push(output.serialize(false));\r\n }\r\n\r\n return serializationObject;\r\n }\r\n /**\r\n * @internal\r\n */\r\n public _deserialize(serializationObject: any) {\r\n this._name = serializationObject.name;\r\n this.comments = serializationObject.comments;\r\n this.visibleOnFrame = serializationObject.visibleOnFrame;\r\n this.disabled = serializationObject.disabled;\r\n\r\n this._deserializePortDisplayNamesAndExposedOnFrame(serializationObject);\r\n }\r\n\r\n private _deserializePortDisplayNamesAndExposedOnFrame(serializationObject: any) {\r\n const serializedInputs = serializationObject.inputs;\r\n const serializedOutputs = serializationObject.outputs;\r\n\r\n if (serializedInputs) {\r\n serializedInputs.forEach((port: any) => {\r\n const input = this.inputs.find((i) => i.name === port.name);\r\n if (!input) {\r\n return;\r\n }\r\n if (port.displayName) {\r\n input.displayName = port.displayName;\r\n }\r\n if (port.isExposedOnFrame) {\r\n input.isExposedOnFrame = port.isExposedOnFrame;\r\n input.exposedPortPosition = port.exposedPortPosition;\r\n }\r\n });\r\n }\r\n\r\n if (serializedOutputs) {\r\n serializedOutputs.forEach((port: any, i: number) => {\r\n if (port.displayName) {\r\n this.outputs[i].displayName = port.displayName;\r\n }\r\n if (port.isExposedOnFrame) {\r\n this.outputs[i].isExposedOnFrame = port.isExposedOnFrame;\r\n this.outputs[i].exposedPortPosition = port.exposedPortPosition;\r\n }\r\n });\r\n }\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n const variableName = this._codeVariableName;\r\n return `${variableName}.visibleOnFrame = ${this.visibleOnFrame};\\n${variableName}.disabled = ${this.disabled};\\n`;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _dumpCodeForOutputConnections(alreadyDumped: NodeRenderGraphBlock[]) {\r\n let codeString = \"\";\r\n\r\n if (alreadyDumped.indexOf(this) !== -1) {\r\n return codeString;\r\n }\r\n\r\n alreadyDumped.push(this);\r\n\r\n for (const input of this.inputs) {\r\n if (!input.isConnected) {\r\n continue;\r\n }\r\n\r\n const connectedOutput = input.connectedPoint!;\r\n const connectedBlock = connectedOutput.ownerBlock;\r\n\r\n codeString += connectedBlock._dumpCodeForOutputConnections(alreadyDumped);\r\n codeString += `${connectedBlock._codeVariableName}.${connectedBlock._outputRename(connectedOutput.name)}.connectTo(${this._codeVariableName}.${this._inputRename(\r\n input.name\r\n )});\\n`;\r\n }\r\n\r\n return codeString;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _dumpCode(uniqueNames: string[], alreadyDumped: NodeRenderGraphBlock[]) {\r\n alreadyDumped.push(this);\r\n\r\n // Get unique name\r\n const nameAsVariableName = this.name.replace(/[^A-Za-z_]+/g, \"\");\r\n this._codeVariableName = nameAsVariableName || `${this.getClassName()}_${this.uniqueId}`;\r\n\r\n if (uniqueNames.indexOf(this._codeVariableName) !== -1) {\r\n let index = 0;\r\n do {\r\n index++;\r\n this._codeVariableName = nameAsVariableName + index;\r\n } while (uniqueNames.indexOf(this._codeVariableName) !== -1);\r\n }\r\n\r\n uniqueNames.push(this._codeVariableName);\r\n\r\n // Declaration\r\n let codeString = `\\n// ${this.getClassName()}\\n`;\r\n if (this.comments) {\r\n codeString += `// ${this.comments}\\n`;\r\n }\r\n const className = this.getClassName();\r\n if (className === \"RenderGraphInputBlock\") {\r\n const block = this as unknown as NodeRenderGraphInputBlock;\r\n const blockType = block.type;\r\n\r\n codeString += `var ${this._codeVariableName} = new BABYLON.NodeRenderGraphInputBlock(\"${this.name}\", nodeRenderGraph.frameGraph, scene, BABYLON.NodeRenderGraphBlockConnectionPointTypes.${NodeRenderGraphBlockConnectionPointTypes[blockType]});\\n`;\r\n } else {\r\n if (this._additionalConstructionParameters) {\r\n codeString += `var ${this._codeVariableName} = new BABYLON.${className}(\"${this.name}\", nodeRenderGraph.frameGraph, scene, ...${JSON.stringify(this._additionalConstructionParameters)});\\n`;\r\n } else {\r\n codeString += `var ${this._codeVariableName} = new BABYLON.${className}(\"${this.name}\", nodeRenderGraph.frameGraph, scene);\\n`;\r\n }\r\n }\r\n\r\n // Properties\r\n codeString += this._dumpPropertiesCode() + \"\\n\";\r\n\r\n // Inputs\r\n for (const input of this.inputs) {\r\n if (!input.isConnected) {\r\n continue;\r\n }\r\n\r\n const connectedOutput = input.connectedPoint!;\r\n const connectedBlock = connectedOutput.ownerBlock;\r\n\r\n if (alreadyDumped.indexOf(connectedBlock) === -1) {\r\n codeString += connectedBlock._dumpCode(uniqueNames, alreadyDumped);\r\n }\r\n }\r\n\r\n // Outputs\r\n for (const output of this.outputs) {\r\n if (!output.hasEndpoints) {\r\n continue;\r\n }\r\n\r\n for (const endpoint of output.endpoints) {\r\n const connectedBlock = endpoint.ownerBlock;\r\n if (connectedBlock && alreadyDumped.indexOf(connectedBlock) === -1) {\r\n codeString += connectedBlock._dumpCode(uniqueNames, alreadyDumped);\r\n }\r\n }\r\n }\r\n\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Clone the current block to a new identical block\r\n * @returns a copy of the current block\r\n */\r\n public clone() {\r\n const serializationObject = this.serialize();\r\n const blockType: typeof NodeRenderGraphBlock = GetClass(serializationObject.customType);\r\n\r\n if (blockType) {\r\n const additionalConstructionParameters = serializationObject.additionalConstructionParameters;\r\n const block: NodeRenderGraphBlock = additionalConstructionParameters\r\n ? new blockType(\"\", this._frameGraph, this._scene, ...additionalConstructionParameters)\r\n : new blockType(\"\", this._frameGraph, this._scene);\r\n block._deserialize(serializationObject);\r\n return block;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Release resources\r\n */\r\n public dispose() {\r\n for (const input of this.inputs) {\r\n input.dispose();\r\n }\r\n\r\n for (const output of this.outputs) {\r\n output.dispose();\r\n }\r\n\r\n this._frameGraphTask?.dispose();\r\n this._frameGraphTask = undefined as any;\r\n\r\n this.onBuildObservable.clear();\r\n }\r\n}\r\n"]}
|
|
@@ -44,6 +44,8 @@ export declare class NodeRenderGraphConnectionPoint {
|
|
|
44
44
|
* The value stored in this connection point
|
|
45
45
|
*/
|
|
46
46
|
value: NodeRenderGraphBlockConnectionPointValueType | undefined;
|
|
47
|
+
/** Indicates that this connection point needs dual validation before being connected to another point */
|
|
48
|
+
needDualDirectionValidation: boolean;
|
|
47
49
|
/**
|
|
48
50
|
* Gets or sets the additional types supported by this connection point
|
|
49
51
|
*/
|
|
@@ -103,6 +105,12 @@ export declare class NodeRenderGraphConnectionPoint {
|
|
|
103
105
|
get hasEndpoints(): boolean;
|
|
104
106
|
/** Get the inner type (ie AutoDetect for instance instead of the inferred one) */
|
|
105
107
|
get innerType(): NodeRenderGraphBlockConnectionPointTypes;
|
|
108
|
+
/**
|
|
109
|
+
* Creates a block suitable to be used as an input for this input point.
|
|
110
|
+
* If null is returned, a block based on the point type will be created.
|
|
111
|
+
* @returns The returned string parameter is the name of the output point of NodeRenderGraphBlock (first parameter of the returned array) that can be connected to the input
|
|
112
|
+
*/
|
|
113
|
+
createCustomInputBlock(): Nullable<[NodeRenderGraphBlock, string]>;
|
|
106
114
|
/**
|
|
107
115
|
* Creates a new connection point
|
|
108
116
|
* @param name defines the connection point name
|
|
@@ -115,6 +115,14 @@ export class NodeRenderGraphConnectionPoint {
|
|
|
115
115
|
}
|
|
116
116
|
return this._type;
|
|
117
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* Creates a block suitable to be used as an input for this input point.
|
|
120
|
+
* If null is returned, a block based on the point type will be created.
|
|
121
|
+
* @returns The returned string parameter is the name of the output point of NodeRenderGraphBlock (first parameter of the returned array) that can be connected to the input
|
|
122
|
+
*/
|
|
123
|
+
createCustomInputBlock() {
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
118
126
|
/**
|
|
119
127
|
* Creates a new connection point
|
|
120
128
|
* @param name defines the connection point name
|
|
@@ -135,6 +143,8 @@ export class NodeRenderGraphConnectionPoint {
|
|
|
135
143
|
this._typeConnectionSource = null;
|
|
136
144
|
/** @internal */
|
|
137
145
|
this._defaultConnectionPointType = null;
|
|
146
|
+
/** Indicates that this connection point needs dual validation before being connected to another point */
|
|
147
|
+
this.needDualDirectionValidation = false;
|
|
138
148
|
/**
|
|
139
149
|
* Gets or sets the additional types supported by this connection point
|
|
140
150
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeRenderGraphBlockConnectionPoint.js","sourceRoot":"","sources":["../../../../../dev/core/src/FrameGraph/Node/nodeRenderGra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IAAI,CAAC,cAAc,EAAE,CAAC;YACjC,mBAAmB,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC;YAC1C,mBAAmB,CAAC,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC;YAC5E,mBAAmB,CAAC,oBAAoB,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC;YACpE,mBAAmB,CAAC,gBAAgB,GAAG,IAAI,CAAC;YAC5C,mBAAmB,CAAC,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,CAAC;QACvE,CAAC;QAED,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,mBAAmB,IAAI,CAAC,EAAE,CAAC;YACzD,mBAAmB,CAAC,gBAAgB,GAAG,IAAI,CAAC;YAC5C,mBAAmB,CAAC,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,CAAC;QACvE,CAAC;QAED,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAED;;OAEG;IACI,OAAO;QACV,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,CAAC;QACpC,IAAI,CAAC,yBAAyB,CAAC,KAAK,EAAE,CAAC;IAC3C,CAAC;CACJ","sourcesContent":["import type {\r\n Nullable,\r\n NodeRenderGraphBlock,\r\n NodeRenderGraphBlockConnectionPointValueType,\r\n NodeRenderGraphInputBlock,\r\n IShadowLight,\r\n FrameGraphShadowGeneratorTask,\r\n // eslint-disable-next-line import/no-internal-modules\r\n} from \"core/index\";\r\nimport { Observable } from \"../../Misc/observable\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes, NodeRenderGraphConnectionPointCompatibilityStates, NodeRenderGraphConnectionPointDirection } from \"./Types/nodeRenderGraphTypes\";\r\n\r\n/**\r\n * Defines a connection point for a block\r\n */\r\nexport class NodeRenderGraphConnectionPoint {\r\n private readonly _ownerBlock: NodeRenderGraphBlock;\r\n private _connectedPoint: Nullable<NodeRenderGraphConnectionPoint> = null;\r\n\r\n /** @internal */\r\n public _acceptedConnectionPointType: Nullable<NodeRenderGraphConnectionPoint> = null;\r\n\r\n private _endpoints = new Array<NodeRenderGraphConnectionPoint>();\r\n private readonly _direction: NodeRenderGraphConnectionPointDirection;\r\n private _type = NodeRenderGraphBlockConnectionPointTypes.Undefined;\r\n\r\n /** @internal */\r\n public _linkedConnectionSource: Nullable<NodeRenderGraphConnectionPoint> = null;\r\n\r\n /** @internal */\r\n public _isMainLinkSource = false;\r\n\r\n /** @internal */\r\n public _typeConnectionSource: Nullable<NodeRenderGraphConnectionPoint | (() => NodeRenderGraphConnectionPoint)> = null;\r\n\r\n /** @internal */\r\n public _defaultConnectionPointType: Nullable<NodeRenderGraphBlockConnectionPointTypes> = null;\r\n\r\n /** Gets the direction of the point */\r\n public get direction() {\r\n return this._direction;\r\n }\r\n\r\n /**\r\n * Checks if the value is a texture handle\r\n * @param value The value to check\r\n * @returns True if the value is a texture handle\r\n */\r\n public static IsTextureHandle(value: NodeRenderGraphBlockConnectionPointValueType | undefined): boolean {\r\n return value !== undefined && Number.isFinite(value);\r\n }\r\n\r\n /**\r\n * Checks if the value is a shadow generator task\r\n * @param value The value to check\r\n * @returns True if the value is a shadow generator\r\n */\r\n public static IsShadowGenerator(value: NodeRenderGraphBlockConnectionPointValueType | undefined): boolean {\r\n return value !== undefined && (value as FrameGraphShadowGeneratorTask).mapSize !== undefined;\r\n }\r\n\r\n /**\r\n * Checks if the value is a shadow light\r\n * @param value The value to check\r\n * @returns True if the value is a shadow light\r\n */\r\n public static IsShadowLight(value: NodeRenderGraphBlockConnectionPointValueType | undefined): boolean {\r\n return value !== undefined && (value as IShadowLight).setShadowProjectionMatrix !== undefined;\r\n }\r\n\r\n /**\r\n * The value stored in this connection point\r\n */\r\n public value: NodeRenderGraphBlockConnectionPointValueType | undefined;\r\n\r\n /**\r\n * Gets or sets the additional types supported by this connection point\r\n */\r\n public acceptedConnectionPointTypes: NodeRenderGraphBlockConnectionPointTypes[] = [];\r\n\r\n /**\r\n * Gets or sets the additional types excluded by this connection point\r\n */\r\n public excludedConnectionPointTypes: NodeRenderGraphBlockConnectionPointTypes[] = [];\r\n\r\n /**\r\n * Observable triggered when this point is connected\r\n */\r\n public onConnectionObservable = new Observable<NodeRenderGraphConnectionPoint>();\r\n\r\n /**\r\n * Observable triggered when this point is disconnected\r\n */\r\n public onDisconnectionObservable = new Observable<NodeRenderGraphConnectionPoint>();\r\n\r\n /**\r\n * Gets or sets a boolean indicating that this connection point is exposed on a frame\r\n */\r\n public isExposedOnFrame: boolean = false;\r\n\r\n /**\r\n * Gets or sets number indicating the position that the port is exposed to on a frame\r\n */\r\n public exposedPortPosition: number = -1;\r\n\r\n /**\r\n * Gets or sets the connection point type (default is Undefined)\r\n */\r\n public get type(): NodeRenderGraphBlockConnectionPointTypes {\r\n if (this._type === NodeRenderGraphBlockConnectionPointTypes.AutoDetect) {\r\n if (this._ownerBlock.isInput) {\r\n return (this._ownerBlock as NodeRenderGraphInputBlock).type;\r\n }\r\n\r\n if (this._connectedPoint) {\r\n return this._connectedPoint.type;\r\n }\r\n\r\n if (this._linkedConnectionSource) {\r\n if (this._linkedConnectionSource.isConnected) {\r\n return this._linkedConnectionSource.type;\r\n }\r\n if (this._linkedConnectionSource._defaultConnectionPointType) {\r\n return this._linkedConnectionSource._defaultConnectionPointType;\r\n }\r\n }\r\n\r\n if (this._defaultConnectionPointType) {\r\n return this._defaultConnectionPointType;\r\n }\r\n }\r\n\r\n if (this._type === NodeRenderGraphBlockConnectionPointTypes.BasedOnInput) {\r\n if (this._typeConnectionSource) {\r\n const typeConnectionSource = typeof this._typeConnectionSource === \"function\" ? this._typeConnectionSource() : this._typeConnectionSource;\r\n if (!typeConnectionSource.isConnected) {\r\n return this._defaultConnectionPointType ?? typeConnectionSource.type;\r\n }\r\n return typeConnectionSource._connectedPoint!.type;\r\n } else if (this._defaultConnectionPointType) {\r\n return this._defaultConnectionPointType;\r\n }\r\n }\r\n\r\n return this._type;\r\n }\r\n\r\n public set type(value: NodeRenderGraphBlockConnectionPointTypes) {\r\n this._type = value;\r\n }\r\n\r\n /**\r\n * Gets or sets the connection point name\r\n */\r\n public name: string;\r\n\r\n /**\r\n * Gets or sets the connection point display name\r\n */\r\n public displayName: string;\r\n\r\n /**\r\n * Gets or sets a boolean indicating that this connection point can be omitted\r\n */\r\n public isOptional: boolean;\r\n\r\n /**\r\n * Gets a boolean indicating that the current point is connected to another NodeRenderGraphBlock\r\n */\r\n public get isConnected(): boolean {\r\n return this.connectedPoint !== null || this.hasEndpoints;\r\n }\r\n\r\n /** Get the other side of the connection (if any) */\r\n public get connectedPoint(): Nullable<NodeRenderGraphConnectionPoint> {\r\n return this._connectedPoint;\r\n }\r\n\r\n /** Get the block that owns this connection point */\r\n public get ownerBlock(): NodeRenderGraphBlock {\r\n return this._ownerBlock;\r\n }\r\n\r\n /** Get the block connected on the other side of this connection (if any) */\r\n public get sourceBlock(): Nullable<NodeRenderGraphBlock> {\r\n if (!this._connectedPoint) {\r\n return null;\r\n }\r\n\r\n return this._connectedPoint.ownerBlock;\r\n }\r\n\r\n /** Get the block connected on the endpoints of this connection (if any) */\r\n public get connectedBlocks(): Array<NodeRenderGraphBlock> {\r\n if (this._endpoints.length === 0) {\r\n return [];\r\n }\r\n\r\n return this._endpoints.map((e) => e.ownerBlock);\r\n }\r\n\r\n /** Gets the list of connected endpoints */\r\n public get endpoints() {\r\n return this._endpoints;\r\n }\r\n\r\n /** Gets a boolean indicating if that output point is connected to at least one input */\r\n public get hasEndpoints(): boolean {\r\n return this._endpoints && this._endpoints.length > 0;\r\n }\r\n\r\n /** Get the inner type (ie AutoDetect for instance instead of the inferred one) */\r\n public get innerType() {\r\n if (this._linkedConnectionSource && !this._isMainLinkSource && this._linkedConnectionSource.isConnected) {\r\n return this.type;\r\n }\r\n return this._type;\r\n }\r\n\r\n /**\r\n * Creates a new connection point\r\n * @param name defines the connection point name\r\n * @param ownerBlock defines the block hosting this connection point\r\n * @param direction defines the direction of the connection point\r\n */\r\n public constructor(name: string, ownerBlock: NodeRenderGraphBlock, direction: NodeRenderGraphConnectionPointDirection) {\r\n this._ownerBlock = ownerBlock;\r\n this.name = name;\r\n this._direction = direction;\r\n }\r\n\r\n /**\r\n * Gets the current class name e.g. \"NodeRenderGraphConnectionPoint\"\r\n * @returns the class name\r\n */\r\n public getClassName(): string {\r\n return \"NodeRenderGraphConnectionPoint\";\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if the current point can be connected to another point\r\n * @param connectionPoint defines the other connection point\r\n * @returns a boolean\r\n */\r\n public canConnectTo(connectionPoint: NodeRenderGraphConnectionPoint) {\r\n return this.checkCompatibilityState(connectionPoint) === NodeRenderGraphConnectionPointCompatibilityStates.Compatible;\r\n }\r\n\r\n /**\r\n * Gets a number indicating if the current point can be connected to another point\r\n * @param connectionPoint defines the other connection point\r\n * @returns a number defining the compatibility state\r\n */\r\n public checkCompatibilityState(connectionPoint: NodeRenderGraphConnectionPoint): NodeRenderGraphConnectionPointCompatibilityStates {\r\n const ownerBlock = this._ownerBlock;\r\n const otherBlock = connectionPoint.ownerBlock;\r\n\r\n if (this.type !== connectionPoint.type && connectionPoint.innerType !== NodeRenderGraphBlockConnectionPointTypes.AutoDetect) {\r\n // Accepted types\r\n if (connectionPoint.acceptedConnectionPointTypes && connectionPoint.acceptedConnectionPointTypes.indexOf(this.type) !== -1) {\r\n return NodeRenderGraphConnectionPointCompatibilityStates.Compatible;\r\n } else {\r\n return NodeRenderGraphConnectionPointCompatibilityStates.TypeIncompatible;\r\n }\r\n }\r\n\r\n // Excluded\r\n if (connectionPoint.excludedConnectionPointTypes && connectionPoint.excludedConnectionPointTypes.indexOf(this.type) !== -1) {\r\n return NodeRenderGraphConnectionPointCompatibilityStates.TypeIncompatible;\r\n }\r\n\r\n // Check hierarchy\r\n let targetBlock = otherBlock;\r\n let sourceBlock = ownerBlock;\r\n if (this.direction === NodeRenderGraphConnectionPointDirection.Input) {\r\n targetBlock = ownerBlock;\r\n sourceBlock = otherBlock;\r\n }\r\n\r\n if (targetBlock.isAnAncestorOf(sourceBlock)) {\r\n return NodeRenderGraphConnectionPointCompatibilityStates.HierarchyIssue;\r\n }\r\n\r\n return NodeRenderGraphConnectionPointCompatibilityStates.Compatible;\r\n }\r\n\r\n /**\r\n * Connect this point to another connection point\r\n * @param connectionPoint defines the other connection point\r\n * @param ignoreConstraints defines if the system will ignore connection type constraints (default is false)\r\n * @returns the current connection point\r\n */\r\n public connectTo(connectionPoint: NodeRenderGraphConnectionPoint, ignoreConstraints = false): NodeRenderGraphConnectionPoint {\r\n if (!ignoreConstraints && !this.canConnectTo(connectionPoint)) {\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"Cannot connect these two connectors.\";\r\n }\r\n\r\n this._endpoints.push(connectionPoint);\r\n connectionPoint._connectedPoint = this;\r\n\r\n this.onConnectionObservable.notifyObservers(connectionPoint);\r\n connectionPoint.onConnectionObservable.notifyObservers(this);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Disconnect this point from one of his endpoint\r\n * @param endpoint defines the other connection point\r\n * @returns the current connection point\r\n */\r\n public disconnectFrom(endpoint: NodeRenderGraphConnectionPoint): NodeRenderGraphConnectionPoint {\r\n const index = this._endpoints.indexOf(endpoint);\r\n\r\n if (index === -1) {\r\n return this;\r\n }\r\n\r\n this._endpoints.splice(index, 1);\r\n endpoint._connectedPoint = null;\r\n\r\n this.onDisconnectionObservable.notifyObservers(endpoint);\r\n endpoint.onDisconnectionObservable.notifyObservers(this);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Fills the list of excluded connection point types with all types other than those passed in the parameter\r\n * @param mask Types (ORed values of NodeRenderGraphBlockConnectionPointTypes) that are allowed, and thus will not be pushed to the excluded list\r\n */\r\n public addExcludedConnectionPointFromAllowedTypes(mask: number): void {\r\n let bitmask = 0;\r\n let val = 2 ** bitmask;\r\n // Note: don't use 1 << bitmask instead of 2 ** bitmask, as it will cause an infinite loop because 1 << 31 is negative!\r\n while (val < NodeRenderGraphBlockConnectionPointTypes.All) {\r\n if (!(mask & val)) {\r\n this.excludedConnectionPointTypes.push(val);\r\n }\r\n bitmask++;\r\n val = 2 ** bitmask;\r\n }\r\n }\r\n\r\n /**\r\n * Adds accepted connection point types\r\n * @param mask Types (ORed values of NodeRenderGraphBlockConnectionPointTypes) that are allowed to connect to this point\r\n */\r\n public addAcceptedConnectionPointTypes(mask: number): void {\r\n let bitmask = 0;\r\n let val = 2 ** bitmask;\r\n // Note: don't use 1 << bitmask instead of 2 ** bitmask, as it will cause an infinite loop because 1 << 31 is negative!\r\n while (val < NodeRenderGraphBlockConnectionPointTypes.All) {\r\n if (mask & val && this.acceptedConnectionPointTypes.indexOf(val) === -1) {\r\n this.acceptedConnectionPointTypes.push(val);\r\n }\r\n bitmask++;\r\n val = 2 ** bitmask;\r\n }\r\n }\r\n\r\n /**\r\n * Serializes this point in a JSON representation\r\n * @param isInput defines if the connection point is an input (default is true)\r\n * @returns the serialized point object\r\n */\r\n public serialize(isInput = true): any {\r\n const serializationObject: any = {};\r\n\r\n serializationObject.name = this.name;\r\n serializationObject.displayName = this.displayName;\r\n\r\n if (isInput && this.connectedPoint) {\r\n serializationObject.inputName = this.name;\r\n serializationObject.targetBlockId = this.connectedPoint.ownerBlock.uniqueId;\r\n serializationObject.targetConnectionName = this.connectedPoint.name;\r\n serializationObject.isExposedOnFrame = true;\r\n serializationObject.exposedPortPosition = this.exposedPortPosition;\r\n }\r\n\r\n if (this.isExposedOnFrame || this.exposedPortPosition >= 0) {\r\n serializationObject.isExposedOnFrame = true;\r\n serializationObject.exposedPortPosition = this.exposedPortPosition;\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Release resources\r\n */\r\n public dispose() {\r\n this.onConnectionObservable.clear();\r\n this.onDisconnectionObservable.clear();\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"nodeRenderGraphBlockConnectionPoint.js","sourceRoot":"","sources":["../../../../../dev/core/src/FrameGraph/Node/nodeRenderGraphBlockCon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IAAI,CAAC,IAAI,CAAC;QACrC,mBAAmB,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QAEnD,IAAI,OAAO,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACjC,mBAAmB,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC;YAC1C,mBAAmB,CAAC,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC;YAC5E,mBAAmB,CAAC,oBAAoB,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC;YACpE,mBAAmB,CAAC,gBAAgB,GAAG,IAAI,CAAC;YAC5C,mBAAmB,CAAC,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,CAAC;QACvE,CAAC;QAED,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,mBAAmB,IAAI,CAAC,EAAE,CAAC;YACzD,mBAAmB,CAAC,gBAAgB,GAAG,IAAI,CAAC;YAC5C,mBAAmB,CAAC,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,CAAC;QACvE,CAAC;QAED,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAED;;OAEG;IACI,OAAO;QACV,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,CAAC;QACpC,IAAI,CAAC,yBAAyB,CAAC,KAAK,EAAE,CAAC;IAC3C,CAAC;CACJ","sourcesContent":["import type {\r\n Nullable,\r\n NodeRenderGraphBlock,\r\n NodeRenderGraphBlockConnectionPointValueType,\r\n NodeRenderGraphInputBlock,\r\n IShadowLight,\r\n FrameGraphShadowGeneratorTask,\r\n // eslint-disable-next-line import/no-internal-modules\r\n} from \"core/index\";\r\nimport { Observable } from \"../../Misc/observable\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes, NodeRenderGraphConnectionPointCompatibilityStates, NodeRenderGraphConnectionPointDirection } from \"./Types/nodeRenderGraphTypes\";\r\n\r\n/**\r\n * Defines a connection point for a block\r\n */\r\nexport class NodeRenderGraphConnectionPoint {\r\n private readonly _ownerBlock: NodeRenderGraphBlock;\r\n private _connectedPoint: Nullable<NodeRenderGraphConnectionPoint> = null;\r\n\r\n /** @internal */\r\n public _acceptedConnectionPointType: Nullable<NodeRenderGraphConnectionPoint> = null;\r\n\r\n private _endpoints = new Array<NodeRenderGraphConnectionPoint>();\r\n private readonly _direction: NodeRenderGraphConnectionPointDirection;\r\n private _type = NodeRenderGraphBlockConnectionPointTypes.Undefined;\r\n\r\n /** @internal */\r\n public _linkedConnectionSource: Nullable<NodeRenderGraphConnectionPoint> = null;\r\n\r\n /** @internal */\r\n public _isMainLinkSource = false;\r\n\r\n /** @internal */\r\n public _typeConnectionSource: Nullable<NodeRenderGraphConnectionPoint | (() => NodeRenderGraphConnectionPoint)> = null;\r\n\r\n /** @internal */\r\n public _defaultConnectionPointType: Nullable<NodeRenderGraphBlockConnectionPointTypes> = null;\r\n\r\n /** Gets the direction of the point */\r\n public get direction() {\r\n return this._direction;\r\n }\r\n\r\n /**\r\n * Checks if the value is a texture handle\r\n * @param value The value to check\r\n * @returns True if the value is a texture handle\r\n */\r\n public static IsTextureHandle(value: NodeRenderGraphBlockConnectionPointValueType | undefined): boolean {\r\n return value !== undefined && Number.isFinite(value);\r\n }\r\n\r\n /**\r\n * Checks if the value is a shadow generator task\r\n * @param value The value to check\r\n * @returns True if the value is a shadow generator\r\n */\r\n public static IsShadowGenerator(value: NodeRenderGraphBlockConnectionPointValueType | undefined): boolean {\r\n return value !== undefined && (value as FrameGraphShadowGeneratorTask).mapSize !== undefined;\r\n }\r\n\r\n /**\r\n * Checks if the value is a shadow light\r\n * @param value The value to check\r\n * @returns True if the value is a shadow light\r\n */\r\n public static IsShadowLight(value: NodeRenderGraphBlockConnectionPointValueType | undefined): boolean {\r\n return value !== undefined && (value as IShadowLight).setShadowProjectionMatrix !== undefined;\r\n }\r\n\r\n /**\r\n * The value stored in this connection point\r\n */\r\n public value: NodeRenderGraphBlockConnectionPointValueType | undefined;\r\n\r\n /** Indicates that this connection point needs dual validation before being connected to another point */\r\n public needDualDirectionValidation: boolean = false;\r\n\r\n /**\r\n * Gets or sets the additional types supported by this connection point\r\n */\r\n public acceptedConnectionPointTypes: NodeRenderGraphBlockConnectionPointTypes[] = [];\r\n\r\n /**\r\n * Gets or sets the additional types excluded by this connection point\r\n */\r\n public excludedConnectionPointTypes: NodeRenderGraphBlockConnectionPointTypes[] = [];\r\n\r\n /**\r\n * Observable triggered when this point is connected\r\n */\r\n public onConnectionObservable = new Observable<NodeRenderGraphConnectionPoint>();\r\n\r\n /**\r\n * Observable triggered when this point is disconnected\r\n */\r\n public onDisconnectionObservable = new Observable<NodeRenderGraphConnectionPoint>();\r\n\r\n /**\r\n * Gets or sets a boolean indicating that this connection point is exposed on a frame\r\n */\r\n public isExposedOnFrame: boolean = false;\r\n\r\n /**\r\n * Gets or sets number indicating the position that the port is exposed to on a frame\r\n */\r\n public exposedPortPosition: number = -1;\r\n\r\n /**\r\n * Gets or sets the connection point type (default is Undefined)\r\n */\r\n public get type(): NodeRenderGraphBlockConnectionPointTypes {\r\n if (this._type === NodeRenderGraphBlockConnectionPointTypes.AutoDetect) {\r\n if (this._ownerBlock.isInput) {\r\n return (this._ownerBlock as NodeRenderGraphInputBlock).type;\r\n }\r\n\r\n if (this._connectedPoint) {\r\n return this._connectedPoint.type;\r\n }\r\n\r\n if (this._linkedConnectionSource) {\r\n if (this._linkedConnectionSource.isConnected) {\r\n return this._linkedConnectionSource.type;\r\n }\r\n if (this._linkedConnectionSource._defaultConnectionPointType) {\r\n return this._linkedConnectionSource._defaultConnectionPointType;\r\n }\r\n }\r\n\r\n if (this._defaultConnectionPointType) {\r\n return this._defaultConnectionPointType;\r\n }\r\n }\r\n\r\n if (this._type === NodeRenderGraphBlockConnectionPointTypes.BasedOnInput) {\r\n if (this._typeConnectionSource) {\r\n const typeConnectionSource = typeof this._typeConnectionSource === \"function\" ? this._typeConnectionSource() : this._typeConnectionSource;\r\n if (!typeConnectionSource.isConnected) {\r\n return this._defaultConnectionPointType ?? typeConnectionSource.type;\r\n }\r\n return typeConnectionSource._connectedPoint!.type;\r\n } else if (this._defaultConnectionPointType) {\r\n return this._defaultConnectionPointType;\r\n }\r\n }\r\n\r\n return this._type;\r\n }\r\n\r\n public set type(value: NodeRenderGraphBlockConnectionPointTypes) {\r\n this._type = value;\r\n }\r\n\r\n /**\r\n * Gets or sets the connection point name\r\n */\r\n public name: string;\r\n\r\n /**\r\n * Gets or sets the connection point display name\r\n */\r\n public displayName: string;\r\n\r\n /**\r\n * Gets or sets a boolean indicating that this connection point can be omitted\r\n */\r\n public isOptional: boolean;\r\n\r\n /**\r\n * Gets a boolean indicating that the current point is connected to another NodeRenderGraphBlock\r\n */\r\n public get isConnected(): boolean {\r\n return this.connectedPoint !== null || this.hasEndpoints;\r\n }\r\n\r\n /** Get the other side of the connection (if any) */\r\n public get connectedPoint(): Nullable<NodeRenderGraphConnectionPoint> {\r\n return this._connectedPoint;\r\n }\r\n\r\n /** Get the block that owns this connection point */\r\n public get ownerBlock(): NodeRenderGraphBlock {\r\n return this._ownerBlock;\r\n }\r\n\r\n /** Get the block connected on the other side of this connection (if any) */\r\n public get sourceBlock(): Nullable<NodeRenderGraphBlock> {\r\n if (!this._connectedPoint) {\r\n return null;\r\n }\r\n\r\n return this._connectedPoint.ownerBlock;\r\n }\r\n\r\n /** Get the block connected on the endpoints of this connection (if any) */\r\n public get connectedBlocks(): Array<NodeRenderGraphBlock> {\r\n if (this._endpoints.length === 0) {\r\n return [];\r\n }\r\n\r\n return this._endpoints.map((e) => e.ownerBlock);\r\n }\r\n\r\n /** Gets the list of connected endpoints */\r\n public get endpoints() {\r\n return this._endpoints;\r\n }\r\n\r\n /** Gets a boolean indicating if that output point is connected to at least one input */\r\n public get hasEndpoints(): boolean {\r\n return this._endpoints && this._endpoints.length > 0;\r\n }\r\n\r\n /** Get the inner type (ie AutoDetect for instance instead of the inferred one) */\r\n public get innerType() {\r\n if (this._linkedConnectionSource && !this._isMainLinkSource && this._linkedConnectionSource.isConnected) {\r\n return this.type;\r\n }\r\n return this._type;\r\n }\r\n\r\n /**\r\n * Creates a block suitable to be used as an input for this input point.\r\n * If null is returned, a block based on the point type will be created.\r\n * @returns The returned string parameter is the name of the output point of NodeRenderGraphBlock (first parameter of the returned array) that can be connected to the input\r\n */\r\n public createCustomInputBlock(): Nullable<[NodeRenderGraphBlock, string]> {\r\n return null;\r\n }\r\n\r\n /**\r\n * Creates a new connection point\r\n * @param name defines the connection point name\r\n * @param ownerBlock defines the block hosting this connection point\r\n * @param direction defines the direction of the connection point\r\n */\r\n public constructor(name: string, ownerBlock: NodeRenderGraphBlock, direction: NodeRenderGraphConnectionPointDirection) {\r\n this._ownerBlock = ownerBlock;\r\n this.name = name;\r\n this._direction = direction;\r\n }\r\n\r\n /**\r\n * Gets the current class name e.g. \"NodeRenderGraphConnectionPoint\"\r\n * @returns the class name\r\n */\r\n public getClassName(): string {\r\n return \"NodeRenderGraphConnectionPoint\";\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if the current point can be connected to another point\r\n * @param connectionPoint defines the other connection point\r\n * @returns a boolean\r\n */\r\n public canConnectTo(connectionPoint: NodeRenderGraphConnectionPoint) {\r\n return this.checkCompatibilityState(connectionPoint) === NodeRenderGraphConnectionPointCompatibilityStates.Compatible;\r\n }\r\n\r\n /**\r\n * Gets a number indicating if the current point can be connected to another point\r\n * @param connectionPoint defines the other connection point\r\n * @returns a number defining the compatibility state\r\n */\r\n public checkCompatibilityState(connectionPoint: NodeRenderGraphConnectionPoint): NodeRenderGraphConnectionPointCompatibilityStates {\r\n const ownerBlock = this._ownerBlock;\r\n const otherBlock = connectionPoint.ownerBlock;\r\n\r\n if (this.type !== connectionPoint.type && connectionPoint.innerType !== NodeRenderGraphBlockConnectionPointTypes.AutoDetect) {\r\n // Accepted types\r\n if (connectionPoint.acceptedConnectionPointTypes && connectionPoint.acceptedConnectionPointTypes.indexOf(this.type) !== -1) {\r\n return NodeRenderGraphConnectionPointCompatibilityStates.Compatible;\r\n } else {\r\n return NodeRenderGraphConnectionPointCompatibilityStates.TypeIncompatible;\r\n }\r\n }\r\n\r\n // Excluded\r\n if (connectionPoint.excludedConnectionPointTypes && connectionPoint.excludedConnectionPointTypes.indexOf(this.type) !== -1) {\r\n return NodeRenderGraphConnectionPointCompatibilityStates.TypeIncompatible;\r\n }\r\n\r\n // Check hierarchy\r\n let targetBlock = otherBlock;\r\n let sourceBlock = ownerBlock;\r\n if (this.direction === NodeRenderGraphConnectionPointDirection.Input) {\r\n targetBlock = ownerBlock;\r\n sourceBlock = otherBlock;\r\n }\r\n\r\n if (targetBlock.isAnAncestorOf(sourceBlock)) {\r\n return NodeRenderGraphConnectionPointCompatibilityStates.HierarchyIssue;\r\n }\r\n\r\n return NodeRenderGraphConnectionPointCompatibilityStates.Compatible;\r\n }\r\n\r\n /**\r\n * Connect this point to another connection point\r\n * @param connectionPoint defines the other connection point\r\n * @param ignoreConstraints defines if the system will ignore connection type constraints (default is false)\r\n * @returns the current connection point\r\n */\r\n public connectTo(connectionPoint: NodeRenderGraphConnectionPoint, ignoreConstraints = false): NodeRenderGraphConnectionPoint {\r\n if (!ignoreConstraints && !this.canConnectTo(connectionPoint)) {\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"Cannot connect these two connectors.\";\r\n }\r\n\r\n this._endpoints.push(connectionPoint);\r\n connectionPoint._connectedPoint = this;\r\n\r\n this.onConnectionObservable.notifyObservers(connectionPoint);\r\n connectionPoint.onConnectionObservable.notifyObservers(this);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Disconnect this point from one of his endpoint\r\n * @param endpoint defines the other connection point\r\n * @returns the current connection point\r\n */\r\n public disconnectFrom(endpoint: NodeRenderGraphConnectionPoint): NodeRenderGraphConnectionPoint {\r\n const index = this._endpoints.indexOf(endpoint);\r\n\r\n if (index === -1) {\r\n return this;\r\n }\r\n\r\n this._endpoints.splice(index, 1);\r\n endpoint._connectedPoint = null;\r\n\r\n this.onDisconnectionObservable.notifyObservers(endpoint);\r\n endpoint.onDisconnectionObservable.notifyObservers(this);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Fills the list of excluded connection point types with all types other than those passed in the parameter\r\n * @param mask Types (ORed values of NodeRenderGraphBlockConnectionPointTypes) that are allowed, and thus will not be pushed to the excluded list\r\n */\r\n public addExcludedConnectionPointFromAllowedTypes(mask: number): void {\r\n let bitmask = 0;\r\n let val = 2 ** bitmask;\r\n // Note: don't use 1 << bitmask instead of 2 ** bitmask, as it will cause an infinite loop because 1 << 31 is negative!\r\n while (val < NodeRenderGraphBlockConnectionPointTypes.All) {\r\n if (!(mask & val)) {\r\n this.excludedConnectionPointTypes.push(val);\r\n }\r\n bitmask++;\r\n val = 2 ** bitmask;\r\n }\r\n }\r\n\r\n /**\r\n * Adds accepted connection point types\r\n * @param mask Types (ORed values of NodeRenderGraphBlockConnectionPointTypes) that are allowed to connect to this point\r\n */\r\n public addAcceptedConnectionPointTypes(mask: number): void {\r\n let bitmask = 0;\r\n let val = 2 ** bitmask;\r\n // Note: don't use 1 << bitmask instead of 2 ** bitmask, as it will cause an infinite loop because 1 << 31 is negative!\r\n while (val < NodeRenderGraphBlockConnectionPointTypes.All) {\r\n if (mask & val && this.acceptedConnectionPointTypes.indexOf(val) === -1) {\r\n this.acceptedConnectionPointTypes.push(val);\r\n }\r\n bitmask++;\r\n val = 2 ** bitmask;\r\n }\r\n }\r\n\r\n /**\r\n * Serializes this point in a JSON representation\r\n * @param isInput defines if the connection point is an input (default is true)\r\n * @returns the serialized point object\r\n */\r\n public serialize(isInput = true): any {\r\n const serializationObject: any = {};\r\n\r\n serializationObject.name = this.name;\r\n serializationObject.displayName = this.displayName;\r\n\r\n if (isInput && this.connectedPoint) {\r\n serializationObject.inputName = this.name;\r\n serializationObject.targetBlockId = this.connectedPoint.ownerBlock.uniqueId;\r\n serializationObject.targetConnectionName = this.connectedPoint.name;\r\n serializationObject.isExposedOnFrame = true;\r\n serializationObject.exposedPortPosition = this.exposedPortPosition;\r\n }\r\n\r\n if (this.isExposedOnFrame || this.exposedPortPosition >= 0) {\r\n serializationObject.isExposedOnFrame = true;\r\n serializationObject.exposedPortPosition = this.exposedPortPosition;\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Release resources\r\n */\r\n public dispose() {\r\n this.onConnectionObservable.clear();\r\n this.onDisconnectionObservable.clear();\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { NodeRenderGraphConnectionPointDirection, NodeRenderGraphBlock, Nullable } from "../../index.js";
|
|
2
|
+
import { NodeRenderGraphConnectionPoint } from "./nodeRenderGraphBlockConnectionPoint";
|
|
3
|
+
import { NodeRenderGraphConnectionPointCompatibilityStates } from "./Types/nodeRenderGraphTypes";
|
|
4
|
+
/**
|
|
5
|
+
* Defines a connection point to be used for points with a custom object type
|
|
6
|
+
*/
|
|
7
|
+
export declare class NodeRenderGraphConnectionPointCustomObject<T extends NodeRenderGraphBlock> extends NodeRenderGraphConnectionPoint {
|
|
8
|
+
_blockType: new (...args: any[]) => T;
|
|
9
|
+
private _blockName;
|
|
10
|
+
/**
|
|
11
|
+
* Creates a new connection point
|
|
12
|
+
* @param name defines the connection point name
|
|
13
|
+
* @param ownerBlock defines the block hosting this connection point
|
|
14
|
+
* @param direction defines the direction of the connection point
|
|
15
|
+
* @param _blockType
|
|
16
|
+
* @param _blockName
|
|
17
|
+
*/
|
|
18
|
+
constructor(name: string, ownerBlock: NodeRenderGraphBlock, direction: NodeRenderGraphConnectionPointDirection, _blockType: new (...args: any[]) => T, _blockName: string);
|
|
19
|
+
checkCompatibilityState(connectionPoint: NodeRenderGraphConnectionPoint): NodeRenderGraphConnectionPointCompatibilityStates;
|
|
20
|
+
createCustomInputBlock(): Nullable<[NodeRenderGraphBlock, string]>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { NodeRenderGraphConnectionPoint } from "./nodeRenderGraphBlockConnectionPoint.js";
|
|
2
|
+
/**
|
|
3
|
+
* Defines a connection point to be used for points with a custom object type
|
|
4
|
+
*/
|
|
5
|
+
export class NodeRenderGraphConnectionPointCustomObject extends NodeRenderGraphConnectionPoint {
|
|
6
|
+
/**
|
|
7
|
+
* Creates a new connection point
|
|
8
|
+
* @param name defines the connection point name
|
|
9
|
+
* @param ownerBlock defines the block hosting this connection point
|
|
10
|
+
* @param direction defines the direction of the connection point
|
|
11
|
+
* @param _blockType
|
|
12
|
+
* @param _blockName
|
|
13
|
+
*/
|
|
14
|
+
constructor(name, ownerBlock, direction,
|
|
15
|
+
// @internal
|
|
16
|
+
_blockType, _blockName) {
|
|
17
|
+
super(name, ownerBlock, direction);
|
|
18
|
+
this._blockType = _blockType;
|
|
19
|
+
this._blockName = _blockName;
|
|
20
|
+
this.needDualDirectionValidation = true;
|
|
21
|
+
}
|
|
22
|
+
checkCompatibilityState(connectionPoint) {
|
|
23
|
+
return connectionPoint instanceof NodeRenderGraphConnectionPointCustomObject && connectionPoint._blockName === this._blockName
|
|
24
|
+
? 0 /* NodeRenderGraphConnectionPointCompatibilityStates.Compatible */
|
|
25
|
+
: 1 /* NodeRenderGraphConnectionPointCompatibilityStates.TypeIncompatible */;
|
|
26
|
+
}
|
|
27
|
+
createCustomInputBlock() {
|
|
28
|
+
return [new this._blockType(this._blockName), this.name];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=nodeRenderGraphConnectionPointCustomObject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodeRenderGraphConnectionPointCustomObject.js","sourceRoot":"","sources":["../../../../../dev/core/src/FrameGraph/Node/nodeRenderGraphConnectionPointCustomObject.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,8BAA8B,EAAE,MAAM,uCAAuC,CAAC;AAGvF;;GAEG;AACH,MAAM,OAAO,0CAA2E,SAAQ,8BAA8B;IAC1H;;;;;;;OAOG;IACH,YACI,IAAY,EACZ,UAAgC,EAChC,SAAkD;IAClD,YAAY;IACL,UAAqC,EACpC,UAAkB;QAE1B,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;QAH5B,eAAU,GAAV,UAAU,CAA2B;QACpC,eAAU,GAAV,UAAU,CAAQ;QAI1B,IAAI,CAAC,2BAA2B,GAAG,IAAI,CAAC;IAC5C,CAAC;IAEe,uBAAuB,CAAC,eAA+C;QACnF,OAAO,eAAe,YAAY,0CAA0C,IAAI,eAAe,CAAC,UAAU,KAAK,IAAI,CAAC,UAAU;YAC1H,CAAC;YACD,CAAC,2EAAmE,CAAC;IAC7E,CAAC;IAEe,sBAAsB;QAClC,OAAO,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7D,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPointDirection, NodeRenderGraphBlock, Nullable } from \"core/index\";\r\nimport { NodeRenderGraphConnectionPoint } from \"./nodeRenderGraphBlockConnectionPoint\";\r\nimport { NodeRenderGraphConnectionPointCompatibilityStates } from \"./Types/nodeRenderGraphTypes\";\r\n\r\n/**\r\n * Defines a connection point to be used for points with a custom object type\r\n */\r\nexport class NodeRenderGraphConnectionPointCustomObject<T extends NodeRenderGraphBlock> extends NodeRenderGraphConnectionPoint {\r\n /**\r\n * Creates a new connection point\r\n * @param name defines the connection point name\r\n * @param ownerBlock defines the block hosting this connection point\r\n * @param direction defines the direction of the connection point\r\n * @param _blockType\r\n * @param _blockName\r\n */\r\n public constructor(\r\n name: string,\r\n ownerBlock: NodeRenderGraphBlock,\r\n direction: NodeRenderGraphConnectionPointDirection,\r\n // @internal\r\n public _blockType: new (...args: any[]) => T,\r\n private _blockName: string\r\n ) {\r\n super(name, ownerBlock, direction);\r\n\r\n this.needDualDirectionValidation = true;\r\n }\r\n\r\n public override checkCompatibilityState(connectionPoint: NodeRenderGraphConnectionPoint): NodeRenderGraphConnectionPointCompatibilityStates {\r\n return connectionPoint instanceof NodeRenderGraphConnectionPointCustomObject && connectionPoint._blockName === this._blockName\r\n ? NodeRenderGraphConnectionPointCompatibilityStates.Compatible\r\n : NodeRenderGraphConnectionPointCompatibilityStates.TypeIncompatible;\r\n }\r\n\r\n public override createCustomInputBlock(): Nullable<[NodeRenderGraphBlock, string]> {\r\n return [new this._blockType(this._blockName), this.name];\r\n }\r\n}\r\n"]}
|
|
@@ -7,6 +7,7 @@ export declare class FrameGraphPass<T extends FrameGraphContext> implements IFra
|
|
|
7
7
|
protected readonly _parentTask: FrameGraphTask;
|
|
8
8
|
protected readonly _context: T;
|
|
9
9
|
private _executeFunc;
|
|
10
|
+
disabled: boolean;
|
|
10
11
|
constructor(name: string, _parentTask: FrameGraphTask, _context: T);
|
|
11
12
|
setExecuteFunc(func: (context: T) => void): void;
|
|
12
13
|
_execute(): void;
|
|
@@ -6,12 +6,15 @@ export class FrameGraphPass {
|
|
|
6
6
|
this.name = name;
|
|
7
7
|
this._parentTask = _parentTask;
|
|
8
8
|
this._context = _context;
|
|
9
|
+
this.disabled = false;
|
|
9
10
|
}
|
|
10
11
|
setExecuteFunc(func) {
|
|
11
12
|
this._executeFunc = func;
|
|
12
13
|
}
|
|
13
14
|
_execute() {
|
|
14
|
-
|
|
15
|
+
if (!this.disabled) {
|
|
16
|
+
this._executeFunc(this._context);
|
|
17
|
+
}
|
|
15
18
|
}
|
|
16
19
|
_isValid() {
|
|
17
20
|
return this._executeFunc !== undefined ? null : "Execute function is not set (call setExecuteFunc to set it)";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pass.js","sourceRoot":"","sources":["../../../../../dev/core/src/FrameGraph/Passes/pass.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,OAAO,cAAc;
|
|
1
|
+
{"version":3,"file":"pass.js","sourceRoot":"","sources":["../../../../../dev/core/src/FrameGraph/Passes/pass.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,OAAO,cAAc;IAKvB,YACW,IAAY,EACA,WAA2B,EAC3B,QAAW;QAFvB,SAAI,GAAJ,IAAI,CAAQ;QACA,gBAAW,GAAX,WAAW,CAAgB;QAC3B,aAAQ,GAAR,QAAQ,CAAG;QAL3B,aAAQ,GAAG,KAAK,CAAC;IAMrB,CAAC;IAEG,cAAc,CAAC,IAA0B;QAC5C,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC7B,CAAC;IAEM,QAAQ;QACX,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACjB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrC,CAAC;IACL,CAAC;IAEM,QAAQ;QACX,OAAO,IAAI,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,6DAA6D,CAAC;IAClH,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { Nullable, FrameGraphContext, IFrameGraphPass, FrameGraphTask } from \"core/index\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class FrameGraphPass<T extends FrameGraphContext> implements IFrameGraphPass {\r\n private _executeFunc: (context: T) => void;\r\n\r\n public disabled = false;\r\n\r\n constructor(\r\n public name: string,\r\n protected readonly _parentTask: FrameGraphTask,\r\n protected readonly _context: T\r\n ) {}\r\n\r\n public setExecuteFunc(func: (context: T) => void) {\r\n this._executeFunc = func;\r\n }\r\n\r\n public _execute() {\r\n if (!this.disabled) {\r\n this._executeFunc(this._context);\r\n }\r\n }\r\n\r\n public _isValid(): Nullable<string> {\r\n return this._executeFunc !== undefined ? null : \"Execute function is not set (call setExecuteFunc to set it)\";\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { FrameGraph, FrameGraphTextureHandle, Scene, AbstractEngine, ThinEffectLayer, FrameGraphRenderPass, FrameGraphRenderContext } from "../../../index.js";
|
|
2
|
+
import { FrameGraphTask } from "../../frameGraphTask";
|
|
3
|
+
import { FrameGraphObjectRendererTask } from "../Rendering/objectRendererTask";
|
|
4
|
+
import { FrameGraphClearTextureTask } from "../Texture/clearTextureTask";
|
|
5
|
+
import { FrameGraphBlurTask } from "../PostProcesses/blurTask";
|
|
6
|
+
import { FrameGraphPostProcessTask } from "../PostProcesses/postProcessTask";
|
|
7
|
+
import { ThinGlowBlurPostProcess } from "../../../Layers/thinEffectLayer";
|
|
8
|
+
declare class FrameGraphGlowBlurTask extends FrameGraphPostProcessTask {
|
|
9
|
+
readonly postProcess: ThinGlowBlurPostProcess;
|
|
10
|
+
/**
|
|
11
|
+
* Constructs a new glow blur task.
|
|
12
|
+
* @param name The name of the task.
|
|
13
|
+
* @param frameGraph The frame graph this task is associated with.
|
|
14
|
+
* @param thinPostProcess The thin post process to use for the glow blur effect. If not provided, a new one will be created.
|
|
15
|
+
*/
|
|
16
|
+
constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinGlowBlurPostProcess);
|
|
17
|
+
record(skipCreationOfDisabledPasses?: boolean, additionalExecute?: (context: FrameGraphRenderContext) => void, additionalBindings?: (context: FrameGraphRenderContext) => void): FrameGraphRenderPass;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export declare class FrameGraphBaseLayerTask extends FrameGraphTask {
|
|
23
|
+
private _setRenderTargetDepth;
|
|
24
|
+
private _notifyBlurObservable;
|
|
25
|
+
/**
|
|
26
|
+
* The destination texture to apply the effect layer to.
|
|
27
|
+
* The effect will be blended with the contents of this texture.
|
|
28
|
+
*/
|
|
29
|
+
destinationTexture: FrameGraphTextureHandle;
|
|
30
|
+
/**
|
|
31
|
+
* The object renderer task used to render the objects in the texture to which the layer will be applied.
|
|
32
|
+
* This is needed because the layer may have to inject code in the rendering manager used by object renderer task.
|
|
33
|
+
*/
|
|
34
|
+
objectRendererTask: FrameGraphObjectRendererTask;
|
|
35
|
+
/**
|
|
36
|
+
* The layer texture to render the effect into.
|
|
37
|
+
* If not provided, a default texture will be created.
|
|
38
|
+
*/
|
|
39
|
+
layerTexture?: FrameGraphTextureHandle;
|
|
40
|
+
/**
|
|
41
|
+
* The output texture of the task (same as destinationTexture, but the handle will be different).
|
|
42
|
+
*/
|
|
43
|
+
readonly outputTexture: FrameGraphTextureHandle;
|
|
44
|
+
/**
|
|
45
|
+
* The layer object. Use this object to update the layer properties.
|
|
46
|
+
*/
|
|
47
|
+
readonly layer: ThinEffectLayer;
|
|
48
|
+
/**
|
|
49
|
+
* The name of the task.
|
|
50
|
+
*/
|
|
51
|
+
get name(): string;
|
|
52
|
+
set name(name: string);
|
|
53
|
+
protected readonly _scene: Scene;
|
|
54
|
+
protected readonly _engine: AbstractEngine;
|
|
55
|
+
protected readonly _clearLayerTextures: FrameGraphClearTextureTask;
|
|
56
|
+
protected readonly _objectRendererForLayer: FrameGraphObjectRendererTask;
|
|
57
|
+
protected readonly _blurX: Array<FrameGraphBlurTask | FrameGraphGlowBlurTask>;
|
|
58
|
+
protected readonly _blurY: Array<FrameGraphBlurTask | FrameGraphGlowBlurTask>;
|
|
59
|
+
private readonly _onBeforeBlurTask;
|
|
60
|
+
private readonly _onAfterBlurTask;
|
|
61
|
+
private _onBeforeObservableObserver;
|
|
62
|
+
private _onAfterObservableObserver;
|
|
63
|
+
private _onAfterRenderingGroupObserver;
|
|
64
|
+
/**
|
|
65
|
+
* Constructs a new layer task.
|
|
66
|
+
* @param name Name of the task.
|
|
67
|
+
* @param frameGraph The frame graph this task is associated with.
|
|
68
|
+
* @param scene The scene to render the layer in.
|
|
69
|
+
* @param layer The layer.
|
|
70
|
+
* @param numBlurPasses The number of blur passes applied by the layer.
|
|
71
|
+
* @param useCustomBlur If true, the layer will use a custom blur post process instead of the default one.
|
|
72
|
+
* @param _setRenderTargetDepth If true, the task will set the render target depth.
|
|
73
|
+
* @param _notifyBlurObservable If true, the task will notify before and after blurring occurs.
|
|
74
|
+
*/
|
|
75
|
+
constructor(name: string, frameGraph: FrameGraph, scene: Scene, layer: ThinEffectLayer, numBlurPasses: number, useCustomBlur?: boolean, _setRenderTargetDepth?: boolean, _notifyBlurObservable?: boolean);
|
|
76
|
+
isReady(): boolean;
|
|
77
|
+
record(): void;
|
|
78
|
+
private _clearAfterRenderingGroupObserver;
|
|
79
|
+
dispose(): void;
|
|
80
|
+
}
|
|
81
|
+
export {};
|