{"record":{"id":"cc619d1896b97c5d","repo":"BabylonJS/Babylon.js","slug":"this-constructor-name-this-name-targettex","errorCode":null,"errorMessage":"${this.constructor.name} \"${this.name}\": targetTexture and objectRendererTask are required","messagePattern":"(.+?) \"(.+?)\": targetTexture and objectRendererTask are required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/FrameGraph/Tasks/Layers/baseLayerTask.ts","lineNumber":249,"sourceCode":"        return this._objectRendererForLayerTask.isReady() && this.layer.isLayerReady();\r\n    }\r\n\r\n    /**\r\n     * Gets the current class name.\r\n     * @returns the class name\r\n     */\r\n    public override getClassName(): string {\r\n        return \"FrameGraphBaseLayerTask\";\r\n    }\r\n\r\n    /**\r\n     * Records the layer task into the frame graph.\r\n     * @param _skipCreationOfDisabledPasses defines whether disabled passes should be skipped\r\n     * @param additionalComposeBindings defines an optional callback used to bind extra compose resources\r\n     */\r\n    public record(_skipCreationOfDisabledPasses?: boolean, additionalComposeBindings?: (context: FrameGraphRenderContext, effect: Effect) => void) {\r\n        if (this.targetTexture === undefined || this.objectRendererTask === undefined) {\r\n            throw new Error(`${this.constructor.name} \"${this.name}\": targetTexture and objectRendererTask are required`);\r\n        }\r\n\r\n        this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.targetTexture);\r\n\r\n        // Uses the layerTexture or creates a color texture to render the layer to\r\n        let textureSize: {\r\n            width: number;\r\n            height: number;\r\n        };\r\n        let textureCreationOptions: FrameGraphTextureCreationOptions;\r\n\r\n        let colorLayerOutput: FrameGraphTextureHandle;\r\n\r\n        if (this.layerTexture) {\r\n            colorLayerOutput = this.layerTexture;\r\n            textureCreationOptions = this._frameGraph.textureManager.getTextureCreationOptions(this.layerTexture);\r\n            textureSize = getDimensionsFromTextureSize(textureCreationOptions.size);\r\n            textureCreationOptions.size = textureSize;\r","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/FrameGraph/Tasks/Layers/baseLayerTask.ts#L231-L267","documentation":"BaseLayerTask.record() (used by highlight/focus/glow layer frame graph tasks) needs both a target texture to render into and a child object renderer task that renders the objects. If either is undefined, recording the task into the frame graph would be invalid, so it throws.","triggerScenarios":"Calling record()/building the frame graph for a layer task where targetTexture or objectRendererTask was never assigned (e.g. the targetTexture input or objectRenderer input was never connected).","commonSituations":"Building a graph with a highlight/glow layer block whose target texture input or object renderer input is unconnected; building before the texture handle is set.","solutions":["Connect a texture (e.g. from a texture input block) to the layer block's targetTexture input","Connect an object renderer block to the layer block's objectRenderer input before build","Skip/disable the layer block if it is intentionally unused"],"exampleFix":"// before\nlayerBlock.build(); // inputs unconnected\n// after\nlayerBlock.targetTexture.connect(textureInputBlock.output);\nlayerBlock.objectRenderer.connect(objectRendererBlock.output);\nlayerBlock.build();","handlingStrategy":"validation","validationCode":"if (layerTask.targetTexture === undefined || layerTask.objectRendererTask === undefined) {\n  throw new Error(`layer '${layerTask.name}' needs targetTexture and objectRendererTask`);\n}","typeGuard":"function layerTaskReady(t) { return t.targetTexture !== undefined && t.objectRendererTask !== undefined; }","tryCatchPattern":"try { layerTask.record(); } catch (e) { if (e.message.includes('targetTexture and objectRendererTask are required')) { console.error('Wire layer block inputs before build'); } else { throw e; } }","preventionTips":["Connect targetTexture and objectRenderer inputs on every layer block before build","Validate all layer blocks in a pre-build pass","Skip recording intentionally unused layer tasks"],"tags":["render-graph","frame-graph","missing-connection"],"backgroundTag":"missing-required-input","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}