Generating Environment Cubemaps

Overview

Cubemaps represent the environment around a point and are useful for reflections and skyboxes. They can either be authored manually by an artist or can be rendered directly by the engine.

This tutorial shows how to generate a cubemap in Sandbox, that can be used as an input texture for a material. Static cubemaps can be kept pretty small in size because reflections can be blurry as long as you are not simulating a real mirror.

Technical information about cubemaps can be found in Image Based Lighting.

Creating a Local Cubemap

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 Selected Object.

4. Enter a name for the cubemap, and click save.

5. Enter the resolution of the cubemap. 256 is the default resolution.

6. With the cubemap created, place a common light source entity.

7. Set the Deferred shading checkbox, and click the icon in Deferred cubemap field to select the cubemap that you created in steps 1-5.

8. Now, adjust the SpecularMultiplier on the light (from its Entity Properties) and its radius, as well as the Glossiness and Specular Levels of the object (from the Material Editor). Adjust the levels, as well as the resolution of the cubemap to get the desired result.


Finished result.

Creating a Global Cubemap

To create a local cubemap follow these steps:

  1. Create the local cubemap as described in steps 1-5 above.
  2. Adjust light source radius to value >= 100.000 meters.