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

Creating the prelighting renderer

Let's now create a class that manages the effects we created and the rest of the prelighting process. This class, PrelightingRenderer, will be responsible for calculating the depth and normal maps, light map, and eventually preparing models to be drawn with the calculated lighting values. The following framework version loads all of the effects and the model that we will need to perform the prelighting process.

The PrelightingRenderer also handles the creation of three "surfaces" or "render targets" that we will render the depth, normal, and light maps into. Render targets serve to capture the output of the graphics card and store it in memory, much like a texture. We can then access the data in that texture later, ...

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