BabylonJS/Babylon.js · error · Error

SSR post process "${this.name}": Automatic thickness computa

Error message

SSR post process "${this.name}": Automatic thickness computation requires a back depth texture to be connected!

What it means

The SSR node render graph block requires a back depth texture when enableAutomaticThicknessComputation is on, because screen-space thickness needs depth of back faces. _buildBlock throws at graph build time if the geomBackDepth input is not connected.

Source

Thrown at packages/dev/core/src/FrameGraph/Node/Blocks/PostProcesses/ssrPostProcessBlock.pure.ts:430

    /**
     * Gets the geometry back depth input component
     */
    public get geomBackDepth(): NodeRenderGraphConnectionPoint {
        return this._inputs[6];
    }

    protected override _buildBlock(state: NodeRenderGraphBuildState) {
        super._buildBlock(state);

        this._frameGraphTask.normalTexture = this.geomNormal.connectedPoint?.value as FrameGraphTextureHandle;
        this._frameGraphTask.depthTexture = this.geomDepth.connectedPoint?.value as FrameGraphTextureHandle;
        this._frameGraphTask.reflectivityTexture = this.geomReflectivity.connectedPoint?.value as FrameGraphTextureHandle;
        this._frameGraphTask.backDepthTexture = this.geomBackDepth.connectedPoint?.value as FrameGraphTextureHandle;
        this._frameGraphTask.camera = this.camera.connectedPoint?.value as Camera;

        if (this.enableAutomaticThicknessComputation) {
            if (!this._frameGraphTask.backDepthTexture) {
                throw new Error(`SSR post process "${this.name}": Automatic thickness computation requires a back depth texture to be connected!`);
            }

            const geomBackDepthOwnerBlock = this.geomBackDepth.connectedPoint!.ownerBlock;
            if (geomBackDepthOwnerBlock.getClassName() === "NodeRenderGraphGeometryRendererBlock") {
                const geometryBackFaceRendererBlock = geomBackDepthOwnerBlock as NodeRenderGraphGeometryRendererBlock;
                if (!geometryBackFaceRendererBlock.reverseCulling) {
                    throw new Error(
                        `SSR post process "${this.name}": Automatic thickness computation requires the geometry renderer block for the back depth texture to have reverse culling enabled!`
                    );
                }

                if (this._frameGraphTask.depthTexture) {
                    const geomDepthOwnerBlock = this.geomDepth.connectedPoint!.ownerBlock;
                    if (geomDepthOwnerBlock.getClassName() === "NodeRenderGraphGeometryRendererBlock") {
                        const geomDepthConnectionPointType = this.geomDepth.connectedPoint!.type;
                        const geomBackDepthConnectionPointType = this.geomBackDepth.connectedPoint!.type;

                        if (geomDepthConnectionPointType !== geomBackDepthConnectionPointType) {

View on GitHub (pinned to 0592b347b8)

Solutions

  1. Connect a geometry renderer block's back depth output to ssrBlock.geomBackDepth
  2. Set enableAutomaticThicknessComputation=false if you supply manual thickness instead
  3. Verify the connection via geomBackDepth.connectedPoint before build

Example fix

// before
ssrBlock.enableAutomaticThicknessComputation = true; // geomBackDepth not connected
// after
ssrBlock.geomBackDepth.connectTo(geomRendererBlock.backDepth);
ssrBlock.enableAutomaticThicknessComputation = true;
Defensive patterns

Strategy: validation

Validate before calling

if (ssrBlock.enableAutomaticThicknessComputation && !ssrBlock.geomBackDepth.connectedPoint) {
  throw new Error('Connect geomBackDepth before enabling automatic thickness');
}

Type guard

function hasBackDepth(b) { return !!b.geomBackDepth.connectedPoint?.value; }

Try / catch

try { graph.build(); } catch (e) { if (e.message.includes('requires a back depth texture')) { ssrBlock.enableAutomaticThicknessComputation = false; graph.build(); } else { throw e; } }

Prevention

When it happens

Trigger: Building a NodeRenderGraph containing an ssrPostProcessBlock with enableAutomaticThicknessComputation=true while the geomBackDepth input remains unconnected.

Common situations: Enabling automatic thickness in a render graph editor or code but forgetting to wire a geometry renderer's back-depth output; toggling the option after the connection was removed.

Related errors


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