API

Function setMeshOpacity

  • Set the opacity of one ordinary Standard/PBR mesh without modifying its material.

    Finite values are clamped to [0, 1]. Values below 1 select sorted blending with depth writes disabled; zero omits colour and geometry draws. Shadows, picking and mesh visibility are unchanged. Thin instances share their mesh's opacity.

    Scene-owned meshes in autoMirror: false tasks follow crossings of 1 only with enableRenderTaskMeshRefresh, for entries added without a material override, matching material swaps. Unregistered meshes in an explicit geometry-task meshes list change pipeline/blend variants only at that task's next renderable sync, as with material/topology changes; updates below 1 and geometry's zero skip are immediate. Existing binding values, including 1, update immediately.

    Parameters

    • mesh: Mesh
    • opacity: number

    Returns void

    RangeError - The value is not a finite number.

    Error - The target is not a Mesh, is disposed, or uses an unsupported material below 1.