BabylonJS/Babylon.js · error · Error
FrameGraphSSAO2BlurTask "${this.name}": sourceTexture and de
Error message
FrameGraphSSAO2BlurTask "${this.name}": sourceTexture and depthTexture are required What it means
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.
Source
Thrown at packages/dev/core/src/FrameGraph/Tasks/PostProcesses/ssao2BlurTask.ts:29
public depthTexture: FrameGraphTextureHandle;
constructor(
name: string,
frameGraph: FrameGraph,
private _isHorizontal: boolean,
thinPostProcess?: ThinSSAO2BlurPostProcess
) {
super(name, frameGraph, thinPostProcess || new ThinSSAO2BlurPostProcess(name, frameGraph.engine, _isHorizontal));
}
public override getClassName(): string {
return "FrameGraphSSAO2BlurTask";
}
public override record(skipCreationOfDisabledPasses = false): FrameGraphRenderPass {
if (this.sourceTexture === undefined || this.depthTexture === undefined) {
throw new Error(`FrameGraphSSAO2BlurTask "${this.name}": sourceTexture and depthTexture are required`);
}
const pass = super.record(
skipCreationOfDisabledPasses,
(context) => {
context.setTextureSamplingMode(this.depthTexture, Constants.TEXTURE_BILINEAR_SAMPLINGMODE);
},
(context) => {
context.bindTextureHandle(this._postProcessDrawWrapper.effect!, "depthSampler", this.depthTexture);
}
);
this.postProcess.textureSize = this._isHorizontal ? this._outputWidth : this._outputHeight;
return pass;
}
}
View on GitHub (pinned to 0592b347b8)
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.
Example fix
// before const blur = new FrameGraphSSAO2BlurTask(frameGraph, "ssaoBlur"); frameGraph.addTask(blur); // after const blur = new FrameGraphSSAO2BlurTask(frameGraph, "ssaoBlur"); blur.sourceTexture = ssaoRenderTask.outputTexture; blur.depthTexture = depthTask.outputTexture; frameGraph.addTask(blur);
Defensive patterns
Strategy: validation
Validate before calling
if (blurTask.sourceTexture === undefined || blurTask.depthTexture === undefined) {
throw new Error("SSAO2 blur task missing sourceTexture/depthTexture before build");
} Type guard
function hasSSAO2BlurInputs(t: { sourceTexture?: unknown; depthTexture?: unknown }): boolean {
return t.sourceTexture !== undefined && t.depthTexture !== undefined;
} Try / catch
try {
frameGraph.build();
} catch (e) {
if (String(e?.message).includes("sourceTexture and depthTexture are required")) {
console.error("SSAO2 blur task not wired:", e.message);
} else { throw e; }
} Prevention
- 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.
When it happens
Trigger: Adding an SSAO2 blur task between the SSAO render and combine tasks without assigning task.sourceTexture or task.depthTexture before build()/render.
Common situations: 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.
Related errors
- FrameGraphSSAO2RenderingPipelineTask "${this.name}": sourceT
- FrameGraphDepthOfFieldBlurTask "${this.name}": sourceTexture
- FrameGraphBloomMergeTask "${this.name}": sourceTexture, circ
- FrameGraphDepthOfFieldTask: sourceTexture, depthTexture and
- FrameGraphMotionBlurTask "${this.name}": sourceTexture is re
AI-assisted analysis of BabylonJS/Babylon.js@0592b347b8 (2026-08-30).
Data as JSON: /api/errors/4a52350edbbbb176.
Report an issue: GitHub.