BabylonJS/Babylon.js · error · Error

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

Error message

SSR post process "${this.name}": Automatic thickness computation requires that geomDepth and geomBackDepth have the same type (view or screen space depth)!

What it means

When computing SSR thickness automatically, the front depth (geomDepth) and back depth (geomBackDepth) must be expressed in the same space (view-space or screen-space). _buildBlock compares the connection point types and throws if they differ.

Source

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

            }

            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) {
                            throw new Error(
                                `SSR post process "${this.name}": Automatic thickness computation requires that geomDepth and geomBackDepth have the same type (view or screen space depth)!`
                            );
                        }
                    }
                }
            }
        }

        if (this.geomNormal.connectedPoint) {
            if (this.geomNormal.connectedPoint.type === NodeRenderGraphBlockConnectionPointTypes.TextureWorldNormal) {
                this._frameGraphTask.ssr.normalsAreInWorldSpace = true;
                this._frameGraphTask.ssr.normalsAreUnsigned = true;
            }
        }
        if (this.geomDepth.connectedPoint) {
            if (this.geomDepth.connectedPoint.type === NodeRenderGraphBlockConnectionPointTypes.TextureScreenDepth) {
                this._frameGraphTask.ssr.useScreenspaceDepth = true;
            }

View on GitHub (pinned to 0592b347b8)

Solutions

  1. Make both geometry renderer blocks produce the same depth type (both view or both screen space)
  2. Change the depth-type option on one block to match the other
  3. Disable automatic thickness computation if mixed depth spaces are unavoidable

Example fix

// before
geomFront.useViewSpace = true;
geomBack.useViewSpace = false; // mismatched
// after
geomFront.useViewSpace = true;
geomBack.useViewSpace = true;
Defensive patterns

Strategy: validation

Validate before calling

if (ssrBlock.enableAutomaticThicknessComputation && ssrBlock.geomDepth.connectedPoint && ssrBlock.geomBackDepth.connectedPoint) {
  if (ssrBlock.geomDepth.connectedPoint.type !== ssrBlock.geomBackDepth.connectedPoint.type) {
    throw new Error('geomDepth and geomBackDepth must have the same depth type');
  }
}

Type guard

function depthTypesMatch(b) { return b.geomDepth.connectedPoint?.type === b.geomBackDepth.connectedPoint?.type; }

Try / catch

try { graph.build(); } catch (e) { if (e.message.includes('same type (view or screen space depth)')) { console.error('Align depth-space settings on both geometry renderers'); } else { throw e; } }

Prevention

When it happens

Trigger: Building a graph where geomDepth and geomBackDepth are connected to blocks producing different depth types (e.g. one view-space, one screen-space) while enableAutomaticThicknessComputation is on.

Common situations: Mixing outputs from differently configured geometry renderer blocks; swapping one connection after changing depth-type settings on one block only.

Related errors


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