{"record":{"id":"1191d13362f7f769","repo":"BabylonJS/Babylon.js","slug":"framegraphpostprocesstask-this-name-sourcete","errorCode":null,"errorMessage":"FrameGraphPostProcessTask \"${this.name}\": sourceTexture or targetTexture is required","messagePattern":"FrameGraphPostProcessTask \"(.+?)\": sourceTexture or targetTexture is required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/FrameGraph/Tasks/PostProcesses/postProcessTask.ts","lineNumber":158,"sourceCode":"        this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n        this.outputDepthAttachmentTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n    }\r\n\r\n    public override isReady() {\r\n        return this.postProcess.isReady();\r\n    }\r\n\r\n    public override getClassName(): string {\r\n        return \"FrameGraphPostProcessTask\";\r\n    }\r\n\r\n    public record(\r\n        skipCreationOfDisabledPasses = false,\r\n        additionalExecute?: (context: FrameGraphRenderContext) => void,\r\n        additionalBindings?: (context: FrameGraphRenderContext) => void\r\n    ): FrameGraphRenderPass {\r\n        if (this.sourceTexture === undefined && this.targetTexture === undefined) {\r\n            throw new Error(`FrameGraphPostProcessTask \"${this.name}\": sourceTexture or targetTexture is required`);\r\n        }\r\n\r\n        const sourceTextureCreationOptions = this.sourceTexture !== undefined ? this._frameGraph.textureManager.getTextureCreationOptions(this.sourceTexture) : undefined;\r\n        if (sourceTextureCreationOptions) {\r\n            sourceTextureCreationOptions.options.samples = 1;\r\n        }\r\n\r\n        this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.targetTexture, this.name, sourceTextureCreationOptions);\r\n        if (this.depthAttachmentTexture !== undefined) {\r\n            this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthAttachmentTexture, this.depthAttachmentTexture);\r\n        }\r\n\r\n        if (sourceTextureCreationOptions) {\r\n            const sourceSize = this._frameGraph.textureManager.getTextureAbsoluteDimensions(sourceTextureCreationOptions);\r\n\r\n            this._sourceWidth = sourceSize.width;\r\n            this._sourceHeight = sourceSize.height;\r\n        }\r","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/FrameGraph/Tasks/PostProcesses/postProcessTask.ts#L140-L176","documentation":"The base FrameGraphPostProcessTask.record() requires at least one of sourceTexture (input to the post-process) or targetTexture (destination) to be defined; when both are undefined it cannot create the pass and throws. This guard is inherited by all concrete post-process tasks that call super.record().","triggerScenarios":"Adding any FrameGraphPostProcessTask-derived task and building the graph with neither task.sourceTexture nor task.targetTexture assigned.","commonSituations":"Creating a generic post-process task (e.g. for a custom shader) and forgetting all texture wiring; refactoring that removed the source assignment; conditional pipelines where every texture assignment was skipped.","solutions":["Assign task.sourceTexture to the input texture handle (most common fix).","Or assign task.targetTexture if the post-process should render into a specific target without a sampled source.","Verify the task's constructor parameters/order didn't shift in a Babylon upgrade, leaving properties unset."],"exampleFix":"// before\nconst pp = new FrameGraphPostProcessTask(frameGraph, \"tint\", postProcess);\nframeGraph.addTask(pp);\n\n// after\nconst pp = new FrameGraphPostProcessTask(frameGraph, \"tint\", postProcess);\npp.sourceTexture = sceneColorTask.outputTexture;\nframeGraph.addTask(pp);","handlingStrategy":"validation","validationCode":"if (ppTask.sourceTexture === undefined && ppTask.targetTexture === undefined) {\n  throw new Error(\"Post-process task needs sourceTexture or targetTexture before build\");\n}","typeGuard":"function hasPostProcessTarget(t: { sourceTexture?: unknown; targetTexture?: unknown }): boolean {\n  return t.sourceTexture !== undefined || t.targetTexture !== undefined;\n}","tryCatchPattern":"try {\n  frameGraph.build();\n} catch (e) {\n  if (String(e?.message).includes(\"sourceTexture or targetTexture is required\")) {\n    console.error(\"Post-process task has no input/output wired:\", e.message);\n  } else { throw e; }\n}","preventionTips":["For custom post-process tasks, always wire at least the source texture.","Check constructor argument order after Babylon upgrades — property assignment is usually safer.","Run graph build in a dev-mode validation pass that pre-checks all tasks."],"tags":["babylonjs","frame-graph","post-process","missing-texture","configuration"],"backgroundTag":"framegraph-task-missing-texture","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}