API

Function setShadowCasterMaterial

  • Sets the material a mesh's shadow is cast through, instead of a depth-only view of material itself.

    Honoured by the PCF and CSM caster paths (including the CSM static cache): they build the caster's no-colour view from casterMaterial and re-evaluate the caster set when either material is rebuilt. The ESM path renders casters through its own per-family ESM depth views and ignores the override. The override material does not need to be assigned to any mesh or added to a scene.

    Parameters

    • material: Material

      The material assigned to the mesh (the one that renders in the main pass).

    • casterMaterial: Material | null

      Material to cast this mesh's shadow through, or null to cast through material.

    Returns void