rememberShadowCatcherMaterialInstance

fun rememberShadowCatcherMaterialInstance(strength: Float = 0.7f, engine: Engine = LocalFilamentEngine.current ?: noFilamentEngine()): MaterialInstance

A MaterialInstance that draws nothing but the shadows falling on it: a ground for a model floating over the background or skybox, or a floor in AR. Only a directional light's shadows show; without one it is fully clear. The surface must receive shadows and shouldn't cast any:

DirectionalLight(shadow = ShadowConfig())
Plane(material = rememberShadowCatcherMaterialInstance(), width = 10f, depth = 10f, castShadows = false)

Parameters

strength

How dark a full shadow is: 0 = invisible, 1 = black.

engine

Engine that owns the material. Defaults to the current composition scope's engine.