Skip to content

OcclusionPassOptions

Defined in: packages/three-flatland/src/lights/OcclusionPass.ts:26

Optional construction knobs for OcclusionPass.

optional clearAlpha?: number

Defined in: packages/three-flatland/src/lights/OcclusionPass.ts:42

Clear alpha. Default: 0.


optional clearColor?: ColorRepresentation 

Defined in: packages/three-flatland/src/lights/OcclusionPass.ts:40

Clear color for the RT. Default: transparent black.


optional linearFilter?: boolean

Defined in: packages/three-flatland/src/lights/OcclusionPass.ts:52

Use LinearFilter on the RT texture instead of the NearestFilter default. Linear sampling smears alpha across silhouette edges (a texel just outside the sprite interpolates to a fractional alpha), which inflates the SDF seed by ~½ pixel in every direction and produces a faint halo around every caster. NearestFilter keeps the alpha binary and pixel- perfect. Flip to true only if a custom consumer explicitly wants the anti-aliased silhouette.


optional resolutionScale?: number

Defined in: packages/three-flatland/src/lights/OcclusionPass.ts:38

Resolution multiplier relative to the main viewport (0 < x <= 1). The SDF is derived from this RT, so lower values trade shadow fidelity for shadow cost. Default: 0.5 (half resolution) — quarters fill cost across every RT-sized pass while staying visually indistinguishable from full-res on typical viewports (the separable blur masks the coarser seed; NearestFilter keeps edges crisp). Set 1 for very small / pixel-art viewports where the half-pixel silhouette quantization reads as blocky, or drop to 0.25 on low-end mobile where the shadow cost dominates and a blockier silhouette is acceptable.