09 / 20
Packages/2D Parallax Pro/Sun, moon & light rays
LIGHT & ATMOSPHERE
09 / 20

Sun, moon & light rays

Celestial sprite paths and atmospheric shafts with synchronized lighting.

English guideSource: Unity 6000.3.13f1 · URP 17.x optional10 October 2026

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#

FieldPurpose
Sun / Moon SpriteAssign artwork; a visual child SpriteRenderer is created if absent. None gives no visible body.
Show Celestial Bodies / Sun / MoonToggle the group or one body, independently of clock/effects.
Path Center / RadiusWorld-unit offset and ellipse X/Y radii. Guide starting radius (8,4).
Size / ColorLocal scale and tint; PPU/art dimensions also affect world size.
Follow CameraAnchor to assigned camera XY; without it use controller world position.
Clockwise / Angle OffsetTravel direction and angular offset.
Manual AnglesManual 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#

FieldBehavior
Count / Opacity / IntensityShaft count, base alpha and brightness; quality can cap count.
Width / Length / SpreadBase local shaft size and horizontal distribution.
Softness / Distance FalloffCompatible-material edge/far-distance fading; higher falloff shortens visible shafts.
VariationDeterministic spacing/size/brightness; zero is uniform.
Sorting Layer ID / OrderDraw behind foreground silhouettes; guide example order -31.
Lighting / Wind / CelestialIntensity sync, wind sway and visible-body direction sources.
Owner LayerAllows the layer's visibility and Light Rays Enabled state to control rays.
Canopy Mask / StrengthWhite passes, black blocks; zero ignores. Requires compatible material.
Synchronize LightingBlend color/alpha using computed Sun/Moon intensities; off uses constant Sunlight Color.
Follow Celestial Direction / AngleUse visible body's direction, falling back to Angle without the reference/option.
Animation Speed / SwayPhase speed and angular sway; zero speed freezes phase.
Wind InfluenceAdditional 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.

Adapted from the supplied guide · PDF pages 17–19.View source guide ↗
Keep creating.ERAGAN STUDIO.

Search a topic, setting or method across all package guides.