Shadows

sealed interface Shadows

View-wide shadow technique, passed to a view via FilamentView(shadows = …) (or FilamentSceneView(shadows = …)). Each subtype is one of Filament's shadow algorithms and carries only the tuning that algorithm actually uses — so there are no silently-ignored fields. Passing null for the view's shadows disables shadowing entirely. See ShadowConfig for the per-light counterpart that sets each caster's map quality.

Web caveat: Filament's web build doesn't bind View::setShadowType, so the technique is locked to Pcf; Vsm/Dpcf/Pcss are silently ignored on web (disabling via null still works). See the Web "Current limitations" in docs/platform-notes.md.

Inheritors

Types

Link copied to clipboard
data class Dpcf(val penumbraScale: Float = 1.0f, val penumbraRatioScale: Float = 1.0f) : Shadows

Dynamic Percentage-Closer soft Filtering — soft shadows whose penumbra grows with each light's ShadowConfig.bulbRadius. Cheaper than Pcss.

Link copied to clipboard
data object Pcf : Shadows

Percentage-Closer Filtering — hard-edged, cheapest, and Filament's default.

Link copied to clipboard
data object Pcfd : Shadows

A higher-quality PCF variant (PCFd).

Link copied to clipboard
data class Pcss(val penumbraScale: Float = 1.0f, val penumbraRatioScale: Float = 1.0f) : Shadows

Percentage-Closer Soft Shadows — physically-based soft shadows whose penumbra grows with each light's ShadowConfig.bulbRadius.

Link copied to clipboard
data class Vsm(val anisotropy: Int = 1, val mipmapping: Boolean = false, val msaaSamples: Int = 1, val highPrecision: Boolean = false, val lightBleedReduction: Float = 0.0f) : Shadows

Variance Shadow Maps — pre-filterable soft edges, good with many receivers.