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.

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 distance from the occluder. Cheaper than Pcss; as of Filament 1.75 the per-light ShadowConfig.bulbRadius feeds PCSS only, so tune DPCF through penumbraScale instead.

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.