UNPKG

@babylonjs/core

Version:

Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.

48 lines 2.04 kB
import { RegisterClass } from "../../../../Misc/typeStore.js"; import { NodeRenderGraphBlockConnectionPointTypes } from "../../Types/nodeRenderGraphTypes.js"; import { FrameGraphAnaglyphTask } from "../../../Tasks/PostProcesses/anaglyphTask.js"; import { ThinAnaglyphPostProcess } from "../../../../PostProcesses/thinAnaglyphPostProcess.js"; import { NodeRenderGraphBasePostProcessBlock } from "./basePostProcessBlock.js"; /** * Block that implements the anaglyph post process */ export class NodeRenderGraphAnaglyphPostProcessBlock extends NodeRenderGraphBasePostProcessBlock { /** * Gets the frame graph task associated with this block */ get task() { return this._frameGraphTask; } /** * Create a new NodeRenderAnaglyphPostProcessBlock * @param name defines the block name * @param frameGraph defines the hosting frame graph * @param scene defines the hosting scene */ constructor(name, frameGraph, scene) { super(name, frameGraph, scene); this.registerInput("leftTexture", NodeRenderGraphBlockConnectionPointTypes.AutoDetect); this.leftTexture.addExcludedConnectionPointFromAllowedTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer); this._finalizeInputOutputRegistering(); this._frameGraphTask = new FrameGraphAnaglyphTask(this.name, frameGraph, new ThinAnaglyphPostProcess(name, scene.getEngine())); } /** * Gets the current class name * @returns the class name */ getClassName() { return "NodeRenderGraphAnaglyphPostProcessBlock"; } /** * Gets the left texture input component */ get leftTexture() { return this._inputs[2]; } _buildBlock(state) { super._buildBlock(state); this._frameGraphTask.leftTexture = this.leftTexture.connectedPoint?.value; } } RegisterClass("BABYLON.NodeRenderGraphAnaglyphPostProcessBlock", NodeRenderGraphAnaglyphPostProcessBlock); //# sourceMappingURL=anaglyphPostProcessBlock.js.map