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

    Type Alias OitMaterialOptions

    Options for making a material OIT-compatible.

    type OitMaterialOptions = {
        shareUniforms?: string[];
        side?: Side;
        syncProperties?: string[];
    }
    Index

    Properties

    shareUniforms?: string[]

    Names of properties on the material that hold uniform containers (objects of IUniform) which should be shared by reference with each per-pass variant. ShaderMaterial variants already share uniforms, but non-ShaderMaterial materials are cloned, so any custom uniform object they read in onBeforeCompile (e.g. a uniforms field used for slicing) must be listed here for live per-frame updates to reach the variants.

    side?: Side

    Force a specific side on all variants (e.g. DoubleSide for surfaces so back faces contribute to the tail). Defaults to the base material's side.

    syncProperties?: string[]

    Names of value properties to keep in sync from the base material onto the per-pass variants every frame. Only relevant for stock/built-in materials, whose variants are cloned and would otherwise snapshot their appearance at build time (ShaderMaterial variants share uniforms and are always live, so this is ignored for them).

    Restricted to value properties that do not affect the compiled program:

    • primitives (e.g. metalness, roughness, emissiveIntensity), and
    • copyable value objects with a .copy() method (e.g. color, emissiveColor; or Vector2/3/4), which are copied in place (no allocation, no recompile).

    Do not list program-affecting properties here (textures such as map, vertexColors, anything that toggles a shader #define) — changing those needs a recompile and is intentionally unsupported through this fast path. opacity is always kept live and need not be listed. Use COMMON_OIT_SYNC_PROPS for a sensible default set.

    makeOitCompatible(material, { syncProperties: ['color', 'metalness'] });
    // or spread the common set:
    makeOitCompatible(material, { syncProperties: [...COMMON_OIT_SYNC_PROPS] });