Creating image-based lighting

The concept of using image-based lighting brings many advantages but must be used carefully. As such, it is beneficial to know about its properties and combine different methods where useful.

IBL allows CryENGINE 3 to render very complex lighting situations; usually, this is done with an infinitely distant environment map.

Positive points:

  • High quality
  • Fast for many lights and even a complex environment is reflected
  • Energy preserving specular power

Negative points:

  • Works only well for local positions with distant emitters and reflection content
  • Static content only

There are two distinct ways to generating an environment map or cube map from CryENGINE.

In this recipe, we will use the entity environment probe, which is the most convenient method.

Getting ready

Open a level in Sandbox.

How to do it...

Let's set up our own image-based lighting.

  1. Drag-and-drop the entity EnvironmentProbe from the MISC section of the RollupBar.
  2. Click on the entity property preview_cubemap to preview the cubemap.

    As we haven't yet generated a cube map, it will be completely black.

  3. Next, click the generate cube map button at the top of the entity.

    The Engine will then automatically bake the cubemap into a texture that gets stored in texturescubemapslevelname where level name is the name of the level that is opened when the cubemap is generated.

  4. You will also notice that the preview sphere now has the cubemap applied to it.
  5. Set the env Probe to active and adjust the radius parameter to observe the projected cube map reaction.

How it works...

Image-based lighting is a rendering technique where complex lighting is stored in an environment map, which is projected onto the scene. In simple words, a light probe or environment map is just an image on a sphere.

As this object acts as a light projecting the cubemap onto any objects within its radius, it allows the artist to create realistic environment maps based on the actual environment the object is in, rather than using a generic environment map.

Note

Even a single global light probe helps to improve the lighting, as the classical flat ambient is replaced by something that is direction-dependent and shows some specular and material behavior.

There's more...

There are many properties further available in the environment probe as well as a second way to create cubemaps.

Generating all Cubemaps

There is another function in the environment probe entity, which is the ability to bake all cubemaps for all light probes in a particular level.

This is quite useful for updating the environment maps throughout the entire level very quickly.

Creating a CubeMap with Material Editor

To create a local cubemap with the Material Editor, follow these steps:

  1. First, create and select the object that will serve as the center of the camera that will record the cubemap. In this example, the palette_box brush is used.
  2. With the object selected, open the Material Editor and click Get Material From Selection.
  3. With the object's material selected, click Generate Cubemap for the selected object.
  4. Enter a name for the cubemap, and click Save.
  5. Enter the resolution of the cubemap. 256 is the default resolution.

See also

  • To get the best out of image-based lighting it is best to have a level. Go to Chapter 3, Basic Level Layout to learn to create your environments
..................Content has been hidden....................

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