Summary


In this chapter you learned all about post-screen shaders and this concludes your graphics engine for now. Graphics effects are nice and can be a lot of fun to play around with, but this book is about game development and doing graphics work is only a part of it. In the next part of this book you will focus a little bit more on the other aspects like sound, input, and a general game engine. Some of that code was already used in the previous games and especially the Rocket Commander game uses sounds, advanced input classes, and also has a lot of game logic.

Here is a recap of some of the things that post-screen shaders can be used for:

  • Sky cube mapping (okay, it is a pre-screen shader, but it works similarly).

  • Rendering textures on top of the scene (blend overlay).

  • Inverting the scene map (that’s easy, just use 1-color).

  • Turning the scene map into black and white with help of the Luminance function.

  • Adding screen border effects, in this case to darken down the screen borders for a TV-like effect.

  • Glowing techniques and how to get them to perform very fast through down-sampling.

  • HDR faking by using an extra alpha channel in the glow shader. Alternatively you can try using better render targets supporting more than 8 bits per channel and allowing you to save HDR colors in the scene map, which then can later be used for real HDR effects.

  • Edge detection (well, that was your part).

  • Menu effects, noise textures in shaders, half-tone effects, and so on.

  • Color correction including brightness changing, contrast adjustments, and adding colors to influence the overall look of the scene. The sepia effect is also possible with a color-correction post-screen shader.

  • Motion blur, either per pixel or just for the whole screen. Additional tricks to improve the screen result by rendering a 10×10 screen grid instead of just one screen quad were also discussed.

  • And many more shaders.

I hope you found these last chapters useful and you were able to create your XNA graphics engine in a short time thanks to the many samples I provided with each chapter. In this chapter you can test out many post-screen shaders with the source code of XnaGraphicEngine, which is now quite a big and powerful engine allowing you to work with shaders, 3D geometry, sprites, post-screen shaders, and many more things without having to worry about any implementation details because it is all handled for you.

Using a multithreaded solution also provided you with great performance results for the Rocket Commander XNA game, but it is harder to program multithreaded.

It is easy now to rely on the graphics engine and stop writing unit tests, but don’t do that. It will hurt you later when you try to figure out why menu x does not work the way it should or unit y does this instead of that. With a menu unit test you can quickly find out what’s wrong and a unit test for the in-game units is probably also a lot faster to test and debug than going through the whole game, setting everything up, and then waiting for the error to happen again.

More graphics effects, physics, and the racing game are discussed in the last part of this book, but now check out Part III, which also gives you another great game (say hello to my little shoot-’em-up) and you dive a little bit deeper into the details for sound, input, and game logic classes.




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