Summary


In this chapter you learned a lot about the creation of a full-blown graphics engine and you have gone through quite a lot of new graphics classes. Most of them were quite simple, but they are all still very important for the upcoming projects in this book.

Besides the many unit tests you explored and that helped you to stay focused on the problems you had to solve to get your graphics engine running, you also learned about the process of converting 3D data to the 2D screen space and in which way to use right-handed matrices in XNA. To use these matrices in shaders, which are required to render anything in XNA, you took a quick look at vertex and pixel shaders, but you will dive much deeper into shaders in the next chapters.

If you take a look at the new classes (Figure 5-15) and the project overview (Figure 5-13) you can see that there are a lot more namespaces than in the previous projects and you also moved some classes around and refactored them to your new needs. This was important because the switch from 2D to 3D is not an easy one and you can always improve the way the classes work and make the unit tests simpler. When your engine becomes more and more complex it is even more important to have solid framework with many unit tests you can fall back on in case something does not work the way you want it to. Otherwise it would just not be possible to write a unit test at the end of the book that renders a complex car with many shaders and over 20,000 polygons into a scene with shadow mapping, post screen effects, and cool glass shaders in just a few lines of code.

BaseGame is now your main entry point for the application and all internal classes are somehow connected to this class. BaseGame not only stores the device or content manager, but it also allows you to get the width and height of the render area, all the matrices you need to render shaders, and it stores many more useful capabilities in the properties that allow you, for example, to quickly enable or disable alpha blending.

Finally you learned a little bit more about using the Xbox 360 to test your graphics engine and all the pitfalls that can happen if you don’t test your game on the console early enough. In the next chapter you learn all about shaders and in Chapter 8 you will do some cool normal mapping, and you finally fix all these problems with the XNA models, tangent data, and so on. Then in Chapter 9 you learn about the powerful post screen shaders, which quickly give your whole game another look, and as an example game you can play the Rocket Commander game on the Xbox 360 with help of XNA.




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

Similar book on Amazon
XNA Game Studio 4.0 Programming: Developing for Windows Phone 7 and Xbox 360 (Developer's Library)
XNA Game Studio 4.0 Programming: Developing for Windows Phone 7 and Xbox 360 (Developer's Library)
Learning XNA 3.0: XNA 3.0 Game Development for the PC, Xbox 360, and Zune
Learning XNA 3.0: XNA 3.0 Game Development for the PC, Xbox 360, and Zune
Beginning XNA 2.0 Game Programming: From Novice to Professional (Expert's Voice in Game Programming)
Beginning XNA 2.0 Game Programming: From Novice to Professional (Expert's Voice in Game Programming)
Microsoftu00ae XNAu00ae Game Studio 3.0: Learn Programming Now! (Pro - Developer)
Microsoftu00ae XNAu00ae Game Studio 3.0: Learn Programming Now! (Pro - Developer)

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