Rendering Environment Maps

Environment mapping is a technique that can be used to simulate a highly reflective surface. You may see this effect in racing games, where a bright shiny car “reflects” the clouds above it, or where a “new” ice hockey rink seems to reflect the players as they skate on it. A common way to implement these environment maps is to use a cube texture (a six-sided texture), and we will show this technique now.

Before we begin looking at this code specifically, you will once again need to create a new project and get it ready for coding (including adding the references, the device variable, and setting the window style). We will also need two of the meshes that ship with the DirectX SDK, the car model and the skybox2 model ...

Get Managed DirectX® 9 Kick Start: Graphics and Game Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.