Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Gestalthalcyon

How do you texture different kinds of terrain?

This topic is 5306 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This is a bit of a beginer''s question, but I''m trying to create my first 3d terrain engine. I looked through some of the past posts and didn''t really find what I was looking for so if this is the same question as someone else, at least I tried... So, if you want a terrain that has vastly different types of ground, such as rock, dirt, mud, grass, road, and maybe even more, how would you use OpenGL to effeciently display the different kinds of terrain? It would seem that you would switch textures between each different kind of terrain. The problem with this is that it seems like it would be slow to switch so many times. Another, worse problem is if you are using a vertex array, all you have is a list of coordinates to work with. It will render the whole chunk of ground in one call, with no oppertunity to switch textures between triangles. So, how would you suggest effeciently changing terrain types, even if the terrain changes alot? Thanks for any help.

Share this post


Link to post
Share on other sites
Advertisement
google for procedural terrain

"A soldier is a part of the 1% of the population that keeps the other 99% free" - Lt. Colonel Todd, 1/38th Infantry, Ft. Benning, GA

Share this post


Link to post
Share on other sites
Well, I looked through the first few pages of results and really didn''t see anything that looked useful. Maybe you had a specific article in mind?

All I''m looking for is some direction on how to make it look like you have switched the type of terrain in predefinded locations. For instance, your going along on some grass, and there is a sudden change in texture to a thin, old, cracked highway road. You get back on the grass and continue until the grass starts fading into beach sand. That would be the optimum but I would settle for either just a sudden change or the gradual shift.

Unfortunatly, I do not know where to start. I can think of several way to do it that probably wouldn''t work very well, but I need a good solution that will run fast. Can someone help me out by giving me a quick overview of what you would have to do to get something like this working in OpenGL?

Share this post


Link to post
Share on other sites
Well, since you seem like a nice and polite guy...

The naive approach would be to have a certain amount of textures, and blast the whole terrain out with each of the textures but with different alpha values for the vertices (that way, you can reuse all but the color buffer) so that each and every part seems fully textured.

A refinement would be to dynamically remove certain parts of the terrain for certain textures, if they are not used. This might be hard to get efficient, since you don''t wat to touch intividual faces but instead work with groups of them.

Well, now I''m going to point you to further sources:
A good thread for terrain rendering. Somewhat dated, though. There are more good topics - search the graphics forum.

Share this post


Link to post
Share on other sites
Ok, I looked over that old post that you linked to. That anwsered most of my questions. The only thing that is still confusing me is how in openGL do you actually assign a different alpha value (weight) to each texture of each vertex? Can this be done in normal multitexturing? I haven''t had much experiance with it.

Thanks for the help.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!