{"record":{"id":"28934431bd953c3b","repo":"BabylonJS/Babylon.js","slug":"framegraphdepthoffieldblurtask-this-name-sou","errorCode":null,"errorMessage":"FrameGraphDepthOfFieldBlurTask \"${this.name}\": sourceTexture and circleOfConfusionTexture are required","messagePattern":"FrameGraphDepthOfFieldBlurTask \"(.+?)\": sourceTexture and circleOfConfusionTexture are required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.ts","lineNumber":25,"sourceCode":"/**\r\n * @internal\r\n */\r\nexport class FrameGraphDepthOfFieldBlurTask extends FrameGraphBlurTask {\r\n    public circleOfConfusionTexture: FrameGraphTextureHandle;\r\n\r\n    public circleOfConfusionSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n\r\n    constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinDepthOfFieldBlurPostProcess) {\r\n        super(name, frameGraph, thinPostProcess || new ThinDepthOfFieldBlurPostProcess(name, frameGraph.engine, new Vector2(1, 0), 10));\r\n    }\r\n\r\n    public override getClassName(): string {\r\n        return \"FrameGraphDepthOfFieldBlurTask\";\r\n    }\r\n\r\n    public override record(skipCreationOfDisabledPasses = false): FrameGraphRenderPass {\r\n        if (this.sourceTexture === undefined || this.circleOfConfusionTexture === undefined) {\r\n            throw new Error(`FrameGraphDepthOfFieldBlurTask \"${this.name}\": sourceTexture and circleOfConfusionTexture are required`);\r\n        }\r\n\r\n        const pass = super.record(\r\n            skipCreationOfDisabledPasses,\r\n            (context) => {\r\n                context.setTextureSamplingMode(this.circleOfConfusionTexture, this.circleOfConfusionSamplingMode);\r\n            },\r\n            (context) => {\r\n                context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"circleOfConfusionSampler\", this.circleOfConfusionTexture);\r\n            }\r\n        );\r\n\r\n        pass.addDependencies(this.circleOfConfusionTexture);\r\n\r\n        return pass;\r\n    }\r\n}\r\n","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.ts#L7-L43","documentation":"FrameGraphDepthOfFieldBlurTask.record() validates its inputs before building the render pass. It throws when either sourceTexture (the scene color to blur) or circleOfConfusionTexture (the CoC mask driving the blur radius) is still undefined. Babylon.js frame-graph tasks defer all setup to record(), so missing texture handles are only detected at that point.","triggerScenarios":"Calling frameGraph.addTask(new FrameGraphDepthOfFieldBlurTask(...)) and then frameGraph.build()/render without assigning task.sourceTexture or task.circleOfConfusionTexture a valid texture handle (e.g. from textureManager.createTexture or another task's output).","commonSituations":"Forgetting to wire the DoF chain's blur task outputs; renaming task properties after a Babylon upgrade; building the graph before upstream tasks have produced their output handles; copy-pasting a DoF setup and dropping the CoC texture assignment.","solutions":["Assign task.sourceTexture to a valid texture handle before building/rendering the frame graph.","Assign task.circleOfConfusionTexture, typically the output of a FrameGraphCircleOfConfusionTask.","Verify task ordering so upstream tasks (CoC generation) are added before the blur task.","Log both properties right before frameGraph.build() to confirm they are defined."],"exampleFix":"// before\nconst blur = new FrameGraphDepthOfFieldBlurTask(frameGraph, \"dofBlur\");\nframeGraph.addTask(blur);\n\n// after\nconst blur = new FrameGraphDepthOfFieldBlurTask(frameGraph, \"dofBlur\");\nblur.sourceTexture = sceneTask.outputTexture;\nblur.circleOfConfusionTexture = cocTask.outputTexture;\nframeGraph.addTask(blur);","handlingStrategy":"validation","validationCode":"if (blurTask.sourceTexture === undefined || blurTask.circleOfConfusionTexture === undefined) {\n  throw new Error(\"DoF blur task missing sourceTexture/circleOfConfusionTexture before build\");\n}","typeGuard":"function hasDoFBlurInputs(t: { sourceTexture?: unknown; circleOfConfusionTexture?: unknown }): boolean {\n  return t.sourceTexture !== undefined && t.circleOfConfusionTexture !== undefined;\n}","tryCatchPattern":"try {\n  frameGraph.build();\n} catch (e) {\n  if (String(e?.message).includes(\"sourceTexture and circleOfConfusionTexture are required\")) {\n    console.error(\"DoF blur task not wired:\", e.message);\n  } else { throw e; }\n}","preventionTips":["Write a small assert helper that validates all task inputs immediately after construction.","Keep CoC/blur/merge tasks adjacent in code so missing wiring is visible in review.","Never call build() in a partial-graph setup path without validating every added task."],"tags":["babylonjs","frame-graph","depth-of-field","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"}