|XNA 4.0 Billboarding 4 Demo
This XNA Windows application builds on the XNA 4.0 Billboarding 3 Demo by showing you how to render lots of billboards. The single pass rendering technique used in the XNA 4.0 Billboarding 3 Demo won't work correctly in this demo. This is because the depth values of each billboard's transparent pixels are written to the depth buffer causing the billboards to be incorrectly rendered. The correct solution is to sort the billboards in a back-to-front order prior to rendering. However doing so is slow. A commonly used alternative that produces mostly correct results and is much faster is to use a two pass rendering technique. In the first pass render the non-transparent pixels of the billboards with blending disabled and alpha-testing enabled. In the second pass render the transparent pixels of the billboards with blending enabled and depth buffer writes disabled. Further details on this rendering technique can be found in the Microsoft XNA Billboard sample.
1. This demo requires shader model 2.0 or higher support.
2. This demo requires the XNA 4.0 Framework End User Runtimes.
Download executable, source, assets, and XNA Game Studio 4.0 solution files.