ShadowConfig

data class ShadowConfig(val mapSize: Int = 1024, val constantBias: Float = 0.001f, val normalBias: Float = 1.0f, val shadowFar: Float = 0.0f, val shadowNearHint: Float = 1.0f, val shadowFarHint: Float = 100.0f, val stable: Boolean = false, val lispsm: Boolean = false, val cascades: Int = 1, val cascadeSplits: List<Float>? = null, val contactShadows: Boolean = false, val contactShadowDistance: Float = 0.3f, val contactShadowSteps: Int = 8, val bulbRadius: Float = 0.02f, val blurWidth: Float = 0.0f, val elvsm: Boolean = false, val transform: Rotation? = null)

Per-light shadow-map quality, mapping onto the core LightManager.ShadowOptions. Pass a non-null shadow to a DirectionalLight/SunLight/SpotLight/FocusedSpotLight to make it cast shadows; null disables them. (Point lights cannot cast shadows.)

Many fields apply only under a specific view Shadows technique (noted per property). Defaults mirror Filament's, except lispsm (defaults false here for cleaner soft shadows). Filament's polygonOffset* depth-bias fields are deliberately not exposed — they're package-private in the Android binding and so can't be surfaced cross-platform; use constantBias/normalBias for acne instead.

Constructors

Link copied to clipboard
constructor(mapSize: Int = 1024, constantBias: Float = 0.001f, normalBias: Float = 1.0f, shadowFar: Float = 0.0f, shadowNearHint: Float = 1.0f, shadowFarHint: Float = 100.0f, stable: Boolean = false, lispsm: Boolean = false, cascades: Int = 1, cascadeSplits: List<Float>? = null, contactShadows: Boolean = false, contactShadowDistance: Float = 0.3f, contactShadowSteps: Int = 8, bulbRadius: Float = 0.02f, blurWidth: Float = 0.0f, elvsm: Boolean = false, transform: Rotation? = null)

Properties

Link copied to clipboard

Blur width; only under the Shadows.Vsm technique. 0 disables.

Link copied to clipboard

Soft-shadow penumbra size, world units. Only under Shadows.Dpcf/Shadows.Pcss.

Link copied to clipboard

Directional-only: number of CSM cascades (1–4). >1 sharpens large scenes.

Link copied to clipboard

Optional explicit cascade split positions (size cascades - 1, camera-Z 0..1). Null auto-computes uniform splits.

Link copied to clipboard

World-space depth bias pushing shadows off surfaces (reduces acne). Ignored for VSM.

Link copied to clipboard

SSCS max occluder distance, world units.

Link copied to clipboard

Enable screen-space contact shadows (SSCS) for fine, close-up contact detail.

Link copied to clipboard

SSCS ray-march step count (directional lights only); higher = better, costlier.

Link copied to clipboard

Exponential Layered VSM — better light-leak reduction at 2× shadow memory. Only under Shadows.Vsm.

Link copied to clipboard

Light-space perspective shadow maps — boosts effective resolution near the camera, but can worsen DPCF/PCSS/VSM penumbra artifacts. Default false; ignored when stable is true.

Link copied to clipboard

Shadow-map resolution in texels; power-of-two ≥ 8. Higher = sharper but costlier.

Link copied to clipboard

Normal-scaled bias; typically 1.0. Ignored for VSM.

Link copied to clipboard

Directional-only: distance after which shadows are clipped. 0 = camera far.

Link copied to clipboard

Concentrate shadow resolution up to this camera distance (world units).

Link copied to clipboard

Concentrate shadow resolution from this camera distance onward (world units).

Link copied to clipboard

Trade resolution for temporal stability (also forces lispsm off). Good for slow pans.

Link copied to clipboard

Optional rotation (Rotation) rotating the shadow's direction (directional-only, artistic). Null = identity (no rotation).