O'Reilly logo

3D Graphics with XNA Game Studio 4.0 by Sean James

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Cube mapping: Making a sky sphere

The second effect we will discuss is called cube mapping. A cube map is like a texture, but it actually contains six textures—one for each side of a cube:

Cube mapping: Making a sky sphere

Cube mapping is any process that involves sampling pixels from this texture. In the following sections, we will use the preceding cube map to simulate reflections off of an object, and to simulate a sky wrapped around the scene. Let's start with the sky.

We start by creating a new class SkySphere that keeps track of a model and an effect. The model is simply a sphere that our cube map will be drawn onto, and the effect (which we will create next) does that drawing. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required