Advertisement

Texturing Landsapes

Started by April 16, 2000 05:22 PM
1 comment, last by anonymous_coward 24 years, 9 months ago
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?
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 ::..
..:: Phrantik ::..
Advertisement
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.

This topic is closed to new replies.

Advertisement