Jump to content
  • Advertisement

Archived

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

anonymous_coward

Texturing Landsapes

This topic is 6733 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

What''s the best technique for texturing terran? The first method I thought of was to generate a large texture for the whole terrain, and then to split it up into the appropriately (read: maximally) sized pieces that the hardware can handle (256^2 for 3Dfx cards or 1024^2 or so for TNT cards). I tried to think of how one would tile texures across the whole of a terrain, but I can''t come up with any way do to that AND still have decent texture transitions AND have reasonable texture memory requirements. Any thoughts on this?

Share this post


Link to post
Share on other sites
Advertisement
Yeh, tiling the texture IS the best way! It''s pretty simple really.. Just make sure you load the texture with the repeat parameter, as in:

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);

And then, in your render loop, break the texture up according to the position of the segment. Lets say your putting it together by stepping through an height map array terrain[x,z]. Try:

glTexCoord2f(x,z);
glVertex3f(-- first vertex data --);

glTexCoord2f(x,z+1);
glVertex3f(-- second vertex data --);

glTexCoord2f(x+1,z+1);
glVertex3f(-- third vertex data --);

glTexCoord2f(x+1,z);
glVertex3f(-- fourth vertex data --);

That prolly makes no sense, but I suck at explaining this stuff! Hope it helps.. =)


..:: Phrantik ::..

Share this post


Link to post
Share on other sites
I understand HOW to do it, my question was one more of theory. =)

Actually, what you said IS easy, but what about transitions between say, a sandy beach and grass? You could have a transition texture, but the whole scene would look rather bland and repetitive, meaning you''d have to cook up more textures.

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!