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.
|Basic cubic environment mapping
cubemap.fx (object space mapping, for dynamic rendered
|Bump cubic environment
Dynamic Cube Map
Awakening can generate cube map real-time to actual represent
the surrounding scene.
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:
|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.