Home > Canyon Editor, OpenGL, Programming > Terrain Tuesday #6

Terrain Tuesday #6

February 16, 2010 Leave a comment Go to comments

I suspect that you all are extremely eager, to the point of violent fits of excitement and joy, to see the editor in action again, now with texture editing abilities. In fact, since you have been waiting patiently, despite such intense anticipation, I will put off telling you what I’ve done this week until after the video, which will come immediately following such time as this extremely long and unnecessarily convoluted sentence is over.

There were tweaks here and there, but the most important change to the code this week was vertex arrays. Warning: technical talk ahead. All this time, I’ve been rendering the terrain with immediate rendering – glVertex3fv, that type of thing. I know! But for those of you who don’t know, well, when you bump up the size of your terrain to, say, 193×193 vertices, for example, with multitexturing and color, you’re asking the program to make 1.3 million function calls per frame, just for rendering. I never intended to leave it that way, and that’s why. Enter vertex arrays. It takes some extra setup, basically setting up arrays and pointers for OpenGL referencing, but when it’s all said and done, it’s more like 25 function calls per frame. Nice, huh? What this means for you, the end user, is that you can work with bigger, more detailed terrains.

Advertisements
  1. February 16, 2010 at 7:51 pm

    Your canyon is grand, sir.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: