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

Normal mapping

The first effect that we are going to cover is called normal mapping. You may recall from earlier chapters that a polygon's "normal" is the vector pointing directly away from (perpendicular to) the polygon's surface.

Normal mapping

We use this normal when calculating lighting, where the amount of diffuse lighting for a given polygon is the dot product of the polygon's normal and the light direction. Until now, we have relied on the model file itself to give us each vertex's normal vector, but there are other more creative ways to obtain a normal.

The following screenshot depicts a flat rectangle with a brick texture applied to it. Because the wall ...

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