{"record":{"id":"4a52350edbbbb176","repo":"BabylonJS/Babylon.js","slug":"framegraphssao2blurtask-this-name-sourcetext","errorCode":null,"errorMessage":"FrameGraphSSAO2BlurTask \"${this.name}\": sourceTexture and depthTexture are required","messagePattern":"FrameGraphSSAO2BlurTask \"(.+?)\": sourceTexture and depthTexture are required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/FrameGraph/Tasks/PostProcesses/ssao2BlurTask.ts","lineNumber":29,"sourceCode":"\r\n    public depthTexture: FrameGraphTextureHandle;\r\n\r\n    constructor(\r\n        name: string,\r\n        frameGraph: FrameGraph,\r\n        private _isHorizontal: boolean,\r\n        thinPostProcess?: ThinSSAO2BlurPostProcess\r\n    ) {\r\n        super(name, frameGraph, thinPostProcess || new ThinSSAO2BlurPostProcess(name, frameGraph.engine, _isHorizontal));\r\n    }\r\n\r\n    public override getClassName(): string {\r\n        return \"FrameGraphSSAO2BlurTask\";\r\n    }\r\n\r\n    public override record(skipCreationOfDisabledPasses = false): FrameGraphRenderPass {\r\n        if (this.sourceTexture === undefined || this.depthTexture === undefined) {\r\n            throw new Error(`FrameGraphSSAO2BlurTask \"${this.name}\": sourceTexture and depthTexture are required`);\r\n        }\r\n\r\n        const pass = super.record(\r\n            skipCreationOfDisabledPasses,\r\n            (context) => {\r\n                context.setTextureSamplingMode(this.depthTexture, Constants.TEXTURE_BILINEAR_SAMPLINGMODE);\r\n            },\r\n            (context) => {\r\n                context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"depthSampler\", this.depthTexture);\r\n            }\r\n        );\r\n\r\n        this.postProcess.textureSize = this._isHorizontal ? this._outputWidth : this._outputHeight;\r\n\r\n        return pass;\r\n    }\r\n}\r\n","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/FrameGraph/Tasks/PostProcesses/ssao2BlurTask.ts#L11-L47","documentation":"FrameGraphSSAO2BlurTask.record() requires sourceTexture (the SSAO term to blur) and depthTexture (used for depth-aware blurring); either being undefined aborts recording. The depth texture is also switched to bilinear sampling mode as part of setup.","triggerScenarios":"Adding an SSAO2 blur task between the SSAO render and combine tasks without assigning task.sourceTexture or task.depthTexture before build()/render.","commonSituations":"Manually assembling the SSAO2 pipeline (render -> blur -> combine) and skipping the blur task wiring; depth texture handle coming from a different camera/task than the SSAO output; graph refactors that renamed upstream tasks.","solutions":["Assign task.sourceTexture to the SSAO2 render task's output texture.","Assign task.depthTexture to the matching depth texture handle.","Add the SSAO2 render task to the graph before the blur task.","Confirm both assignments survive any dynamic reconfiguration of the graph."],"exampleFix":"// before\nconst blur = new FrameGraphSSAO2BlurTask(frameGraph, \"ssaoBlur\");\nframeGraph.addTask(blur);\n\n// after\nconst blur = new FrameGraphSSAO2BlurTask(frameGraph, \"ssaoBlur\");\nblur.sourceTexture = ssaoRenderTask.outputTexture;\nblur.depthTexture = depthTask.outputTexture;\nframeGraph.addTask(blur);","handlingStrategy":"validation","validationCode":"if (blurTask.sourceTexture === undefined || blurTask.depthTexture === undefined) {\n  throw new Error(\"SSAO2 blur task missing sourceTexture/depthTexture before build\");\n}","typeGuard":"function hasSSAO2BlurInputs(t: { sourceTexture?: unknown; depthTexture?: unknown }): boolean {\n  return t.sourceTexture !== undefined && t.depthTexture !== undefined;\n}","tryCatchPattern":"try {\n  frameGraph.build();\n} catch (e) {\n  if (String(e?.message).includes(\"sourceTexture and depthTexture are required\")) {\n    console.error(\"SSAO2 blur task not wired:\", e.message);\n  } else { throw e; }\n}","preventionTips":["Chain SSAO2 render -> blur -> combine assignments together in one code block.","Ensure the depth texture belongs to the same camera as the SSAO render.","Validate each pipeline stage's inputs as you add it to the graph."],"tags":["babylonjs","frame-graph","ssao2","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"}