Skip to content

@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 ​

PropertyTypeDescriptionDefined in
mapSize?numberShadow map resolution in texels (square). three's default is 512. Clamped to [16, 8192].components/Light.ts:12
bias?numberDepth bias to fight shadow acne. Small negatives such as -0.0005 are typical.components/Light.ts:14
normalBias?numberBias along the surface normal; 0.02-0.05 removes acne on large flat surfaces.components/Light.ts:16
radius?numberBlur radius of the shadow edge (PCF shadow maps).components/Light.ts:18
cameraSize?numberHalf-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?numberNear plane of the shadow camera.components/Light.ts:27
far?numberFar plane of the shadow camera. Spot lights with a distance use that instead.components/Light.ts:29