Where to start?
Our whole solution is based on manipulating Unity’s two built in render settings variables:
How to manipulate these two variables?
We use a gradient for interpolating the ambient and fog color values.
Example of a gradient which can be used for ambient color values:
The Gradient class in Unity comes with a simple method Evaluate which takes a float argument (value between 0 and 1) and returns the color at that point.
How to use these two variables for our sky system?
All lit shaders in Unity use the ambient and fog color in their shaders.
Also if you are writing custom shaders, these variables are available as global shader variables
How to rotate the sun, moon, stars?
Parent these objects to an empty game object which is at origin.
Rotate this empty object based on the time.
How to get the cool sun flare fade in / fade out effect?
A simple solution is to just compare the position of the sun / moon and based on that we will change the flare power (from 0-1)
But a more elegant solution is to setup a horizon collider and whenever the sun / moon collider hits the horizon, we will either fade in or fade out the flare based on the time.
An alternate solution is to use a gradient and just change the alpha of the gradient based on the time.
In the code we will set the power of the flare based on the alpha value of the gradient.
The flare uses an Additive Overlay shader so it will always render on top using Additive blending.
Sample flare texture:
In addition to the flare, there is also a glow texture used behind the sun and moon which makes the effects look more dramatic.
Finally, a post processing effect is applied over the whole scene which consists of blending a gradient texture with Screen blend mode which makes the colors more subtle and also add some vignette.
After countless changes, the base concept for Neilos is finally shaped.
Here we are today. Featuring 3 Acts 21 Puzzles!
We had an incredible PAX West Day 3 with all of the people who came by the booth. Thanks so much for supporting our game. We are having a blast and are sad to see PAX ending tomorrow.
If you still haven't gotten a chance to check it out at PAX, we will have it out there for one more day at booth 7317 on the 6th floor of the main building.
Thank you from all of us!