{"record":{"id":"137def628b8cb433","repo":"BabylonJS/Babylon.js","slug":"framegraphssrrenderingpipelinetask-this-name","errorCode":null,"errorMessage":"FrameGraphSSRRenderingPipelineTask \"${this.name}\": sourceTexture, normalTexture, depthTexture, reflectivityTexture and camera are required","messagePattern":"FrameGraphSSRRenderingPipelineTask \"(.+?)\": sourceTexture, normalTexture, depthTexture, reflectivityTexture and camera are required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.ts","lineNumber":164,"sourceCode":"    }\r\n\r\n    public override isReady() {\r\n        return this.ssr.isReady();\r\n    }\r\n\r\n    public override getClassName(): string {\r\n        return \"FrameGraphSSRRenderingPipelineTask\";\r\n    }\r\n\r\n    public record(): void {\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(`FrameGraphSSRRenderingPipelineTask \"${this.name}\": sourceTexture, normalTexture, depthTexture, reflectivityTexture and camera are required`);\r\n        }\r\n\r\n        const sourceTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.sourceTexture);\r\n\r\n        this._ssr.sourceTexture = this.sourceTexture;\r\n        this._ssr.sourceSamplingMode = this.sourceSamplingMode;\r\n        this._ssr.camera = this.camera;\r\n        this._ssr.normalTexture = this.normalTexture;\r\n        this._ssr.depthTexture = this.depthTexture;\r\n        this._ssr.backDepthTexture = this.backDepthTexture;\r\n        this._ssr.reflectivityTexture = this.reflectivityTexture;\r\n\r\n        let ssrTextureHandle: FrameGraphTextureHandle | undefined;\r\n\r\n        const textureSize = {\r\n            width: Math.floor(sourceTextureDescription.size.width / (this.ssr.ssrDownsample + 1)) || 1,\r\n            height: Math.floor(sourceTextureDescription.size.height / (this.ssr.ssrDownsample + 1)) || 1,\r\n        };\r","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.ts#L146-L182","documentation":"FrameGraphSSRRenderingPipelineTask.record() requires sourceTexture, normalTexture, depthTexture, reflectivityTexture and camera to be assigned before the SSR (screen-space reflections) rendering pipeline task is recorded. Because SSR samples color, normals, depth and a reflectivity/PBR texture, any missing input makes the task impossible to configure, and the library throws a descriptive error at record time. This is a fail-fast validation in the frame graph task contract.","triggerScenarios":"Calling record() (directly or through FrameGraph.build()) on a FrameGraphSSRRenderingPipelineTask where any of sourceTexture, normalTexture, depthTexture, reflectivityTexture or camera is still undefined — typically because the producing tasks' outputs were never bound to the task's input properties.","commonSituations":"Wiring an SSR pipeline in a frame graph but forgetting the reflectivity texture produced by the PBR/material task; using the task on a scene without a prepass rendering pipeline generating normals/depth; forgetting to set camera after constructing the task; order-of-addition mistakes so upstream tasks are not in the graph yet.","solutions":["Bind all five inputs before build(): task.sourceTexture, task.normalTexture, task.depthTexture, task.reflectivityTexture and task.camera","Verify the prepass/material tasks that generate the normal, depth and reflectivity textures are added to the frame graph before the SSR task and their output handles assigned","Set task.camera to the rendering camera (e.g. frameGraph.scene.activeCamera)","Log each of the five properties before calling build() to identify exactly which one is undefined"],"exampleFix":"// before\nconst ssrTask = new FrameGraphSSRRenderingPipelineTask(\"ssr\", frameGraph);\nframeGraph.addTask(ssrTask);\nframeGraph.build(); // throws: required inputs undefined\n\n// after\nssrTask.sourceTexture = mainTextureTask.outputTexture;\nssrTask.normalTexture = prepassTextureTask.outputTexture;\nssrTask.depthTexture = depthTextureTask.outputTexture;\nssrTask.reflectivityTexture = reflectivityTask.outputTexture;\nssrTask.camera = frameGraph.scene.activeCamera;\nframeGraph.build();","handlingStrategy":"validation","validationCode":"const required = { sourceTexture: ssrPipelineTask.sourceTexture, normalTexture: ssrPipelineTask.normalTexture, depthTexture: ssrPipelineTask.depthTexture, reflectivityTexture: ssrPipelineTask.reflectivityTexture, camera: ssrPipelineTask.camera };\nconst missing = Object.entries(required).filter(([, v]) => v === undefined).map(([k]) => k);\nif (missing.length) throw new Error(`SSR pipeline task missing inputs: ${missing.join(\", \")}`);","typeGuard":"function hasSSRPipelineInputs(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(\"sourceTexture, normalTexture, depthTexture, reflectivityTexture and camera are required\")) { console.error(\"SSR pipeline task inputs not wired\"); } else { throw e; } }","preventionTips":["Wire all five inputs (including the easily forgotten reflectivityTexture) right after task creation","Ensure the prepass/material tasks generating normal, depth and reflectivity textures are added before the SSR task","Set camera from frameGraph.scene.activeCamera at graph setup time","Validate all task inputs before FrameGraph.build()"],"tags":["babylonjs","frame-graph","screen-space-reflections","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"}