{"record":{"id":"e3b0bd2548562611","repo":"BabylonJS/Babylon.js","slug":"framegraphssrtask-this-name-sourcetexture-n","errorCode":null,"errorMessage":"FrameGraphSSRTask \"${this.name}\": sourceTexture, normalTexture, depthTexture, reflectivityTexture and camera are required","messagePattern":"FrameGraphSSRTask \"(.+?)\": sourceTexture, normalTexture, depthTexture, reflectivityTexture and camera are required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/FrameGraph/Tasks/PostProcesses/ssrTask.ts","lineNumber":38,"sourceCode":"    public override readonly postProcess: ThinSSRPostProcess;\r\n\r\n    constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinSSRPostProcess) {\r\n        super(name, frameGraph, thinPostProcess || new ThinSSRPostProcess(name, frameGraph.scene));\r\n    }\r\n\r\n    public override getClassName(): string {\r\n        return \"FrameGraphSSRTask\";\r\n    }\r\n\r\n    public override record(skipCreationOfDisabledPasses = false): FrameGraphRenderPass {\r\n        if (\r\n            this.sourceTexture === undefined ||\r\n            this.normalTexture === undefined ||\r\n            this.depthTexture === undefined ||\r\n            this.reflectivityTexture === undefined ||\r\n            this.camera === undefined\r\n        ) {\r\n            throw new Error(`FrameGraphSSRTask \"${this.name}\": sourceTexture, normalTexture, depthTexture, reflectivityTexture and camera are required`);\r\n        }\r\n\r\n        const pass = super.record(\r\n            skipCreationOfDisabledPasses,\r\n            (context) => {\r\n                this.postProcess.camera = this.camera;\r\n\r\n                context.setTextureSamplingMode(this.normalTexture, Constants.TEXTURE_BILINEAR_SAMPLINGMODE);\r\n                context.setTextureSamplingMode(this.depthTexture, Constants.TEXTURE_BILINEAR_SAMPLINGMODE);\r\n                context.setTextureSamplingMode(this.reflectivityTexture, Constants.TEXTURE_BILINEAR_SAMPLINGMODE);\r\n                if (this.backDepthTexture) {\r\n                    context.setTextureSamplingMode(this.backDepthTexture, Constants.TEXTURE_NEAREST_SAMPLINGMODE);\r\n                }\r\n            },\r\n            (context) => {\r\n                context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"normalSampler\", this.normalTexture);\r\n                context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"depthSampler\", this.depthTexture);\r\n                context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"reflectivitySampler\", this.reflectivityTexture);\r","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/FrameGraph/Tasks/PostProcesses/ssrTask.ts#L20-L56","documentation":"FrameGraphSSRTask.record() validates that sourceTexture, normalTexture, depthTexture, reflectivityTexture and camera are all assigned before recording the SSR post-process task. The task feeds these into its underlying post-process, and any undefined input means the pass cannot be built, so the library throws a descriptive error up front. This mirrors the same fail-fast contract as the other frame graph post-process tasks.","triggerScenarios":"Calling record() on a FrameGraphSSRTask (directly or via FrameGraph.build()) when any of the five required inputs — sourceTexture, normalTexture, depthTexture, reflectivityTexture, camera — is undefined because the caller never assigned them from upstream task outputs / the scene camera.","commonSituations":"Adding the SSR task to the graph before the tasks producing depth/normal/reflectivity textures exist; forgetting to bind the reflectivity texture; omitting camera assignment; migrating from SSRRenderingPipeline (which auto-wired scene textures) to the frame graph version which requires explicit wiring.","solutions":["Assign all five inputs before build(): sourceTexture, normalTexture, depthTexture, reflectivityTexture and camera","Ensure upstream texture-producing tasks are added to the frame graph before the SSR task and link their output texture handles","Set task.camera to the active/render camera","Add a pre-record assertion loop that checks each required property and logs which is missing"],"exampleFix":"// before\nconst ssrTask = new FrameGraphSSRTask(\"ssr\", frameGraph, { thickness: 1 });\nframeGraph.addTask(ssrTask);\nframeGraph.build(); // throws: required inputs undefined\n\n// after\nssrTask.sourceTexture = colorTask.outputTexture;\nssrTask.normalTexture = normalTask.outputTexture;\nssrTask.depthTexture = depthTask.outputTexture;\nssrTask.reflectivityTexture = reflectivityTask.outputTexture;\nssrTask.camera = frameGraph.scene.activeCamera;\nframeGraph.build();","handlingStrategy":"validation","validationCode":"const required = { sourceTexture: ssrTask.sourceTexture, normalTexture: ssrTask.normalTexture, depthTexture: ssrTask.depthTexture, reflectivityTexture: ssrTask.reflectivityTexture, camera: ssrTask.camera };\nconst missing = Object.entries(required).filter(([, v]) => v === undefined).map(([k]) => k);\nif (missing.length) throw new Error(`SSR task missing inputs: ${missing.join(\", \")}`);","typeGuard":"function hasSSRTaskInputs(t) { return t.sourceTexture !== undefined && t.normalTexture !== undefined && t.depthTexture !== undefined && t.reflectivityTexture !== undefined && t.camera !== undefined; }","tryCatchPattern":"try { frameGraph.build(); } catch (e) { if (String(e.message).includes(\"FrameGraphSSRTask\")) { console.error(\"SSR task missing required inputs — check texture wiring and camera\"); } else { throw e; } }","preventionTips":["Assign sourceTexture, normalTexture, depthTexture and reflectivityTexture from upstream task outputs before build()","Add texture-producing tasks to the graph before the SSR task","Always set the camera property explicitly — the frame graph version does not auto-detect it","Run a pre-build input audit for every task in the graph"],"tags":["babylonjs","frame-graph","ssr","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"}