AutoMovie API
    Preparing search index...

    Variable applyRenderModeConst

    applyRenderMode: (
        scene: THREE.Scene,
        mode: AutoMovieGuidePass,
        options?: { depthRange?: number; edgeWidth?: number },
    ) => IAutoMovieRenderModeHandle = ...

    Apply one diffusion-guide render mode to a built scene, returning the restore handle. A capture applies the override at snapshot time and reverses it right after, so the viewer stays a thin projection of the engine result. A caller that keeps an override across frames calls the handle's update before drawing each one, which outline and pose supply because they hold copies the scene's animation does not move:

    • beauty: no override (the ordinary shaded render).
    • depth: meshes use clamp(1-viewZ/range,0,1) with camera-space depth and a shared DEPTH_NORMALIZATION_RANGE, independent of near/far normalization. Camera changes can change a world point's viewZ; black is the far-range/background convention.
    • mask: the segmentation pass. A scene handed its palette by attachAutoMovieSemanticMask is painted by applyAutoMovieSemanticMask, so every colour is the one that entity's own semantic id earned and survives a rebuild in a different order. A scene handed none keeps the legacy ramp, where each top-level child gets a flat unlit colour by its index: readable as coverage and silhouette, never as identity, because inserting one node repaints everything after it.
    • normal: every mesh swapped to MeshNormalMaterial: the unlit surface-normal conditioning pass (#1166).
    • outline: black fills plus inverted-hull back-face shells extruded by EDGE_WIDTH in model space, leaving white contours on black. Object/instance scaling and camera projection affect world thickness and screen line weight.
    • pose: meshes hidden, and a line-segment overlay of every bone→child bone connection drawn over a black background: the skeleton pose pass.

    Every pass that swaps a material carries a formation's baked cycle onto the replacement, so a marching crowd marches in depth, normal, mask and outline exactly as it does in beauty. pose is the standing exception: an anonymous member has no bones in the scene for the overlay to draw, which is the same gap it had before the crowd could move at all.

    An unknown mode is a caller bug and throws. Active or failed scene retirement refuses every mode before setup, including beauty. Failed restoration retains its complete owner callback and cause; nested owned cleanup still runs independently beneath the active boundary.

    Direct embedders can override depthRange and edgeWidth. The bundled __afPass capture path uses the defaults, keeping the camera-space depth normalization consistent while preserving differences caused by camera pose. Depth beyond the default range clamps to black; changing that range requires a direct call.

    Type Declaration