Land-o-Rama with shaders and VBOs

Published January 14, 2007
Advertisement
In my last journal entry about Land-o-Rama, I had a basic terrain-rendering class in place. Land-o-Rama performs LOD using a quadtree of patches containing regularly spaced vertices. It adds artificial detail to the terrain mesh at runtime so that it can render terrains as large as 32K x 32K.

In the first renderer class I made, Land-o-Rama drew the patches using basic OpenGL 1.1 code and did the vertex and normal morphing between LODs entirely in software. So by using shaders and VBOs, I figured that I could greatly speed things up.

I created a new derived renderer class to use VBOs and shaders. Instead of storing the patch pool in system RAM, it stores it in video RAM using VBOs. All patches use the same index buffer, so I only have to create the index buffer once. I also created a vertex shader that implements a subset of the OpenGL lighting and fog equations, plus vertex, normal, and color morphing between LODs.

I had no idea how much of a difference shaders and VBOs would make! The OpenGL 1.1 renderer could manage about 10-12 frames per second, but look at the frame rate now:



79 frames per second! Holy crap!

The next thing I worked on was getting rid of that horrible blue fog and replacing it with something that looked like real atmospheric scattering.
Previous Entry Oh noes
0 likes 2 comments

Comments

OrangyTang
That looks pretty sweet. I can't wait to see some more interesting fog in there too. [grin]

You seem to have some odd black crosses near to the camera on the left though, any idea what's causing that?
January 14, 2007 07:26 PM
jasjas
Quote:Original post by OrangyTang
That looks pretty sweet. I can't wait to see some more interesting fog in there too. [grin]

You seem to have some odd black crosses near to the camera on the left though, any idea what's causing that?


Hi OrangyTang,

The black crosses are there because I was using vertex-based lighting and these triangles are fairly large.

Edit: When using per-pixel bump mapping, those "cross" artifacts disappear.
January 14, 2007 07:30 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement