{"record":{"id":"15e8a2f649bb1e76","repo":"BabylonJS/Babylon.js","slug":"framegraphhighlightlayertask-this-name-objec","errorCode":null,"errorMessage":"FrameGraphHighlightLayerTask \"${this.name}\": objectRendererTask must have a depthTexture input","messagePattern":"FrameGraphHighlightLayerTask \"(.+?)\": objectRendererTask must have a depthTexture input","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/FrameGraph/Tasks/Layers/highlightLayerTask.ts","lineNumber":44,"sourceCode":"        super(\r\n            name,\r\n            frameGraph,\r\n            scene,\r\n            new ThinHighlightLayer(name, scene, options, true),\r\n            1,\r\n            alphaBlendingMode === Constants.ALPHA_COMBINE ? FrameGraphBaseLayerBlurType.Glow : FrameGraphBaseLayerBlurType.Standard,\r\n            true,\r\n            true\r\n        );\r\n    }\r\n\r\n    public override getClassName(): string {\r\n        return \"FrameGraphHighlightLayerTask\";\r\n    }\r\n\r\n    public override record() {\r\n        if (!this.objectRendererTask.depthTexture) {\r\n            throw new Error(`FrameGraphHighlightLayerTask \"${this.name}\": objectRendererTask must have a depthTexture input`);\r\n        }\r\n\r\n        const depthTextureCreationOptions = this._frameGraph.textureManager.getTextureCreationOptions(this.objectRendererTask.depthTexture);\r\n        if (!depthTextureCreationOptions.options.formats || !HasStencilAspect(depthTextureCreationOptions.options.formats[0])) {\r\n            throw new Error(`FrameGraphHighlightLayerTask \"${this.name}\": objectRendererTask depthTexture must have a stencil aspect`);\r\n        }\r\n\r\n        super.record();\r\n\r\n        this.layer._mainObjectRendererRenderPassId = this.objectRendererTask.objectRenderer.renderPassId;\r\n    }\r\n}\r\n","sourceCodeStart":26,"sourceCodeEnd":57,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/FrameGraph/Tasks/Layers/highlightLayerTask.ts#L26-L57","documentation":"FrameGraphHighlightLayerTask renders highlighted outlines using stencil; it requires the associated object renderer task to have a depthTexture input, and that depth texture must have a stencil aspect. record() throws if the objectRendererTask has no depthTexture.","triggerScenarios":"Building a frame graph where a highlight layer task references an objectRendererTask whose depthTexture input was never set.","commonSituations":"Using a plain object renderer without a depth texture attached; configuring the highlight layer before wiring the depth input; swapping in a renderer block that omits depth.","solutions":["Set objectRendererTask.depthTexture to a depth (D24S8/D32S8) texture before the highlight layer records","Ensure the depth texture creation options include a stencil aspect (see the related stencil error thrown right after)","Connect the object renderer block's depth output to the highlight layer block as required"],"exampleFix":"// before\nconst layerTask = new FrameGraphHighlightLayerTask(\"hl\", context);\nlayerTask.objectRendererTask = objRendererTask; // depthTexture unset\n// after\nobjRendererTask.depthTexture = depthTextureHandle; // D24S8\nlayerTask.objectRendererTask = objRendererTask;","handlingStrategy":"validation","validationCode":"if (!layerTask.objectRendererTask?.depthTexture) {\n  throw new Error('highlight layer objectRendererTask must have a depthTexture');\n}","typeGuard":"function hasDepthTexture(t) { return !!t.depthTexture; }","tryCatchPattern":"try { layerTask.record(); } catch (e) { if (e.message.includes('must have a depthTexture input')) { console.error('Assign a depth texture (with stencil) to the object renderer'); } else { throw e; } }","preventionTips":["Always create object renderers for highlight layers with a depth texture","Ensure the depth texture format includes stencil (D24S8/D32S8) for highlights","Validate the renderer's depthTexture before building layer tasks"],"tags":["frame-graph","highlight-layer","missing-connection"],"backgroundTag":"missing-required-input","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}