This sample shows you how to implement basic shadow mapping from a directional light where the view and projection of the shadow map adapt to the viewing frustum of the viewer’s camera. You can use the sample to shadow a large scene with multiple dynamic objects that cast dynamic shadows.
This sample shows how to efficiently render large numbers of billboard sprites by using a vertex shader to perform the billboard computations entirely on the GPU.
-The VegetationProcessor takes in a simple landscape mesh and randomly creates billboard polygons scattered across it. These new polygons are set to render using the Billboard.fx effect, and a number of different billboard textures and sizes are randomly selected.
-In the vertex shader, the billboard effect calculates vertex positions by examining the view matrix to ensure the billboard sprite will always face toward the camera. It also uses a per-billboard random number to make each billboard a slightly different shape, and to randomly mirror the textures on half of the billboards, adding variety to the results. etc…
-The billboards are rendered in two passes by using different alpha test and depth buffer settings to achieve almost correct depth sorting of alpha blended sprites without requiring them to be depth sorted on the CPU first.
XNA4AdditiveBlending (using SpriteBatch)
– Ship Model (alpha=0.5) & p1_wedge Model (alpha=1)
– Crate Box (alpha=0.5) & xna_logo Box (alpha=1)
– Danc_princess Quad (alpha=0.5) & nice Quad (alpha=1)