castShadows property

bool castShadows
final

Whether this light is blocked by LightingOccluders.

The light shape is clipped to the region visible from its center, so walls cast hard shadows. Add occluders with gameRef.lighting.addOccluder(...) (static geometry, ideal for tile maps) or with the WithLightingOcclusion mixin (moving obstacles).

The cost grows with the number of occluders and with LightingQuality.shadowRays, so enable it only for the lights that really need it.

Implementation

final bool castShadows;