@babylonjs/core 7.39.1 → 7.39.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cameras/arcRotateCamera.d.ts +1 -1
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Debug/directionalLightFrustumViewer.d.ts +2 -1
- package/Debug/directionalLightFrustumViewer.js +4 -3
- package/Debug/directionalLightFrustumViewer.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.js +1 -0
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/constants.d.ts +8 -0
- package/Engines/constants.js +8 -0
- package/Engines/constants.js.map +1 -1
- package/Engines/thinEngine.js +9 -3
- package/Engines/thinEngine.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js +3 -9
- package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js +3 -9
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js +3 -9
- package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js +5 -17
- package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js +5 -17
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js +3 -9
- package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.d.ts +6 -1
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +40 -20
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.d.ts +77 -0
- package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js +250 -0
- package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.d.ts +57 -0
- package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.js +169 -0
- package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/cullObjectsBlock.js +3 -9
- package/FrameGraph/Node/Blocks/Rendering/cullObjectsBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js +4 -13
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.d.ts +6 -0
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js +27 -0
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/shadowGeneratorBlock.d.ts +19 -0
- package/FrameGraph/Node/Blocks/Rendering/shadowGeneratorBlock.js +28 -0
- package/FrameGraph/Node/Blocks/Rendering/shadowGeneratorBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Textures/clearBlock.js +3 -9
- package/FrameGraph/Node/Blocks/Textures/clearBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js +3 -9
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js +2 -5
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/executeBlock.d.ts +29 -0
- package/FrameGraph/Node/Blocks/executeBlock.js +43 -0
- package/FrameGraph/Node/Blocks/executeBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/index.d.ts +4 -0
- package/FrameGraph/Node/Blocks/index.js +4 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Node/Blocks/inputBlock.d.ts +7 -2
- package/FrameGraph/Node/Blocks/inputBlock.js +13 -0
- package/FrameGraph/Node/Blocks/inputBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/resourceContainerBlock.d.ts +55 -0
- package/FrameGraph/Node/Blocks/resourceContainerBlock.js +97 -0
- package/FrameGraph/Node/Blocks/resourceContainerBlock.js.map +1 -0
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +13 -10
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +11 -4
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js +32 -4
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraphBlock.d.ts +1 -0
- package/FrameGraph/Node/nodeRenderGraphBlock.js +11 -0
- package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.d.ts +18 -0
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js +24 -0
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js.map +1 -1
- package/FrameGraph/Passes/cullPass.d.ts +1 -1
- package/FrameGraph/Passes/cullPass.js.map +1 -1
- package/FrameGraph/Tasks/Misc/executeTask.d.ts +22 -0
- package/FrameGraph/Tasks/Misc/executeTask.js +28 -0
- package/FrameGraph/Tasks/Misc/executeTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.d.ts +72 -0
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js +183 -0
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +16 -5
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js +46 -0
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.d.ts +107 -0
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js +264 -0
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js.map +1 -0
- package/FrameGraph/Tasks/Texture/clearTextureTask.js +7 -0
- package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
- package/FrameGraph/frameGraph.d.ts +9 -0
- package/FrameGraph/frameGraph.js +12 -3
- package/FrameGraph/frameGraph.js.map +1 -1
- package/FrameGraph/frameGraphTextureManager.js +4 -1
- package/FrameGraph/frameGraphTextureManager.js.map +1 -1
- package/FrameGraph/index.d.ts +5 -0
- package/FrameGraph/index.js +5 -0
- package/FrameGraph/index.js.map +1 -1
- package/Inputs/scene.inputManager.d.ts +1 -1
- package/Inputs/scene.inputManager.js +8 -1
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.d.ts +1 -1
- package/Lights/Shadows/shadowGenerator.js +2 -7
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Lights/directionalLight.d.ts +5 -4
- package/Lights/directionalLight.js +7 -9
- package/Lights/directionalLight.js.map +1 -1
- package/Lights/shadowLight.d.ts +4 -4
- package/Lights/shadowLight.js +3 -2
- package/Lights/shadowLight.js.map +1 -1
- package/Lights/spotLight.d.ts +2 -2
- package/Lights/spotLight.js +3 -2
- package/Lights/spotLight.js.map +1 -1
- package/Loading/sceneLoader.d.ts +1 -1
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/GreasedLine/greasedLinePluginMaterial.js +1 -1
- package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
- package/Materials/PBR/pbrMetallicRoughnessMaterial.js +18 -6
- package/Materials/PBR/pbrMetallicRoughnessMaterial.js.map +1 -1
- package/Materials/PBR/pbrSpecularGlossinessMaterial.js +18 -6
- package/Materials/PBR/pbrSpecularGlossinessMaterial.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +2 -0
- package/Materials/Textures/renderTargetTexture.js +18 -8
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/material.js +3 -1
- package/Materials/material.js.map +1 -1
- package/Materials/materialPluginBase.d.ts +4 -0
- package/Materials/materialPluginBase.js +4 -0
- package/Materials/materialPluginBase.js.map +1 -1
- package/Maths/math.color.js.map +1 -1
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/lattice.material.d.ts +3 -8
- package/Meshes/lattice.material.js.map +1 -1
- package/Misc/copyTextureToTexture.js +1 -1
- package/Misc/copyTextureToTexture.js.map +1 -1
- package/Misc/filesInput.d.ts +3 -1
- package/Misc/filesInput.js +8 -4
- package/Misc/filesInput.js.map +1 -1
- package/PostProcesses/postProcess.d.ts +2 -2
- package/PostProcesses/postProcess.js +4 -4
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/postProcessManager.js +1 -1
- package/PostProcesses/postProcessManager.js.map +1 -1
- package/Shaders/ShadersInclude/lightsFragmentFunctions.js +1 -1
- package/Shaders/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
- package/Shaders/default.fragment.js +2 -1
- package/Shaders/default.fragment.js.map +1 -1
- package/Shaders/default.vertex.js +2 -1
- package/Shaders/default.vertex.js.map +1 -1
- package/Shaders/pbr.fragment.js +2 -1
- package/Shaders/pbr.fragment.js.map +1 -1
- package/Shaders/pbr.vertex.js +2 -1
- package/Shaders/pbr.vertex.js.map +1 -1
- package/XR/webXRCamera.js +3 -0
- package/XR/webXRCamera.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +7 -0
- package/scene.js +10 -1
- package/scene.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeRenderGraphBlock.js","sourceRoot":"","sources":["../../../../../dev/core/src/FrameGraph/Node/nodeRenderGraphBlock.ts"],"names":[],"mappings":";AAEA,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,GAAG,KAAK,CAAC;QAC1C,CAAC;IACL,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACX,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAmBD;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,qCAAqC;IACrC,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAOD;;OAEG;IACH,IAAW,IAAI;QACX,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,IAAW,IAAI,CAAC,KAAa;QACzB,IAAI,CAAC,KAAK,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;QACL,CAAC;QAED,OAAO,UAAU,CAAC;IACtB,CAAC;IAED;;;OAGG;IACI,KAAK;QACR,MAAM,mBAAmB,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAC7C,MAAM,SAAS,GAAgC,QAAQ,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC;QAExF,IAAI,SAAS,EAAE,CAAC;YACZ,MAAM,gCAAgC,GAAG,mBAAmB,CAAC,gCAAgC,CAAC;YAC9F,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;AA7dU;IADN,SAAS,CAAC,SAAS,CAAC;sDACG","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphBuildState, Nullable, NodeRenderGraphInputBlock, AbstractEngine, Scene, FrameGraphTask, FrameGraph } 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 _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 this._buildBlock(state);\r\n if (this._frameGraphTask) {\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":";AAUA,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,GAAG,KAAK,CAAC;QAC1C,CAAC;IACL,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACX,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAmBD;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,qCAAqC;IACrC,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAOD;;OAEG;IACH,IAAW,IAAI;QACX,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,IAAW,IAAI,C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AC9B,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;AAhfU;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 // 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 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"]}
|
|
@@ -22,6 +22,24 @@ export declare class NodeRenderGraphConnectionPoint {
|
|
|
22
22
|
_defaultConnectionPointType: Nullable<NodeRenderGraphBlockConnectionPointTypes>;
|
|
23
23
|
/** Gets the direction of the point */
|
|
24
24
|
get direction(): NodeRenderGraphConnectionPointDirection;
|
|
25
|
+
/**
|
|
26
|
+
* Checks if the value is a texture handle
|
|
27
|
+
* @param value The value to check
|
|
28
|
+
* @returns True if the value is a texture handle
|
|
29
|
+
*/
|
|
30
|
+
static IsTextureHandle(value: NodeRenderGraphBlockConnectionPointValueType | undefined): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Checks if the value is a shadow generator task
|
|
33
|
+
* @param value The value to check
|
|
34
|
+
* @returns True if the value is a shadow generator
|
|
35
|
+
*/
|
|
36
|
+
static IsShadowGenerator(value: NodeRenderGraphBlockConnectionPointValueType | undefined): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Checks if the value is a shadow light
|
|
39
|
+
* @param value The value to check
|
|
40
|
+
* @returns True if the value is a shadow light
|
|
41
|
+
*/
|
|
42
|
+
static IsShadowLight(value: NodeRenderGraphBlockConnectionPointValueType | undefined): boolean;
|
|
25
43
|
/**
|
|
26
44
|
* The value stored in this connection point
|
|
27
45
|
*/
|
|
@@ -8,6 +8,30 @@ export class NodeRenderGraphConnectionPoint {
|
|
|
8
8
|
get direction() {
|
|
9
9
|
return this._direction;
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Checks if the value is a texture handle
|
|
13
|
+
* @param value The value to check
|
|
14
|
+
* @returns True if the value is a texture handle
|
|
15
|
+
*/
|
|
16
|
+
static IsTextureHandle(value) {
|
|
17
|
+
return value !== undefined && Number.isFinite(value);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Checks if the value is a shadow generator task
|
|
21
|
+
* @param value The value to check
|
|
22
|
+
* @returns True if the value is a shadow generator
|
|
23
|
+
*/
|
|
24
|
+
static IsShadowGenerator(value) {
|
|
25
|
+
return value !== undefined && value.mapSize !== undefined;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Checks if the value is a shadow light
|
|
29
|
+
* @param value The value to check
|
|
30
|
+
* @returns True if the value is a shadow light
|
|
31
|
+
*/
|
|
32
|
+
static IsShadowLight(value) {
|
|
33
|
+
return value !== undefined && value.setShadowProjectionMatrix !== undefined;
|
|
34
|
+
}
|
|
11
35
|
/**
|
|
12
36
|
* Gets or sets the connection point type (default is Undefined)
|
|
13
37
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeRenderGraphBlockConnectionPoint.js","sourceRoot":"","sources":["../../../../../dev/core/src/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,wCAAwC,EAA8F,MAAM,8BAA8B,CAAC;AAEpL;;GAEG;AACH,MAAM,OAAO,8BAA8B;IAuBvC,sCAAsC;IACtC,IAAW,SAAS;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAqCD;;OAEG;IACH,IAAW,IAAI;QACX,IAAI,IAAI,CAAC,KAAK,KAAK,wCAAwC,CAAC,UAAU,EAAE,CAAC;YACrE,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;gBAC3B,OAAQ,IAAI,CAAC,WAAyC,CAAC,IAAI,CAAC;YAChE,CAAC;YAED,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;gBACvB,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;YACrC,CAAC;YAED,IAAI,IAAI,CAAC,uBAAuB,EAAE,CAAC;gBAC/B,IAAI,IAAI,CAAC,uBAAuB,CAAC,WAAW,EAAE,CAAC;oBAC3C,OAAO,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC;gBAC7C,CAAC;gBACD,IAAI,IAAI,CAAC,uBAAuB,CAAC,2BAA2B,EAAE,CAAC;oBAC3D,OAAO,IAAI,CAAC,uBAAuB,CAAC,2BAA2B,CAAC;gBACpE,CAAC;YACL,CAAC;YAED,IAAI,IAAI,CAAC,2BAA2B,EAAE,CAAC;gBACnC,OAAO,IAAI,CAAC,2BAA2B,CAAC;YAC5C,CAAC;QACL,CAAC;QAED,IAAI,IAA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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":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { Nullable, NodeRenderGraphBlock, NodeRenderGraphBlockConnectionPointValueType, NodeRenderGraphInputBlock } 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 * 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/nodeRenderGraphBlockConnectionPoint.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,wCAAwC,EAA8F,MAAM,8BAA8B,CAAC;AAEpL;;GAEG;AACH,MAAM,OAAO,8BAA8B;IAuBvC,sCAAsC;IACtC,IAAW,SAAS;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,eAAe,CAAC,KAA+D;QACzF,OAAO,KAAK,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzD,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,iBAAiB,CAAC,KAA+D;QAC3F,OAAO,KAAK,KAAK,SAAS,IAAK,KAAuC,CAAC,OAAO,KAAK,SAAS,CAAC;IACjG,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,aAAa,CAAC,KAA+D;QACvF,OAAO,KAAK,KAAK,SAAS,IAAK,KAAsB,CAAC,yBAAyB,KAAK,SAAS,CAAC;IAClG,CAAC;IAqCD;;OAEG;IACH,IAAW,IAAI;QACX,IAAI,IAAI,CAAC,KAAK,KAAK,wCAAwC,CAAC,UAAU,EAAE,CAAC;YACrE,IAAI,IAAI,CAAC,WAAW,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lockConnectionPointValueType,\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"]}
|
|
@@ -4,7 +4,7 @@ import { FrameGraphPass } from "./pass";
|
|
|
4
4
|
* Cull pass used to filter objects that are not visible.
|
|
5
5
|
*/
|
|
6
6
|
export declare class FrameGraphCullPass extends FrameGraphPass<FrameGraphContext> {
|
|
7
|
-
protected _engine: AbstractEngine;
|
|
7
|
+
protected readonly _engine: AbstractEngine;
|
|
8
8
|
protected _objectList: FrameGraphObjectList;
|
|
9
9
|
/**
|
|
10
10
|
* Checks if a pass is a cull pass.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cullPass.js","sourceRoot":"","sources":["../../../../../dev/core/src/FrameGraph/Passes/cullPass.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAExC;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,cAAiC;IAIrE;;;;OAIG;IACI,MAAM,CAAC,UAAU,CAAC,IAAqB;QAC1C,OAAQ,IAA2B,CAAC,aAAa,KAAK,SAAS,CAAC;IACpE,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACI,aAAa,CAAC,UAAgC;QACjD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAClC,CAAC;IAED,gBAAgB;IAChB,YAAY,IAAY,EAAE,UAA0B,EAAE,OAA0B,EAAE,MAAsB;QACpG,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QACjC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IAC1B,CAAC;IAED,gBAAgB;IACA,QAAQ;QACpB,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;QAChC,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,uDAAuD,CAAC;IAC7H,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { Nullable, AbstractEngine, IFrameGraphPass, FrameGraphContext, FrameGraphObjectList, FrameGraphTask } from \"core/index\";\r\nimport { FrameGraphPass } from \"./pass\";\r\n\r\n/**\r\n * Cull pass used to filter objects that are not visible.\r\n */\r\nexport class FrameGraphCullPass extends FrameGraphPass<FrameGraphContext> {\r\n protected _engine: AbstractEngine;\r\n protected _objectList: FrameGraphObjectList;\r\n\r\n /**\r\n * Checks if a pass is a cull pass.\r\n * @param pass The pass to check.\r\n * @returns True if the pass is a cull pass, else false.\r\n */\r\n public static IsCullPass(pass: IFrameGraphPass): pass is FrameGraphCullPass {\r\n return (pass as FrameGraphCullPass).setObjectList !== undefined;\r\n }\r\n\r\n /**\r\n * Gets the object list used by the cull pass.\r\n */\r\n public get objectList(): FrameGraphObjectList {\r\n return this._objectList;\r\n }\r\n\r\n /**\r\n * Sets the object list to use for culling.\r\n * @param objectList The object list to use for culling.\r\n */\r\n public setObjectList(objectList: FrameGraphObjectList) {\r\n this._objectList = objectList;\r\n }\r\n\r\n /** @internal */\r\n constructor(name: string, parentTask: FrameGraphTask, context: FrameGraphContext, engine: AbstractEngine) {\r\n super(name, parentTask, context);\r\n this._engine = engine;\r\n }\r\n\r\n /** @internal */\r\n public override _isValid(): Nullable<string> {\r\n const errMsg = super._isValid();\r\n return errMsg ? errMsg : this._objectList !== undefined ? null : \"Object list is not set (call setObjectList to set it)\";\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"cullPass.js","sourceRoot":"","sources":["../../../../../dev/core/src/FrameGraph/Passes/cullPass.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAExC;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,cAAiC;IAIrE;;;;OAIG;IACI,MAAM,CAAC,UAAU,CAAC,IAAqB;QAC1C,OAAQ,IAA2B,CAAC,aAAa,KAAK,SAAS,CAAC;IACpE,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACI,aAAa,CAAC,UAAgC;QACjD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAClC,CAAC;IAED,gBAAgB;IAChB,YAAY,IAAY,EAAE,UAA0B,EAAE,OAA0B,EAAE,MAAsB;QACpG,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QACjC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IAC1B,CAAC;IAED,gBAAgB;IACA,QAAQ;QACpB,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;QAChC,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,uDAAuD,CAAC;IAC7H,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { Nullable, AbstractEngine, IFrameGraphPass, FrameGraphContext, FrameGraphObjectList, FrameGraphTask } from \"core/index\";\r\nimport { FrameGraphPass } from \"./pass\";\r\n\r\n/**\r\n * Cull pass used to filter objects that are not visible.\r\n */\r\nexport class FrameGraphCullPass extends FrameGraphPass<FrameGraphContext> {\r\n protected readonly _engine: AbstractEngine;\r\n protected _objectList: FrameGraphObjectList;\r\n\r\n /**\r\n * Checks if a pass is a cull pass.\r\n * @param pass The pass to check.\r\n * @returns True if the pass is a cull pass, else false.\r\n */\r\n public static IsCullPass(pass: IFrameGraphPass): pass is FrameGraphCullPass {\r\n return (pass as FrameGraphCullPass).setObjectList !== undefined;\r\n }\r\n\r\n /**\r\n * Gets the object list used by the cull pass.\r\n */\r\n public get objectList(): FrameGraphObjectList {\r\n return this._objectList;\r\n }\r\n\r\n /**\r\n * Sets the object list to use for culling.\r\n * @param objectList The object list to use for culling.\r\n */\r\n public setObjectList(objectList: FrameGraphObjectList) {\r\n this._objectList = objectList;\r\n }\r\n\r\n /** @internal */\r\n constructor(name: string, parentTask: FrameGraphTask, context: FrameGraphContext, engine: AbstractEngine) {\r\n super(name, parentTask, context);\r\n this._engine = engine;\r\n }\r\n\r\n /** @internal */\r\n public override _isValid(): Nullable<string> {\r\n const errMsg = super._isValid();\r\n return errMsg ? errMsg : this._objectList !== undefined ? null : \"Object list is not set (call setObjectList to set it)\";\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { FrameGraph, FrameGraphContext } from "../../../index.js";
|
|
2
|
+
import { FrameGraphTask } from "../../frameGraphTask";
|
|
3
|
+
/**
|
|
4
|
+
* Task used to execute a custom function.
|
|
5
|
+
*/
|
|
6
|
+
export declare class FrameGraphExecuteTask extends FrameGraphTask {
|
|
7
|
+
/**
|
|
8
|
+
* The function to execute.
|
|
9
|
+
*/
|
|
10
|
+
func: (context: FrameGraphContext) => void;
|
|
11
|
+
/**
|
|
12
|
+
* The function to execute when the task is disabled (optional).
|
|
13
|
+
*/
|
|
14
|
+
funcDisabled?: (context: FrameGraphContext) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new execute task.
|
|
17
|
+
* @param name The name of the task.
|
|
18
|
+
* @param frameGraph The frame graph the task belongs to.
|
|
19
|
+
*/
|
|
20
|
+
constructor(name: string, frameGraph: FrameGraph);
|
|
21
|
+
record(): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { FrameGraphTask } from "../../frameGraphTask.js";
|
|
2
|
+
/**
|
|
3
|
+
* Task used to execute a custom function.
|
|
4
|
+
*/
|
|
5
|
+
export class FrameGraphExecuteTask extends FrameGraphTask {
|
|
6
|
+
/**
|
|
7
|
+
* Creates a new execute task.
|
|
8
|
+
* @param name The name of the task.
|
|
9
|
+
* @param frameGraph The frame graph the task belongs to.
|
|
10
|
+
*/
|
|
11
|
+
constructor(name, frameGraph) {
|
|
12
|
+
super(name, frameGraph);
|
|
13
|
+
}
|
|
14
|
+
record() {
|
|
15
|
+
if (!this.func) {
|
|
16
|
+
throw new Error("FrameGraphExecuteTask: Execute task must have a function.");
|
|
17
|
+
}
|
|
18
|
+
const pass = this._frameGraph.addPass(this.name);
|
|
19
|
+
pass.setExecuteFunc((context) => {
|
|
20
|
+
this.func(context);
|
|
21
|
+
});
|
|
22
|
+
const passDisabled = this._frameGraph.addPass(this.name + "_disabled", true);
|
|
23
|
+
passDisabled.setExecuteFunc((context) => {
|
|
24
|
+
this.funcDisabled?.(context);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=executeTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executeTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/Misc/executeTask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,cAAc;IAWrD;;;;OAIG;IACH,YAAY,IAAY,EAAE,UAAsB;QAC5C,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC5B,CAAC;IAEM,MAAM;QACT,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;QACjF,CAAC;QAED,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEjD,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE,EAAE;YAC5B,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;QAEH,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,GAAG,WAAW,EAAE,IAAI,CAAC,CAAC;QAE7E,YAAY,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE,EAAE;YACpC,IAAI,CAAC,YAAY,EAAE,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;IACP,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { FrameGraph, FrameGraphContext } from \"core/index\";\r\nimport { FrameGraphTask } from \"../../frameGraphTask\";\r\n\r\n/**\r\n * Task used to execute a custom function.\r\n */\r\nexport class FrameGraphExecuteTask extends FrameGraphTask {\r\n /**\r\n * The function to execute.\r\n */\r\n public func: (context: FrameGraphContext) => void;\r\n\r\n /**\r\n * The function to execute when the task is disabled (optional).\r\n */\r\n public funcDisabled?: (context: FrameGraphContext) => void;\r\n\r\n /**\r\n * Creates a new execute task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph the task belongs to.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph) {\r\n super(name, frameGraph);\r\n }\r\n\r\n public record() {\r\n if (!this.func) {\r\n throw new Error(\"FrameGraphExecuteTask: Execute task must have a function.\");\r\n }\r\n\r\n const pass = this._frameGraph.addPass(this.name);\r\n\r\n pass.setExecuteFunc((context) => {\r\n this.func(context);\r\n });\r\n\r\n const passDisabled = this._frameGraph.addPass(this.name + \"_disabled\", true);\r\n\r\n passDisabled.setExecuteFunc((context) => {\r\n this.funcDisabled?.(context);\r\n });\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { Camera } from "../../../index.js";
|
|
2
|
+
import { CascadedShadowGenerator } from "../../../Lights/Shadows/cascadedShadowGenerator";
|
|
3
|
+
import { FrameGraphShadowGeneratorTask } from "./shadowGeneratorTask";
|
|
4
|
+
/**
|
|
5
|
+
* Task used to generate a cascaded shadow map from a list of objects.
|
|
6
|
+
*/
|
|
7
|
+
export declare class FrameGraphCascadedShadowGeneratorTask extends FrameGraphShadowGeneratorTask {
|
|
8
|
+
protected _shadowGenerator: CascadedShadowGenerator | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Checks if a shadow generator task is a cascaded shadow generator task.
|
|
11
|
+
* @param task The task to check.
|
|
12
|
+
* @returns True if the task is a cascaded shadow generator task, else false.
|
|
13
|
+
*/
|
|
14
|
+
static IsCascadedShadowGenerator(task: FrameGraphShadowGeneratorTask): task is FrameGraphCascadedShadowGeneratorTask;
|
|
15
|
+
private _numCascades;
|
|
16
|
+
/**
|
|
17
|
+
* The number of cascades.
|
|
18
|
+
*/
|
|
19
|
+
get numCascades(): number;
|
|
20
|
+
set numCascades(value: number);
|
|
21
|
+
private _debug;
|
|
22
|
+
/**
|
|
23
|
+
* Gets or sets a value indicating whether the shadow generator should display the cascades.
|
|
24
|
+
*/
|
|
25
|
+
get debug(): boolean;
|
|
26
|
+
set debug(value: boolean);
|
|
27
|
+
private _stabilizeCascades;
|
|
28
|
+
/**
|
|
29
|
+
* Gets or sets a value indicating whether the shadow generator should stabilize the cascades.
|
|
30
|
+
*/
|
|
31
|
+
get stabilizeCascades(): boolean;
|
|
32
|
+
set stabilizeCascades(value: boolean);
|
|
33
|
+
private _lambda;
|
|
34
|
+
/**
|
|
35
|
+
* Gets or sets the lambda parameter of the shadow generator.
|
|
36
|
+
*/
|
|
37
|
+
get lambda(): number;
|
|
38
|
+
set lambda(value: number);
|
|
39
|
+
private _cascadeBlendPercentage;
|
|
40
|
+
/**
|
|
41
|
+
* Gets or sets the cascade blend percentage.
|
|
42
|
+
*/
|
|
43
|
+
get cascadeBlendPercentage(): number;
|
|
44
|
+
set cascadeBlendPercentage(value: number);
|
|
45
|
+
private _depthClamp;
|
|
46
|
+
/**
|
|
47
|
+
* Gets or sets a value indicating whether the shadow generator should use depth clamping.
|
|
48
|
+
*/
|
|
49
|
+
get depthClamp(): boolean;
|
|
50
|
+
set depthClamp(value: boolean);
|
|
51
|
+
private _autoCalcDepthBounds;
|
|
52
|
+
/**
|
|
53
|
+
* Gets or sets a value indicating whether the shadow generator should automatically calculate the depth bounds.
|
|
54
|
+
*/
|
|
55
|
+
get autoCalcDepthBounds(): boolean;
|
|
56
|
+
set autoCalcDepthBounds(value: boolean);
|
|
57
|
+
private _shadowMaxZ;
|
|
58
|
+
/**
|
|
59
|
+
* Gets or sets the maximum shadow Z value.
|
|
60
|
+
*/
|
|
61
|
+
get shadowMaxZ(): number;
|
|
62
|
+
set shadowMaxZ(value: number);
|
|
63
|
+
private _camera;
|
|
64
|
+
/**
|
|
65
|
+
* Gets or sets the camera used to generate the shadow generator.
|
|
66
|
+
*/
|
|
67
|
+
get camera(): Camera;
|
|
68
|
+
set camera(camera: Camera);
|
|
69
|
+
record(): void;
|
|
70
|
+
protected _createShadowGenerator(): void;
|
|
71
|
+
protected _setupShadowGenerator(): void;
|
|
72
|
+
}
|