CHAPTER 3 ■ WORKING WITH 2D IMAGES/TEXTURES IN XNA 3.0
263
Disabling Writing to the Depth Buffer
You still have to think about one last aspect. In case the particle closest to the camera is drawn
first, all particles behind that one will not be drawn (and this will not be blended in)! So when
you render your particles, you could turn off the z-buffer test for each pixel and render your
particles as the last element of your scene. This is, however, not a very good idea, because
when the explosion happens very far from the camera and there is a building between the
explosion and the camera, the explosion will be rendered as if it were before the building!
A better solution would be to render your scene as normal first and then to turn off