Adjusting the terrain lighting

Having learned how to set up a basic time of day parameter, the next step will be to adjust the level's lighting direction and dynamic characteristics using the Terrain Lighting dialog. This tool allows you to set the direction from which the sun rises as well as the distance your location is from the North Pole to the South Pole.

Getting ready

For this tutorial, you should have the forest level forest.cry opened. This level was installed as a sample level upon the installation of the CryENGINE SDK.

How to do it...

We will now explore the terrain lighting dialog:

  1. Open the terrain Lighting Tool by clicking the Terrain section of the main toolbar and then lighting.
    How to do it...
  2. Under the Sun Settings section there are two sliders. Adjust the first slider called Sun direction (map orientation) to the centre most point on the slider. This aligns the sun so that it rises in the east and sets in the west.

    Note

    North is assumed to be y+ in the cryENGINE.

  3. Next, adjust the second slider named NorthPole..Equator..SouthPole to its centre most position.

    This will change the tilt of the sun; when set at the centre, setting the current time to 1200 will cause the sun to be directly above you. Adding a tilt in either direction will infer that your level's location in reality is closer to either pole of the planet.

  4. Adjust the tilt slightly towards the North Pole as this particular environment looks to be in the northern hemisphere.
  5. Click OK to save your modifications.

    Note

    When using the time of day feature, it is recommended not to have the sun perfectly at the highest position.

How it works...

The terrain lighting works in unison with the time of day settings to give the level its outdoor lighting characteristics.

It is good to have some rotation on the sun so that the shadows are not aligned with the world direction and thus, the objects that may be aligned. This is all to make man made buildings and other level objects look better as they are often world aligned and built straight up.

There's more...

You may want to know more about the transitioning in shading from the sun to the moon or how to adjust the terrain ambient occlusion.

Terrain ambient occlusion

Adjust the quality of the terrain occlusion by adjusting the slider at the bottom of the Terrain Occlusion dialog box. Increasing the Sky terrain occlusion quality (low..high) will adjust the amount of light occlusion and render a real-time preview. Terrain occlusion is often used to create the effect of indirect lighting.

Transition shading from the sun to the moon

A fundamental principal of the time of day is that there can be either sun or moon lighting, but not both. You need to adjust the Moon/Sun Shadow Transition (advanced) parameters to adjust the time when the sun should be active and when the moon lighting should become active and vice versa.

  • Dawn Time: This sets the time when the sun should rise
  • Dawn Duration: This changes the duration of the moon to sun lighting transition phase
  • Dusk Time: This sets the time when the sun should set
  • Dusk Duration: This changes the duration of the sun to moon lighting transition phase

SSAO (screen-space-ambient occlusion)

Ambient occlusion is a well-known technique in the movie industry to approximate the effect of indirect lighting. Usually, it needs to be computed during the game production time and it only supports static scenes.

CryENGINE 3 uses a technique that is very suitable for real-time and can support dynamic scenes. Because it does not have to be pre-computed, there is no production time lost in creating this effect.

SSAO (screen-space-ambient occlusion)

With SSAO (screen-space-ambient occlusion), you can expose the geometric detail of scenes and ensure that its complexity is retained. This is a screenspace effect, so performance is not affected by scene complexity.

You can adjust the SSAO amount multiplier in the Time Of Day dialog.

See also

  • The Generating a procedural terrain recipe in Chapter 2,Sandbox Basics
  • The Editing HDR lighting and effects for Flares recipe
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.179.59