Stephen "Stone Lance" Heijster's Projects: |
Introduction : S&S Racing : Quake 3 Rally : Maya md3Export Plugin : AUV : OpenGl Terrain : Texture Blending : Physics Tests : Advanced Bot AI : Bot AI :
This terrain program uses bezier patches to generate the polygons for the ground. The bezier patches are generated from the alpha channel of a bitmapped image. After loading the height values from the image the control points on the edges of the bezier patches are modified so that adjacent patches are seamless and smooth. I like this approach because it allows for different level-of-detail models of the terrain to be automatically generated from the same data. A high detail model could be used for the visuals while a lower polygon model could be used to generate shadows for the terrain.
The terrain model generation still has a lot of room for optimization. Bezier patch data can be reused instead of reloading the image file and regenerating the patches. I would also like to figure out some way to create automatically tessellated terrain so that patches in the distance use less polygons. The problem to overcome for this to be useful is the seam mismatches along the edges of patches with different numbers of polygons. I am planning on adding polygons to adjacent patches with different polygon counts so that the polygon counts at the edges of the patches match.
Currently the terrain is only textured with a single texture. For texturing I am planning on using a method that will allow the terrain to be textured easily from the image. Using only a few textures I plan on blending textures to form transitions from one texture to another. From the same image used to generate the terrain I plan on using the RGB values as texture indices for the corners of each patch. By knowing the texture at the corner of each patch I can automatically create blended textures and then use them on the patch. This allows the terrain to have smooth transitions from one texture to another without using a lot of hard drive space to hold hundreds of textures.
Screenshots
-----------
Click to enlarge the image.
This is a screenshot of the same view with the show control points turned on.
Download
--------
Bezier Patch Terrain for Win32.
Controls
--------
Left Arrow - Rotate left
Right Arrow - Rotate right
Up Arrow - Increase terrain detail
Down Arrow - Decrease terrain detail
Numpad 0 - Toggle show control points
F12 - Take a screenshot
Escape - Exit
Problems?
---------
This program has only been tested on a geForce2 Ultra and a Voodoo 2. Since I have no other cards to test this program on I cannot help you if you are having problems with another card.
Last Updated: Sept 8th, 2002 | Email me at: stonelance at quakerally dot com |