BabylonJS/Babylon.js · error · Error
FrameGraphBloomMergeTask "${this.name}": sourceTexture and b
Error message
FrameGraphBloomMergeTask "${this.name}": sourceTexture and blurTexture are required What it means
FrameGraphBloomMergeTask merges the source image with a blurred bloom texture, requiring both sourceTexture and blurTexture inputs. record() throws when either handle is undefined.
Source
Thrown at packages/dev/core/src/FrameGraph/Tasks/PostProcesses/bloomMergeTask.ts:23
/**
* @internal
*/
export class FrameGraphBloomMergeTask extends FrameGraphPostProcessTask {
public blurTexture: FrameGraphTextureHandle;
public override readonly postProcess: ThinBloomMergePostProcess;
constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinBloomMergePostProcess) {
super(name, frameGraph, thinPostProcess || new ThinBloomMergePostProcess(name, frameGraph.engine));
}
public override getClassName(): string {
return "FrameGraphBloomMergeTask";
}
public override record(skipCreationOfDisabledPasses = false): FrameGraphRenderPass {
if (this.sourceTexture === undefined || this.blurTexture === undefined) {
throw new Error(`FrameGraphBloomMergeTask "${this.name}": sourceTexture and blurTexture are required`);
}
const pass = super.record(skipCreationOfDisabledPasses, undefined, (context) => {
context.bindTextureHandle(this._postProcessDrawWrapper.effect!, "bloomBlur", this.blurTexture);
});
pass.addDependencies(this.blurTexture);
return pass;
}
}
View on GitHub (pinned to 0592b347b8)
Solutions
- Assign task.sourceTexture to the original scene/source texture handle.
- Assign task.blurTexture to the output of the bloom blur (upsampled) task.
- Verify the bloom blur task is recorded before the merge task in the graph.
Example fix
// before bloomMergeTask.sourceTexture = sceneColorTask.output; context.build(); // after bloomMergeTask.sourceTexture = sceneColorTask.output; bloomMergeTask.blurTexture = bloomUpsampleTask.output; context.build();
Defensive patterns
Strategy: validation
Validate before calling
if (bloomMergeTask.sourceTexture === undefined || bloomMergeTask.blurTexture === undefined) {
throw new Error("BloomMergeTask requires sourceTexture and blurTexture");
} Type guard
function isBloomMergeReady(task: FrameGraphBloomMergeTask): boolean {
return task.sourceTexture !== undefined && task.blurTexture !== undefined;
} Try / catch
try {
bloomMergeTask.record();
} catch (e) {
if (String(e).includes("sourceTexture and blurTexture are required")) {
console.error("Ensure the bloom blur task runs before the merge task and its output is bound");
} else throw e;
} Prevention
- Always pair bloom merge with an upstream bloom blur task and bind its output.
- Order tasks: source -> downsample/blur -> upsample -> merge.
- Add a build-time input completeness check.
When it happens
Trigger: bloomMergeTask.record() with task.sourceTexture === undefined or task.blurTexture === undefined.
Common situations: Using the merge task standalone without the accompanying bloom (downsample/upsample) task that produces blurTexture; failing to link the blur task's output; reordering tasks so inputs are wired after record().
Related errors
- FrameGraphBloomTask: sourceTexture is required
- FrameGraphAnaglyphTask "${this.name}": sourceTexture and lef
- FrameGraphCircleOfConfusionTask "${this.name}": sourceTextur
- FrameGraphSSAO2Task "${this.name}": sourceTexture, depthText
- FrameGraphSelectionOutlineLayerTask "${this.name}": depthTex
AI-assisted analysis of BabylonJS/Babylon.js@0592b347b8 (2026-08-30).
Data as JSON: /api/errors/469db28f5adf6a9c.
Report an issue: GitHub.