Conclusions

In this tutorial, we’ve covered four ways to use vertex textures, but we have only scratched the surface on what can be achieved with them. The effects presented here are extendible, and can be made even more interesting and useful with some extra effort.

For terrain rendering, using vertex textures would allow us to have nested grids of different granularities that are always centered around the user. This way we would automatically have terrain level of detail. This is achievable with vertex textures because the height is only computer inside the vertex shader. This is used in the geometric clipmaps technique, created and documented by Hugues Hoppe and Frank Losasso. More details about it can be found here and here.

There are many ways to improve the particle system code. A very short while ago, a thread by Lord Ikon on creators.xna.com got me thinking about the particle system, and possible improvements. One improvement would be full-scene collision detection for all particles. We’ve seen how this is done for the terrain, when we have a heightmap. But I thought a little, and this can be extended to any object in the scene. What we would need to do is: render the scene from a top-down camera, and create a dynamic heightmap of the whole scene, with all the objects in it. Since we’ve just finished the fourth chapter, it’s not hard to imagine how this is done: with a orthographic camera, and a special pixel shader. This view-from-above can then be used in the pixel shaders that simulate the particles. This is especially useful for particles that fall from the sky, like snow or rain. The camera view can even be adapted slightly if we need to match the direction of the falling rain. Another issue with weather simulated through particle systems is the sheer amount of particles needed for this simulation. However, if we look at out particle sample, we can observe that when we stand inside the field of falling particles, the density and area is large enough for the viewer to imagine that the particles extend far beyond their actual limit. If we could keep the particle system centered around the viewer, all would be ok. But we need to take care of one thing: as the viewer moves, it has to seem like the particles don’t move together with him. So we somehow need to continuously move particles from the back into the front of the viewer. I’m still working on a way to do this, and as soon as I figure something out, I’ll let you know.

Some of the other effects that can be achieved using vertex textures include: cloth simulation, realistic water rendering, as seen in GPU Gems 2; and Ati has an example of sorting sprites using R2VB, which can be converted to vertex textures.

I hope you enjoyed this tutorial, and that it will make some of you experiment with vertex textures, and find new ways in which to use them. Be sure to let me know when you come up with anything interesting.