@equinor/videx-3d
    Preparing search index...

    Class OITRenderPass

    Hybrid order-independent-transparency (OIT) render pass for use with the RenderingPipeline (or any custom composer). Renders the nearest transparent layer exactly (depth-peeled, alpha-over) and the remaining layers using weighted-blended OIT (WBOIT), partitioned per-pixel in view-space linear depth.

    Transparency is opt-in: this pass only affects materials that are OIT-capable (library materials, or stock/user materials patched with makeOitCompatible). Two per-object escape-hatch layers override the default routing: LAYERS.FORCE_OPAQUE draws the object as a depth-writing opaque occluder (its material is temporarily forced to depthWrite=true, transparent=false); LAYERS.OIT_EXCLUDED also draws it in the opaque pass but leaves the material's own properties untouched. Additive/glow objects tagged with the LAYERS.EMISSIVE layer are drawn between the opaque and transparent layers (so transparent surfaces in front attenuate them); always-on-top objects tagged with the LAYERS.OVERLAY layer are drawn last, on top of the resolved transparency. While this pass is active it sets the per-canvas rendering state to 'oit' so components can disable conflicting self-transparency workarounds.

    const passes = useMemo(
    () => [new OITRenderPass(scene, camera), new OutputPass()],
    [scene, camera],
    );
    return <RenderingPipeline passes={passes} />;

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    debugTargets: boolean = false

    When true, draws small thumbnails of the internal render targets (min-depth, accumulation) into the bottom-left of the output, for debugging. GPU-only; no pixel readback.

    emitterDepthStamp: boolean = false

    Optional feature (default off): stamp depth for emissive/glow emitters (objects on LAYERS.EMISSIVE) wherever their fragment strength is at least emitterDepthThreshold, drawn before the transparent OIT passes. This lets the dense core of an additive emitter (e.g. perforation jets) occlude transparent surfaces behind it, preventing the wash-out where a far transparent surface would otherwise dim the emitter. Surfaces in front still attenuate it.

    An emitter opts in by exposing a depth-only stamp material on its material's userData.occlusionDepthMaterial (with a uOcclusionThreshold uniform the pass drives). Emitters without one are simply skipped. Costs one extra emissive pass per frame when enabled; nothing when off.

    emitterDepthThreshold: number = 0.5

    Strength threshold (0..1) for emitterDepthStamp. Default 0.5.

    occlusionDepthStamp: boolean = false

    Optional feature (default off): after the transparent OIT passes, stamp depth for transparent surfaces wherever their own alpha is at least occlusionDepthThreshold. Transparent surfaces normally write no depth, so annotation labels behind a high-but-not-full opacity surface are never occluded; enabling this makes a surface occlude labels once its alpha clears the threshold.

    The test is per-fragment and per-surface (each surface judged on its own alpha, not accumulated coverage), and the stamped depth uses the same encoding the AnnotationsPass already samples. Costs one extra transparent-geometry pass per frame when enabled; nothing (not even a shader compile) when off.

    occlusionDepthThreshold: number = 0.5

    Alpha threshold (0..1) for occlusionDepthStamp. Default 0.5.

    profile: boolean = false

    When true, measures per-segment GPU time (opaque/emissive/min-depth/tail/ composite/front/overlay) via timer queries and exposes it on timings. Adds a little CPU/driver overhead and lags a few frames, so it is off by default. No-op on platforms without EXT_disjoint_timer_query_webgl2.

    The most relevant figure for the transparent-geometry cost is OITRenderPassTimings.tail.

    resources: OITRenderPassResources = ...

    Resource/accumulation counters for leak monitoring, updated every render. See OITRenderPassResources.

    skipFront: boolean = false

    Debug: when true, the exact depth-peeled front layer is disabled and every transparent fragment is resolved through the weighted-blended (WBOIT) tail. Useful for isolating tail behaviour and comparing against the hybrid result.

    stats: OITRenderPassStats = ...

    Per-frame object counts for each pass, updated every render. Useful for verifying which objects are routed through OIT vs. drawn opaque/overlay.

    timings: OITRenderPassTimings = ...

    Per-segment GPU timings (ms) from the last completed measurement. Only updated while profile is enabled. -1 means "no result yet" or unsupported.

    writeToScreen: boolean = false

    Methods