BabylonJS/Babylon.js · error

FrameGraphObjectRendererTask ${this.name}: targetTexture, ob

Error message

FrameGraphObjectRendererTask ${this.name}: targetTexture, objectList, and camera are required

What it means

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.

Source

Thrown at packages/dev/core/src/FrameGraph/Tasks/Rendering/objectRendererTask.ts:536

        }
        this._oitRenderer.dispose();
        this._rtForOrderIndependentTransparency?.dispose();
        super.dispose();
    }

    protected _resolveDanglingHandles(targetTextures: FrameGraphTextureHandle[]) {
        if (targetTextures.length > 0) {
            this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, targetTextures[0]);
        }

        if (this.depthTexture !== undefined) {
            this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthTexture, this.depthTexture);
        }
    }

    protected _checkParameters() {
        if (this.targetTexture === undefined || this.objectList === undefined || this.camera === undefined) {
            throw new Error(`FrameGraphObjectRendererTask ${this.name}: targetTexture, objectList, and camera are required`);
        }
    }

    protected _checkTextureCompatibility(targetTextures: FrameGraphTextureHandle[]): boolean {
        const className = this.getClassName();

        let outputTextureDescription = targetTextures.length > 0 ? this._frameGraph.textureManager.getTextureDescription(targetTextures[0]) : null;
        let depthEnabled = false;

        if (this.depthTexture !== undefined) {
            if (outputTextureDescription && this.depthTexture !== backbufferDepthStencilTextureHandle && targetTextures[0] === backbufferColorTextureHandle) {
                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`);
            }

            const depthTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.depthTexture);
            if (!outputTextureDescription) {
                outputTextureDescription = depthTextureDescription;
            }

View on GitHub (pinned to 0592b347b8)

Solutions

  1. Set task.targetTexture, task.objectList and task.camera before calling frameGraph.build().
  2. Ensure the object list is created via frameGraph.createObjectList() (or scene-based list) and assigned.
  3. Verify the camera was added to the scene and passed to the task.
  4. Add a guard before build that checks all three fields are defined.

Example fix

// before
const task = new FrameGraphObjectRendererTask('objects', frameGraph, scene);
frameGraph.addTask(task);
frameGraph.build();

// after
const task = new FrameGraphObjectRendererTask('objects', frameGraph, scene);
task.targetTexture = destinationTexture;
task.objectList = frameGraph.createObjectList(meshes);
task.camera = scene.activeCamera;
frameGraph.addTask(task);
frameGraph.build();
Defensive patterns

Strategy: validation

Validate before calling

if (task.targetTexture === undefined || task.objectList === undefined || task.camera === undefined) {
    throw new Error('ObjectRendererTask requires targetTexture, objectList and camera before build()');
}

Type guard

function isObjectRendererConfigured(t: FrameGraphObjectRendererTask): boolean {
    return t.targetTexture !== undefined && t.objectList !== undefined && t.camera !== undefined;
}

Try / catch

try {
    frameGraph.build();
} catch (e) {
    if (String(e).includes('targetTexture, objectList, and camera are required')) {
        console.error(`Task ${task.name} missing required inputs`);
    } else throw e;
}

Prevention

When it happens

Trigger: frameGraph.build()/record() reaches an ObjectRendererTask whose targetTexture, objectList or camera property was never assigned (or was explicitly set to undefined) before building.

Common situations: 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.

Related errors


AI-assisted analysis of BabylonJS/Babylon.js@0592b347b8 (2026-08-30). Data as JSON: /api/errors/c4c93494f9424768. Report an issue: GitHub.