Visible celestial artwork and atmospheric shafts use their own references and sorting. Add them after the clock and base environment work.
Sun and Moon visuals#
| Field | Purpose |
|---|---|
| Sun / Moon Sprite | Assign artwork; a visual child SpriteRenderer is created if absent. None gives no visible body. |
| Show Celestial Bodies / Sun / Moon | Toggle the group or one body, independently of clock/effects. |
| Path Center / Radius | World-unit offset and ellipse X/Y radii. Guide starting radius (8,4). |
| Size / Color | Local scale and tint; PPU/art dimensions also affect world size. |
| Follow Camera | Anchor to assigned camera XY; without it use controller world position. |
| Clockwise / Angle Offset | Travel direction and angular offset. |
| Manual Angles | Manual Sun/Moon angles; assigned clock can still control opacity/fading. |
At noon the sun should sit high on its path; test the moon at night. Missing bodies require checking sprite, visibility, alpha, radius, camera view and sorting.
Add light rays#
Use Lightweight or URP2D lighting, enable Light Rays and assign Ray Sprite/optional material. The guide starts with Count six, Opacity 0.16, Width 2.2 and Length ten; the newer screenshot uses different authored values. Place foreground silhouettes in front by sorting.
Ray controls#
| Field | Behavior |
|---|---|
| Count / Opacity / Intensity | Shaft count, base alpha and brightness; quality can cap count. |
| Width / Length / Spread | Base local shaft size and horizontal distribution. |
| Softness / Distance Falloff | Compatible-material edge/far-distance fading; higher falloff shortens visible shafts. |
| Variation | Deterministic spacing/size/brightness; zero is uniform. |
| Sorting Layer ID / Order | Draw behind foreground silhouettes; guide example order -31. |
| Lighting / Wind / Celestial | Intensity sync, wind sway and visible-body direction sources. |
| Owner Layer | Allows the layer's visibility and Light Rays Enabled state to control rays. |
| Canopy Mask / Strength | White passes, black blocks; zero ignores. Requires compatible material. |
| Synchronize Lighting | Blend color/alpha using computed Sun/Moon intensities; off uses constant Sunlight Color. |
| Follow Celestial Direction / Angle | Use visible body's direction, falling back to Angle without the reference/option. |
| Animation Speed / Sway | Phase speed and angular sway; zero speed freezes phase. |
| Wind Influence | Additional angular sway from assigned wind. |
What masks do#
Canopy masks approximate atmosphere in ray-local space; they do not create geometry-based leaf shadows. Foreground occlusion is sorting-based. Use authored URP shadow integration for appropriate 2D shadows.
Reduce opacity/intensity for overbright shafts. Test synchronized alpha at zero sunlight and night rays from moon intensity. Basic Tint suppresses rays even with their component enabled.