{"record":{"id":"b5c0a5707787445c","repo":"BabylonJS/Babylon.js","slug":"framegraphanaglyphtask-this-name-sourcetextu","errorCode":null,"errorMessage":"FrameGraphAnaglyphTask \"${this.name}\": sourceTexture and leftTexture are required","messagePattern":"FrameGraphAnaglyphTask \"(.+?)\": sourceTexture and leftTexture are required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/FrameGraph/Tasks/PostProcesses/anaglyphTask.ts","lineNumber":32,"sourceCode":"    public override readonly postProcess: ThinAnaglyphPostProcess;\r\n\r\n    /**\r\n     * Constructs a new anaglyph task.\r\n     * @param name The name of the task.\r\n     * @param frameGraph The frame graph this task is associated with.\r\n     * @param thinPostProcess The thin post process to use for the anaglyph effect. If not provided, a new one will be created.\r\n     */\r\n    constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinAnaglyphPostProcess) {\r\n        super(name, frameGraph, thinPostProcess || new ThinAnaglyphPostProcess(name, frameGraph.engine));\r\n    }\r\n\r\n    public override getClassName(): string {\r\n        return \"FrameGraphAnaglyphTask\";\r\n    }\r\n\r\n    public override record(skipCreationOfDisabledPasses = false): FrameGraphRenderPass {\r\n        if (this.sourceTexture === undefined || this.leftTexture === undefined) {\r\n            throw new Error(`FrameGraphAnaglyphTask \"${this.name}\": sourceTexture and leftTexture are required`);\r\n        }\r\n\r\n        const pass = super.record(skipCreationOfDisabledPasses, undefined, (context) => {\r\n            context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"leftSampler\", this.leftTexture);\r\n        });\r\n\r\n        pass.addDependencies(this.leftTexture);\r\n\r\n        return pass;\r\n    }\r\n}\r\n","sourceCodeStart":14,"sourceCodeEnd":44,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/FrameGraph/Tasks/PostProcesses/anaglyphTask.ts#L14-L44","documentation":"FrameGraphAnaglyphTask combines a source image with a left-eye image to produce an anaglyph (red/cyan) post-process, so both sourceTexture and leftTexture handles must be set. record() throws if either is undefined before creating the render pass.","triggerScenarios":"anaglyphTask.record() with task.sourceTexture === undefined or task.leftTexture === undefined.","commonSituations":"Setting only sourceTexture and assuming the left input is optional; forgetting to wire the left-eye render target from a preceding camera/renderer task; copying a non-stereo post-process setup pattern.","solutions":["Assign task.sourceTexture to the right/source texture handle before record().","Assign task.leftTexture to the left-eye render target output of a left-camera task.","Ensure both upstream tasks producing these textures are recorded before the anaglyph task."],"exampleFix":"// before\nanaglyphTask.sourceTexture = rightCamTask.output;\n// after\nanaglyphTask.sourceTexture = rightCamTask.output;\nanaglyphTask.leftTexture = leftCamTask.output;","handlingStrategy":"validation","validationCode":"if (anaglyphTask.sourceTexture === undefined || anaglyphTask.leftTexture === undefined) {\n  throw new Error(\"AnaglyphTask requires sourceTexture and leftTexture\");\n}","typeGuard":"function isAnaglyphReady(task: FrameGraphAnaglyphTask): boolean {\n  return task.sourceTexture !== undefined && task.leftTexture !== undefined;\n}","tryCatchPattern":"try {\n  anaglyphTask.record();\n} catch (e) {\n  if (String(e).includes(\"sourceTexture and leftTexture are required\")) {\n    console.error(\"Bind both eyes' render targets before recording the anaglyph task\");\n  } else throw e;\n}","preventionTips":["Wire right-camera output to sourceTexture and left-camera output to leftTexture together.","Never reuse single-camera post-process wiring for stereo tasks.","Validate all task inputs before calling frameGraph.build()."],"tags":["frame-graph","post-process","anaglyph","missing-input"],"backgroundTag":"required-input-missing","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}