Summary


You learned a lot about advanced shader effects in this chapter and you should be ready now to create your own shaders and play around with some ideas you might have. Because shaders are completely programmable today it is impossible to explain all the possibilities and ways shaders can be used. In the future many more new techniques might appear and make games look even better. But shaders are not only used for games; certain applications try to use the GPU power for other uses too and there are several experiments that show how to use the GPU for math calculations or physics. It may sound crazy, but for some of these tasks the GPU is a far better processing unit than the CPU because it works so well for just processing pixels and it works in parallel with 24-pixel processing units or even more.

Here’s the list of shaders and problems you encountered in this chapter:

  • You saw that Normal Mapping can greatly improve 3D models. Objects with just few hundred polygons can look almost as good as 3D objects with millions of polygons. But in order to get them to work correctly you need valid tangent data in the 3D geometry.

  • By compressing Normal Maps you can save a lot of video memory while still having great visual quality. Use the NormalMapCompressor tool to quickly generate compressed Normal Maps.

  • FX Composer is still the program to do all the heavy lifting for your shader code. Visual Studio is nice for code, but FX Composer is clearly the better IDE for shaders. The preview scene is especially useful.

  • To work painlessly with shaders in the future several new classes were introduced into the graphics engine that allow you to load and render shaders (ShaderEffect class), assign and set materials (Materials class), and to use 3D geometry data with tangent support (TangentVertex structure).

  • Finally, you saw several other shaders including offset mapping/steep parallax mapping, glass shaders, reflection and water shaders, and the parallax mapping shader in the Challenge (I hope you got it right).

  • Playing around with shaders can be fun.

With all this new code you can now get ready for a new game in the next chapter, where you also learn about post screen shaders to greatly improve the visual quality and overall look of your upcoming games.




Professional XNA Game Programming
Professional XNA Programming: Building Games for Xbox 360 and Windows with XNA Game Studio 2.0
ISBN: 0470261285
EAN: 2147483647
Year: 2007
Pages: 138

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net