{"record":{"id":"fa6a8f1f7f8936ba","repo":"BabylonJS/Babylon.js","slug":"framegraphssao2renderingpipelinetask-this-name","errorCode":null,"errorMessage":"FrameGraphSSAO2RenderingPipelineTask \"${this.name}\": sourceTexture, depthTexture, normalTexture and camera are required","messagePattern":"FrameGraphSSAO2RenderingPipelineTask \"(.+?)\": sourceTexture, depthTexture, normalTexture and camera are required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/FrameGraph/Tasks/PostProcesses/ssao2RenderingPipelineTask.ts","lineNumber":160,"sourceCode":"        this._ssao = new FrameGraphSSAO2Task(`${name} SSAO2 main`, this._frameGraph, this.ssao._ssaoPostProcess);\r\n        this._ssaoBlurX = new FrameGraphSSAO2BlurTask(`${name} SSAO2 Blur X`, this._frameGraph, true, this.ssao._ssaoBlurXPostProcess);\r\n        this._ssaoBlurY = new FrameGraphSSAO2BlurTask(`${name} SSAO2 Blur Y`, this._frameGraph, false, this.ssao._ssaoBlurYPostProcess);\r\n        this._ssaoCombine = new FrameGraphPostProcessTask(`${name} SSAO2 Combine`, this._frameGraph, this.ssao._ssaoCombinePostProcess);\r\n\r\n        this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n    }\r\n\r\n    public override isReady() {\r\n        return this.ssao.isReady();\r\n    }\r\n\r\n    public override getClassName(): string {\r\n        return \"FrameGraphSSAO2RenderingPipelineTask\";\r\n    }\r\n\r\n    public record(): void {\r\n        if (this.sourceTexture === undefined || this.depthTexture === undefined || this.normalTexture === undefined || this.camera === undefined) {\r\n            throw new Error(`FrameGraphSSAO2RenderingPipelineTask \"${this.name}\": sourceTexture, depthTexture, normalTexture and camera are required`);\r\n        }\r\n\r\n        const sourceTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.sourceTexture);\r\n\r\n        this._ssao.sourceTexture = this.sourceTexture;\r\n        this._ssao.sourceSamplingMode = this.sourceSamplingMode;\r\n        this._ssao.camera = this.camera;\r\n        this._ssao.depthTexture = this.depthTexture;\r\n        this._ssao.normalTexture = this.normalTexture;\r\n\r\n        const textureSize = {\r\n            width: Math.floor(sourceTextureDescription.size.width * this.ratioSSAO) || 1,\r\n            height: Math.floor(sourceTextureDescription.size.height * this.ratioSSAO) || 1,\r\n        };\r\n        const textureCreationOptions: FrameGraphTextureCreationOptions = {\r\n            size: textureSize,\r\n            options: {\r\n                createMipMaps: false,\r","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/FrameGraph/Tasks/PostProcesses/ssao2RenderingPipelineTask.ts#L142-L178","documentation":"The aggregate FrameGraphSSAO2RenderingPipelineTask.record() needs sourceTexture, depthTexture, normalTexture, and camera before it can configure its internal SSAO2 pipeline (render plus blur sub-tasks). Any of the four being undefined throws this error. The camera is required because SSAO sampling radii and projections derive from it.","triggerScenarios":"Adding FrameGraphSSAO2RenderingPipelineTask and calling record()/build without setting task.sourceTexture, task.depthTexture, task.normalTexture, or task.camera.","commonSituations":"Forgetting the normals or depth prepass when assembling SSAO2 in a frame graph; camera not assigned when rendering with multiple cameras; migrating from the legacy SSAO2RenderingPipeline where these were wired internally.","solutions":["Set task.camera to the camera the SSAO pass should use.","Set task.sourceTexture to the scene color texture handle.","Set task.depthTexture and task.normalTexture to depth and normals handles from the prepass tasks.","Verify all four properties are set before frameGraph.build() runs."],"exampleFix":"// before\nconst ssao = new FrameGraphSSAO2RenderingPipelineTask(frameGraph, \"ssao2\");\nssao.sourceTexture = colorTask.outputTexture;\nframeGraph.addTask(ssao);\n\n// after\nconst ssao = new FrameGraphSSAO2RenderingPipelineTask(frameGraph, \"ssao2\");\nssao.sourceTexture = colorTask.outputTexture;\nssao.depthTexture = depthPrepassTask.outputTexture;\nssao.normalTexture = normalsPrepassTask.outputTexture;\nssao.camera = scene.activeCamera;\nframeGraph.addTask(ssao);","handlingStrategy":"validation","validationCode":"if (ssaoTask.sourceTexture === undefined || ssaoTask.depthTexture === undefined || ssaoTask.normalTexture === undefined || ssaoTask.camera === undefined) {\n  throw new Error(\"SSAO2 pipeline task missing one of sourceTexture/depthTexture/normalTexture/camera before build\");\n}","typeGuard":"function hasSSAO2PipelineInputs(t: { sourceTexture?: unknown; depthTexture?: unknown; normalTexture?: unknown; camera?: unknown }): boolean {\n  return t.sourceTexture !== undefined && t.depthTexture !== undefined && t.normalTexture !== undefined && t.camera !== undefined;\n}","tryCatchPattern":"try {\n  frameGraph.build();\n} catch (e) {\n  if (String(e?.message).includes(\"sourceTexture, depthTexture, normalTexture and camera are required\")) {\n    console.error(\"SSAO2 pipeline task not fully wired:\", e.message);\n  } else { throw e; }\n}","preventionTips":["Create depth and normals prepass tasks before constructing the SSAO2 pipeline task.","Always set the camera explicitly; don't rely on scene.activeCamera timing.","Use a single setup function for SSAO2 so all four required inputs are assigned in one place."],"tags":["babylonjs","frame-graph","ssao2","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"}