← Back to blog patch notes

The Ultimate Guide to Sun and Moon Positioning in Super Simple Skybox for Unity

by Michael Sacco Feb 3, 2023
The cover for The Ultimate Guide to Sun and Moon Positioning in Super Simple Skybox for Unity

Super Simple Skybox is a powerful asset for the Unity game engine that allows developers to create stunning, interactive skiess. The latest update, version 3.0.0, brings exciting new features and improvements, including the replacement of SetSunPosition.cs withDirectionalLight.cs, and the addition of two new components, Sun.cs and Moon.cs. These new components make it easier than ever to position the sun and moon independently of each other, allowing for even greater control and customization in your Unity projects.

What is Super Simple Skybox?

Super Simple Skybox is a Unity Skybox that supports procedural skies, stars, clouds, and a day night cycle.

Understanding DirectionalLight.cs

The DirectionalLight.cs component is the cornerstone of the new sun and moon positioning system in Super Simple Skybox. This component serves as the base class for both the Sun.cs and Moon.cs components, and provides a simple and intuitive way to manage the position and intensity of your lighting. To use the DirectionalLight.cs component, simply add it to your game object and set the position and intensity values as needed.

The Benefits of Sun.cs and Moon.cs

The Sun.cs and Moon.cs components inherit from DirectionalLight.cs, and bring a number of new and exciting features to your Unity projects. These components make it easy to position the sun and moon independently, giving you greater control over your lighting and helping you create truly stunning and immersive experiences.

In addition to independent positioning, the Sun.cs and Moon.cs components also come equipped with events for sunrise, sunset, moonrise, and moonset. This makes it simple to subscribe to these events and create dynamic and responsive lighting systems in your projects. Get the relevant component (e.g., FindObjectOfType<Sun>()), then call subscribe to the OnRise or OnSet event from that component. Here’s an example:

Star Rotation with SetStarRotation.cs

The latest update to Super Simple Skybox for Unity also brings the SetStarRotation.cs component, which makes it easy to handle star rotation independently. This component is typically added to the same game object as Sun.cs, and provides a simple and intuitive way to control the rotation speed of your stars.

Automatic Shadows and Intensity

One of the most exciting features of the new sun and moon positioning system in Super Simple Skybox is the automatic handling of shadows and intensity. The sun and moon now automatically adjust their intensity and shadow settings based on their position relative to the zenith, making it easier than ever to create stunning and realistic lighting systems in your Unity projects.

Conclusion

The latest update to Super Simple Skybox brings a number of exciting new features and improvements to the sun and moon positioning system, including the replacement of SetSunPosition.cs with DirectionalLight.cs, the addition of the Sun.cs and Moon.cs components, and the introduction of the SetStarRotation.cs component. With these new tools, it’s easier than ever to create truly stunning and immersive lighting systems in your Unity projects.

Unlimited assets and tools for Unity.

Make your game look amazing with easy to use assets and tools for Unity. It's free