Cube Map

Cube map are textures that contain image data representing the scene surrounding an object, as if the object were in the center of a cube. Each face of the cubic environment map covers a 90-degree field of view in the horizontal and vertical, and there are six faces per cube map. Cube map commonly stored in .dds file, you can find normalized cube maps in Awakening's textures folder: normalizedCube128.dds, normalizedCube256.dds. You can select 'Add Cube Texture' from Texture Panel's context menu to load cube maps. All shader files for cube map can be found at the "effects\cubemap" folder.

Preview Explanation
Basic cubic environment mapping

Shader File:

cubemap.fx  (object space mapping, for dynamic rendered cube map)
cubemap_world.fx
(world space mapping, for static cube map)
cubic_room.fx ( for background cubic mapping)

Bump cubic environment mapping

Shader File:

bump_cubemap.fx

 


Dynamic Cube Map

Awakening can generate cube map real-time to actual represent the surrounding scene.

Workflow:

1. Create a cube render target
Right-Click in the Texture Browse Window, select "
Add Cube Render Target" from the context menu. Then select a cube map  file in Open File Dialog.

2. Create a mobile
Create a mobile, assume named '
teapot'.

3. New a shot, and select the render target
New a shot in Shot Panel; then set the shot's position to the mobile's center (just move view point in viewport).
In the 'Render To Texture' rollout, select the cube render target. Then click the 'Actions' button, add two actions:

Message Function Object
Render Texture Begin Hide teapot
Render Texture End Show teapot

Deselect the shot, otherwise the camera will fixed when running scene.

4. Create Material
New a material, set the cube render target to the 1st texture; load the '
effects\cubemap\cubemap.fx'; then assign it to the mobile.

Remark: By default, cube map generating use current camera's view direction; but there is a console variable r_cubemap_fixdir for fixing view direction.