This package was created to speed up the creation of realistic day/night cycles in HDRP. Includes two controllers: Simple for straightforward systems and Advanced based on astronomical calculationsDepending on the version of HDRP you use, you should install it directly from the Package Manager.Originally based on my YouTube tutorials, this package has evolved into a ready to use solution. It includes advanced features and algorithms not covered in the videos, saving you hours of work on complex calculations and scripting. The included prefabs are ready for immediate use in your scene and everything is built around Unity Physically Based Sky to create a realistic day and night cycle at a low performance cost.Now available in two versions, so you can pick the one that fits your project:Advanced: a full astronomical simulation built for projects that need real world accuracy. It calculates the actual position of the Sun and Moon based on date, time, latitude and longitude, giving you correct sunrise, sunset, moonrise and moonset times. It also features a complete Moon phase cycle with individually tuned intensities, smooth automatic shadow switching between Sun and Moon, and eight independently configurable twilight zones, each with its own sky color and light temperature. This version is ideal for simulation focused games, open worlds, or any project where the passage of real time, location and season matters.Simple: it gets you a simplified day and night cycle at a low performance cost. Instead of calculating real Sun and Moon positions from date, time zone and geographic coordinates, this version lets you directly set the Sun and Moon azimuth and elevation and lets you shape every aspect of the lighting intensity, color temperature, sky tint and star visibility. This version is intended for projects where a simple day and night cycle is sufficient and precise astronomical calculations are not required.With "[HDRP] Day/Night Cycle" creating stunning, realistic, and atmospheric environments becomes easy, fast, and enjoyable. All you need is a few seconds and a few clicks to enrich your game or project.ADVANCED:Real Astronomical Sun Positioning: calculated from date, time, latitude and longitude using Meeus low-precision solar position algorithm, giving physically correct movement across seasons and locations.Accurate Lunar Motion Model: Moon position is derived from a 60-term periodic series (based on NREL lunar ephemeris data), producing a realistic Moon path, distance and angular size instead of a simplified circular orbit.Real Sunrise, Sunset, Moonrise & Moonset Times: are found through a minute-by-minute numerical search across the day, corrected for the true angular diameter of the Sun and Moon, giving rise/set times accurate to within roughly a minute for any date and location including edge cases like polar day/night.Moon Phase Cycle: The full 8-phase lunar cycle (new moon, crescent, quarter, gibbous, (each waxing and waning) and full moon) features 5 individually adjustable light intensity levels.Atmospheric Refraction & Parallax Correction: Sun and Moon altitude are corrected using Saemundsson refinement of Bennett's atmospheric refraction formula and lunar horizontal parallax.Delta T Correction (Terrestrial Time): Full polynomial Delta T approximation (Espenak/Meeus) is applied keeping calculations accurate across a wide range of simulated years.Sidereal Time & Star Rotation: Star skybox rotation is driven by Greenwich Mean Sidereal Time adjusted for your longitude, combined with latitude, so the night sky rotates the way real stars do regardless of the hemisphereEight Independent Twilight Zones: Day, Civil/Nautical/Astronomical Dawn and Dusk, and Night each have their own horizon and zenith color gradients and Sun color-temperature curve.Addon Support: addon system accessible directly from the Inspector, allowing the core day/night simulation to be extended with additional modules. Includes two addons at launch:Eclipse Correction*: Automatically corrects solar eclipse behavior regardless of the Sun apparent angular size, for physically consistent results.Skybox Fill Light: Adds a subtle ambient glow to the skybox so the sky never goes completely black even without moonlight.*lunar eclipses are not simulated, as Unity terrain represents only local ground, not the Earth as a whole body capable of casting a shadow on the MoonSIMPLE:Flexible Light Intensity - Achieve desired visual effects by adjusting the intensity of sunlight and moonlight at different stages of the cycle.Light Temperature Settings - Precisely control the light temperature of the sun and moon, emphasizing differences between sunrise and sunset. Give your atmosphere a realistic appearance by adjusting the color of the light at different times of the day.Full Control over Sun and Moon Positions - Define the azimuth and elevation for the Sun and Moon independently, allowing for more detailed and personalized settings for the light in your game.Realistic Skies - dynamic transitions between day and night, thanks to the script based on a Physically Based Sky.Starry Night Settings - Set the rotation point of stars and adjust their visibility during the night, enhancing the realism and beauty of your nocturnal scenes.Controll all parametr via Unity Inspector - Easy and user-friendly operation using the Unity Inspector makes using the asset straightforward, even for those with limited programming knowledge. Each function has a description so you don't have to look for everything in the manual.Customizable Horizon and Zenith Tint - change the horizon and zenith tint during cycle.Easy Script - simple script to expand if necessary, all function with comments.Real-time preview - every change to the settings is immediately displayed in the scene preview.Optional 'TransitionLight' prefab - that simulates ambient light during day-night transitions to keep the scene from going completely dark.Documentation - documentation is included to guide you through setup and customization.




