@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / components / LightShadowState
Type Alias: LightShadowState ​
ts
type LightShadowState = {
mapSize?: number;
bias?: number;
normalBias?: number;
radius?: number;
cameraSize?: number;
near?: number;
far?: number;
};Defined in: components/Light.ts:10
Optional shadow tuning for a shadow-casting light (directional, spot, point). Only the fields present are applied; a missing field keeps three's default, and a light without a shadow block is never touched.
Properties ​
| Property | Type | Description | Defined in |
|---|---|---|---|
mapSize? | number | Shadow map resolution in texels (square). three's default is 512. Clamped to [16, 8192]. | components/Light.ts:12 |
bias? | number | Depth bias to fight shadow acne. Small negatives such as -0.0005 are typical. | components/Light.ts:14 |
normalBias? | number | Bias along the surface normal; 0.02-0.05 removes acne on large flat surfaces. | components/Light.ts:16 |
radius? | number | Blur radius of the shadow edge (PCF shadow maps). | components/Light.ts:18 |
cameraSize? | number | Half-extent, in world units, of a DIRECTIONAL light's orthographic shadow camera (left = bottom = -cameraSize, right = top = cameraSize). three's default is 5, which only covers a 10 m square. Ignored for spot and point lights. | components/Light.ts:25 |
near? | number | Near plane of the shadow camera. | components/Light.ts:27 |
far? | number | Far plane of the shadow camera. Spot lights with a distance use that instead. | components/Light.ts:29 |

