In this recipe, we will go through the creation of a basic time of day for your level.
A common sunny daylight environment can be easily created using a bright yellowish sun color, a bright blue color sky to be used for ambient lighting, and finally, an angled sun direction to get some interesting shadows.
For this tutorial, you should have the forest level forest.cry
opened. This level is installed automatically as a sample when you install the SDK.
Usually, when creating your own time of day, you should use photo reference or fairly specific concept art. Experimenting will allow you to find an interesting mix of values, but in the end you may want to achieve a certain look. So having a goal before beginning to adjust the time of day is recommended.
Notice, when you highlight any of the basic parameters in the Time Of Day dialog there are already key frames created on the timeline. This timeline is represented by the 24 hour slider at the top of the interface. Since the best way to learn to manipulate the time of day editor is to create your own, let's go ahead and reset all the values.
This will effectively remove all the key frames outside of the default values at 0000 and 2400.
Next, let's set the current time in the level so that we can see the sun.
Having the sun intersect some geometry will allow sunrays to be shown more clearly.
The first setting we will adjust will be the color of the sun. The sun in CryENGINE 3 is an advanced dynamic light. Adjusting the sun color in simple terms will adjust the diffuse color for this light.
Next, we will set the sky color.
Though the setting is called sky color, it is more accurately the ambient lighting color for the entire level.
To observe the effects of changing this color, simply look anywhere there is no sun affection on objects from the sun lighting.
Let's first set the color to the currently visible color of the sky:
The sky color multiplier works as the ambient color multiplier. Since we are going for a more realistic looking time of day, set this down to 0.8.
Next is the Fog subsection of time of day. In our case, we only need to adjust the global density value.
When using a dynamic sky, some haze is already calculated by the sky model. The fog specified by the fog color gets added to that haze. In many cases, the haze may be enough to get properly colored fog for a given time.
As we do not require a high amount of fog for a pleasant realistic scene, let's set the global density to a value of 0.02. The next setting we adjust will be the Sky Light parameters. We can use a handy feature of the Time Of Day dialog to copy and paste the RGB values from the sky color.
Use the sun color for a source color to warm the map or use the sky color to cool the map:
For the time being, we will not be setting any parameters for the night sky and night sky multiplier as we will discuss that later. The final setting we will adjust for our basic time of day will be the Sun rays Effect.
The sun in the CryENGINE is approximated by a colored directional light without distance attenuation. This is important to understand as its properties are similar to that of a regular light and properties such as color and specular level can be adjusted. However, there is an important distinction to the sun and other lights in the CryENGINE, as the sun uses a technology called cascaded shadow maps.
Sun shadows are achieved in the renderer by splitting up the view frustum into multiple parts that the CryENGINE can handle separately, also known as Cascaded Shadow Maps. Additionally, Variance Shadow Maps are also used for the lower resolution shadows from the terrain.
Sky light parameters are solely used to compute the atmospheric appearance of a dynamic sky. They do not directly affect the rendering of objects in the world (for example, lighting colors and intensities). However, they are used by the engine to compute an approximate fog color to automatically fog the entire scene in the appropriate colors.
The Time Of Day dialog has a huge variety of settings to simulate realistic and surrealistic lighting effects. Having completed setting up the basic parameters will make it substantially easier to adjust the advanced effects that the time of day allows you to adjust to achieve a photorealistic-looking outdoor lighting.
You may want to know what the reason for forcing sky update is, or what the record and play functions do.
Setting the Force sky update to True in the Time Of Day dialog forces a complete update of the sky light calculations in each frame shown in the perspective view. Should this not be set to true, the sky light calculations will be distributed over several frames and the time it will take to update will be highly dependent on the platform that is running the engine. You should be aware of this when editing some of the parameters within the time of day as some will take extra time to update.
18.216.232.11