Summary
In this chapter, I am sure you understand how shader works, including how to declare vertex formats and how to process vertex data through shader. If you have had the shader programming experience before, this chapter may not be the most exciting, but you may have learned some details that you did not know before.
The following steps describe how to process 3D data in xNa:
Obtain Three-dimensional Geometric data from the model class (or custom vertex buffers.
Please confirm your shader and xNaCodeUse the same vertex format.
Call shader technique and execute each pass to render your 3D data.
Vertex shader processes the input data and passes the vertexoutput structure to pixel shader to convert the world to the correct position on the screen.
Pixel shader finally displays each pixel on the screen. Make sure that pixel shader is fast and small.
In the next chapter, you will learn about the effects of Normal mapping (normal ing) shader, prepare for creating your own game in Chapter 8th, and learn the effects of post screen shader in Chapter 8th.