{"record":{"id":"fb1fa9ec5d66c341","repo":"BabylonJS/Babylon.js","slug":"framegraphscreenspacecurvaturetask-this-name","errorCode":null,"errorMessage":"FrameGraphScreenSpaceCurvatureTask \"${this.name}\": sourceTexture and normalTexture are required","messagePattern":"FrameGraphScreenSpaceCurvatureTask \"(.+?)\": sourceTexture and normalTexture are required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/FrameGraph/Tasks/PostProcesses/screenSpaceCurvatureTask.ts","lineNumber":33,"sourceCode":"    public override readonly postProcess: ThinScreenSpaceCurvaturePostProcess;\r\n\r\n    /**\r\n     * Constructs a new circle of confusion task.\r\n     * @param name The name of the task.\r\n     * @param frameGraph The frame graph this task belongs to.\r\n     * @param thinPostProcess The thin post process to use for the task. If not provided, a new one will be created.\r\n     */\r\n    constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinScreenSpaceCurvaturePostProcess) {\r\n        super(name, frameGraph, thinPostProcess || new ThinScreenSpaceCurvaturePostProcess(name, frameGraph.engine));\r\n    }\r\n\r\n    public override getClassName(): string {\r\n        return \"FrameGraphScreenSpaceCurvatureTask\";\r\n    }\r\n\r\n    public override record(skipCreationOfDisabledPasses = false): FrameGraphRenderPass {\r\n        if (this.sourceTexture === undefined || this.normalTexture === undefined) {\r\n            throw new Error(`FrameGraphScreenSpaceCurvatureTask \"${this.name}\": sourceTexture and normalTexture are required`);\r\n        }\r\n\r\n        const pass = super.record(skipCreationOfDisabledPasses, undefined, (context) => {\r\n            context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"normalSampler\", this.normalTexture);\r\n        });\r\n\r\n        pass.addDependencies(this.normalTexture);\r\n\r\n        return pass;\r\n    }\r\n}\r\n","sourceCodeStart":15,"sourceCodeEnd":45,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/FrameGraph/Tasks/PostProcesses/screenSpaceCurvatureTask.ts#L15-L45","documentation":"FrameGraphScreenSpaceCurvatureTask.record() requires both sourceTexture (color input) and normalTexture (the normal buffer from which curvature is derived); either being undefined aborts recording. The normal texture is additionally bound as \"normalSampler\" in the pass bindings.","triggerScenarios":"Adding the screen-space curvature task and building the graph without assigning task.sourceTexture or task.normalTexture (typically a normals prepass output).","commonSituations":"No normals prepass task in the frame graph; wiring only the color source and assuming normals are implicit; upgrading from the legacy SSAO2/curvature pipeline where normal wiring was automatic.","solutions":["Assign task.normalTexture to a normals texture handle from a normals-enabled prepass/object renderer task.","Assign task.sourceTexture to the color texture handle.","Ensure the normals-producing task is added to the graph before the curvature task."],"exampleFix":"// before\nconst curvature = new FrameGraphScreenSpaceCurvatureTask(frameGraph, \"curvature\");\ncurvature.sourceTexture = colorTask.outputTexture;\n\n// after\nconst curvature = new FrameGraphScreenSpaceCurvatureTask(frameGraph, \"curvature\");\ncurvature.sourceTexture = colorTask.outputTexture;\ncurvature.normalTexture = normalsPrepassTask.outputTexture;","handlingStrategy":"validation","validationCode":"if (curvatureTask.sourceTexture === undefined || curvatureTask.normalTexture === undefined) {\n  throw new Error(\"Curvature task missing sourceTexture/normalTexture before build\");\n}","typeGuard":"function hasCurvatureInputs(t: { sourceTexture?: unknown; normalTexture?: unknown }): boolean {\n  return t.sourceTexture !== undefined && t.normalTexture !== undefined;\n}","tryCatchPattern":"try {\n  frameGraph.build();\n} catch (e) {\n  if (String(e?.message).includes(\"sourceTexture and normalTexture are required\")) {\n    console.error(\"Curvature task not wired:\", e.message);\n  } else { throw e; }\n}","preventionTips":["Add a normals prepass task whenever you use screen-space curvature.","Verify the normals texture is from the same camera/renderer as the source color.","Keep prepass creation and effect-task wiring in the same setup function."],"tags":["babylonjs","frame-graph","curvature","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"}