API

Interface ShaderNormalViewConfig

Configuration for createShaderNormalMaterialView.

interface ShaderNormalViewConfig {
    distanceEncodeRange?: number;
    space?: "view" | "world";
    worldPosLocation?: number;
    worldPosVarying?: string;
}
Index
distanceEncodeRange?: number

When set, the output ALPHA encodes the fragment's view distance normalized by this range (clamp(viewZ / range, 0, 1)) so a consumer can fade the effect with distance. Clear the target's alpha to 1 as the "no geometry" sentinel. When omitted, alpha is a flat 1 (validity only).

space?: "view" | "world"

Output space of the encoded normal: "view" (default — ready for Blender-style screen-space curvature) or "world".

worldPosLocation?: number

@location() of that varying in the vertex output struct. Default 0.

worldPosVarying?: string

Name of the world-position varying the source vertex stage emits. Default "vWorldPos".