{"record":{"id":"ff8acafccaf14fa4","repo":"BabylonJS/Babylon.js","slug":"framegraphvolumetriclightingblendvolumetask-thi","errorCode":null,"errorMessage":"FrameGraphVolumetricLightingBlendVolumeTask \"${this.name}\": sourceTexture, depthTexture and camera are required","messagePattern":"FrameGraphVolumetricLightingBlendVolumeTask \"(.+?)\": sourceTexture, depthTexture and camera are required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/FrameGraph/Tasks/PostProcesses/volumetricLightingBlendVolumeTask.ts","lineNumber":89,"sourceCode":" */\r\nexport class FrameGraphVolumetricLightingBlendVolumeTask extends FrameGraphPostProcessTask {\r\n    public override readonly postProcess: VolumetricLightingBlendVolumeThinPostProcess;\r\n\r\n    public depthTexture: FrameGraphTextureHandle;\r\n\r\n    public camera: Camera;\r\n\r\n    constructor(name: string, frameGraph: FrameGraph, enableExtinction = false) {\r\n        super(name, frameGraph, new VolumetricLightingBlendVolumeThinPostProcess(name, frameGraph.engine, enableExtinction));\r\n    }\r\n\r\n    public override getClassName(): string {\r\n        return \"FrameGraphVolumetricLightingBlendVolumeTask\";\r\n    }\r\n\r\n    public override record(skipCreationOfDisabledPasses = false): FrameGraphRenderPass {\r\n        if (this.sourceTexture === undefined || this.depthTexture === undefined || this.camera === undefined) {\r\n            throw new Error(`FrameGraphVolumetricLightingBlendVolumeTask \"${this.name}\": sourceTexture, depthTexture and camera are required`);\r\n        }\r\n\r\n        const pass = super.record(skipCreationOfDisabledPasses, undefined, (context) => {\r\n            this.postProcess.camera = this.camera;\r\n            context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"depthSampler\", this.depthTexture);\r\n        });\r\n\r\n        pass.addDependencies(this.depthTexture);\r\n\r\n        this.postProcess.outputTextureWidth = this._outputWidth;\r\n        this.postProcess.outputTextureHeight = this._outputHeight;\r\n\r\n        return pass;\r\n    }\r\n}\r\n","sourceCodeStart":71,"sourceCodeEnd":105,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/FrameGraph/Tasks/PostProcesses/volumetricLightingBlendVolumeTask.ts#L71-L105","documentation":"FrameGraphVolumetricLightingBlendVolumeTask.record() requires sourceTexture, depthTexture and camera to be assigned before recording the blend pass that composites volumetric lighting into the scene using the depth buffer. If any of the three is undefined the pass cannot bind its samplers, so the library throws this descriptive error at record time as part of the frame graph task's fail-fast validation.","triggerScenarios":"Calling record() (directly or through FrameGraph.build()) on a FrameGraphVolumetricLightingBlendVolumeTask when sourceTexture, depthTexture or camera is undefined — i.e. the volumetric lighting task's output, the scene depth texture handle, or the camera was never assigned to the task's input properties.","commonSituations":"Setting up volumetric lighting in a frame graph but forgetting to pass the depth texture; using a volumetric light setup where the volumetric lighting task output was never linked as sourceTexture; camera not assigned after constructing the task; building the graph before the volumetric lighting task has been added/recorded.","solutions":["Assign task.sourceTexture from the volumetric lighting task's output texture and task.depthTexture from the depth texture handle before build()","Set task.camera to the rendering camera","Ensure the volumetric lighting task and depth-producing task are added to the frame graph before the blend task","Check the three properties for undefined right before FrameGraph.build() to identify the missing one"],"exampleFix":"// before\nconst blendTask = new FrameGraphVolumetricLightingBlendVolumeTask(\"blend\", frameGraph);\nframeGraph.addTask(blendTask);\nframeGraph.build(); // throws: sourceTexture, depthTexture and camera required\n\n// after\nblendTask.sourceTexture = volumetricLightingTask.outputTexture;\nblendTask.depthTexture = depthTextureTask.outputTexture;\nblendTask.camera = frameGraph.scene.activeCamera;\nframeGraph.build();","handlingStrategy":"validation","validationCode":"const required = { sourceTexture: blendTask.sourceTexture, depthTexture: blendTask.depthTexture, camera: blendTask.camera };\nconst missing = Object.entries(required).filter(([, v]) => v === undefined).map(([k]) => k);\nif (missing.length) throw new Error(`Volumetric blend task missing inputs: ${missing.join(\", \")}`);","typeGuard":"function hasBlendVolumeInputs(t) { return t.sourceTexture !== undefined && t.depthTexture !== undefined && t.camera !== undefined; }","tryCatchPattern":"try { frameGraph.build(); } catch (e) { if (String(e.message).includes(\"sourceTexture, depthTexture and camera are required\")) { console.error(\"Volumetric lighting blend task inputs not wired\"); } else { throw e; } }","preventionTips":["Link the volumetric lighting task's output as sourceTexture before build()","Do not forget the depth texture — the blend pass needs it to composite volumetrics correctly","Set camera explicitly at graph setup time","Add volumetric lighting and depth tasks to the graph before the blend task"],"tags":["babylonjs","frame-graph","volumetric-lighting","missing-input"],"backgroundTag":"missing-required-task-input","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}