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

    Function makeOitCompatible

    • Make any stock Three.js material or user-authored material OIT-compatible by patching its shaders at compile time (via onBeforeCompile) to include the OIT logic, and attaching the per-pass variant machinery.

      Works with lit built-in materials (which provide vViewPosition) and with materials lacking it (e.g. LineBasicMaterial), in which case vViewPosition is injected automatically. All injected code is guarded by #ifdef USE_OIT, so the base program is unchanged outside the OIT pipeline.

      Note: targets materials compiled by Three.js (built-ins, ShaderMaterial). Raw RawShaderMaterial (no Three.js shader prelude) is not auto-patched.

      Type Parameters

      • T extends Material

      Parameters

      • material: T

        the material to patch

      • Optionaloptions: OitMaterialOptions

        optional overrides (e.g. side)

      Returns T & OitCapableMaterial

      the same material, typed as OitCapableMaterial