{"record":{"id":"c4c93494f9424768","repo":"BabylonJS/Babylon.js","slug":"framegraphobjectrenderertask-this-name-targett","errorCode":null,"errorMessage":"FrameGraphObjectRendererTask ${this.name}: targetTexture, objectList, and camera are required","messagePattern":"FrameGraphObjectRendererTask (.+?): targetTexture, objectList, and camera are required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/FrameGraph/Tasks/Rendering/objectRendererTask.ts","lineNumber":536,"sourceCode":"        }\r\n        this._oitRenderer.dispose();\r\n        this._rtForOrderIndependentTransparency?.dispose();\r\n        super.dispose();\r\n    }\r\n\r\n    protected _resolveDanglingHandles(targetTextures: FrameGraphTextureHandle[]) {\r\n        if (targetTextures.length > 0) {\r\n            this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, targetTextures[0]);\r\n        }\r\n\r\n        if (this.depthTexture !== undefined) {\r\n            this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthTexture, this.depthTexture);\r\n        }\r\n    }\r\n\r\n    protected _checkParameters() {\r\n        if (this.targetTexture === undefined || this.objectList === undefined || this.camera === undefined) {\r\n            throw new Error(`FrameGraphObjectRendererTask ${this.name}: targetTexture, objectList, and camera are required`);\r\n        }\r\n    }\r\n\r\n    protected _checkTextureCompatibility(targetTextures: FrameGraphTextureHandle[]): boolean {\r\n        const className = this.getClassName();\r\n\r\n        let outputTextureDescription = targetTextures.length > 0 ? this._frameGraph.textureManager.getTextureDescription(targetTextures[0]) : null;\r\n        let depthEnabled = false;\r\n\r\n        if (this.depthTexture !== undefined) {\r\n            if (outputTextureDescription && this.depthTexture !== backbufferDepthStencilTextureHandle && targetTextures[0] === backbufferColorTextureHandle) {\r\n                throw new Error(`${className} ${this.name}: the back buffer depth/stencil texture is the only depth texture allowed when the target is the back buffer color`);\r\n            }\r\n\r\n            const depthTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.depthTexture);\r\n            if (!outputTextureDescription) {\r\n                outputTextureDescription = depthTextureDescription;\r\n            }\r","sourceCodeStart":518,"sourceCodeEnd":554,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/FrameGraph/Tasks/Rendering/objectRendererTask.ts#L518-L554","documentation":"FrameGraphObjectRendererTask.record() validates via _checkParameters that the three essential inputs are set: targetTexture (where to render), objectList (what to render) and camera (from which viewpoint). Any of them being undefined means the render pass cannot be constructed, so record() throws.","triggerScenarios":"frameGraph.build()/record() reaches an ObjectRendererTask whose targetTexture, objectList or camera property was never assigned (or was explicitly set to undefined) before building.","commonSituations":"Creating the task and forgetting to wire camera/objectList; using a task with only a depth texture configured; objectList created after build() is called; copy-pasted task setup that skipped one assignment.","solutions":["Set task.targetTexture, task.objectList and task.camera before calling frameGraph.build().","Ensure the object list is created via frameGraph.createObjectList() (or scene-based list) and assigned.","Verify the camera was added to the scene and passed to the task.","Add a guard before build that checks all three fields are defined."],"exampleFix":"// before\nconst task = new FrameGraphObjectRendererTask('objects', frameGraph, scene);\nframeGraph.addTask(task);\nframeGraph.build();\n\n// after\nconst task = new FrameGraphObjectRendererTask('objects', frameGraph, scene);\ntask.targetTexture = destinationTexture;\ntask.objectList = frameGraph.createObjectList(meshes);\ntask.camera = scene.activeCamera;\nframeGraph.addTask(task);\nframeGraph.build();","handlingStrategy":"validation","validationCode":"if (task.targetTexture === undefined || task.objectList === undefined || task.camera === undefined) {\n    throw new Error('ObjectRendererTask requires targetTexture, objectList and camera before build()');\n}","typeGuard":"function isObjectRendererConfigured(t: FrameGraphObjectRendererTask): boolean {\n    return t.targetTexture !== undefined && t.objectList !== undefined && t.camera !== undefined;\n}","tryCatchPattern":"try {\n    frameGraph.build();\n} catch (e) {\n    if (String(e).includes('targetTexture, objectList, and camera are required')) {\n        console.error(`Task ${task.name} missing required inputs`);\n    } else throw e;\n}","preventionTips":["Use a factory function that creates and fully configures renderer tasks.","Never call frameGraph.build() conditionally before task setup completes.","List required task inputs in code review checklists for frame graph code."],"tags":["babylonjs","frame-graph","missing-input","validation"],"backgroundTag":"missing-required-input","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}