Light Occluder 2D
A planar shadow contour. Manual polygons require no Physics module; ShapeProvider reads local geometry through the shapes2d contract.
LightOccluder2D describes shadow geometry independently of the visible sprite. Polygon uses local points; enable closed for a simple polygon without holes, or leave it off for a chain. The validator rejects non-finite points, zero-length edges and self-intersections. A sprite does not become an occluder automatically.
In Scene View, drag a vertex to move it, drag an edge midpoint to insert a vertex, or Alt-click a vertex to remove it. Each gesture uses one History transaction. ShapeProvider instead copies local geometry from a provider such as Physics, identified by shapeNode and a stable shape key. Physics is optional: the Try scene uses only a manual polygon. Changing collision masks does not change layers here.
Point, Spot and Sprite lights share the planar shadow algorithm. Overlapping volumes form a union. A light inside a closed contour is blocked by that contour; a receiver does not automatically ignore its own contour. cullMode chooses the accepted edge winding independently of a physics chain's one-sided setting. Softness filters each mask within a bounded radius and does not simulate an area light.
Offscreen casters remain eligible when their shadows reach a visible receiver. Light and occluder geometry use presentation transforms, including interpolated motion. Static light-space masks are reused while only the camera moves; moving a light or caster, changing its contour, resolution or filtering invalidates the relevant mask. The Inspector shows active mask layers with the owning light, and Scene View's shadow display shows visibility on Lit surfaces.
component engine.LightOccluder2D
On this page
Usage
Add it with Create → Lighting → Light Occluder.
Art Studio
Try it
Light occluder layers
The rectangle casts a shadow for the warm light, whose shadow mask includes layer 1.
Change Layers from 1 to 2. The light no longer sees this occluder; Reset restores the shadow.
Scene6 nodes
Fields
| Name | Type | Default | Description |
|---|---|---|---|
| Source | enum | polygon | Use a manual polygon/chain or a registered local-shape provider. one of: polygon, shapeProvider, spriteAlpha |
| Polygon | []Vec2 | [4 items] | Simple local-space contour without holes; points follow the owner's presentation transform once. read-only in scripts |
| Closed | bool | true | Close the manual polygon. A ShapeProvider supplies each contour's closed state. |
| Cull Mode | enum | none | Shadow edge winding policy; independent of any physics one-sided setting. one of: none, clockwise, counterClockwise |
| Layers | int | -1 | 64-bit shadow participation mask. -1 is all bits; zero casts no shadows. |
| Shape Node | NodeRef | none | Source node for ShapeProvider. Empty uses this node; unresolved IDs are preserved. |
| Shape | string | "" | Stable provider shape key, such as physics.BoxCollider2D. Empty selects all of the source node's shapes. |
Related guides
- Art Studio: drawing, frames and source files Create a drawing, edit layers and frames, then distinguish saving its source from publishing game assets.
- Cameras Camera2D renders an orthographic view from the node's 2D transform.
- Materials and shaders A material is a shared asset.