API

Class ShadowOnlyMaterial

A transparent "shadow catcher" material: it renders only shadow strength into its alpha channel (over shadowColor, black by default), so shadows can be composited over an arbitrary background.

It can receive IBL shadows (via IblShadowsRenderPipeline.addShadowReceivingMaterial / the Frame Graph IBL shadows task). Because the material has a single alpha output channel, IBL shadows are received as monochrome: a colored IBL shadow is reduced to its luminance rather than preserving per-channel hue.

Hierarchy (View Summary)

Index
  • Instantiates a ShadowOnly Material in the given scene

    Parameters

    • name: string

      The friendly name of the material

    • Optionalscene: any

      The scene to add the material to

    • forceGLSL: boolean = false

      Use the GLSL code generation for the shader (even on WebGPU). Default is false

    Returns ShadowOnlyMaterial

shadowColor: any = ...

The color the shadow is rendered with (black by default). Only its RGB is used; shadow strength is written to the material's alpha channel.