Archived

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

texturing tiles.

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

Hi all, I''m loading a heightmap map with one small texture streched out over the whole map and a repeating detail texture blended over it. How do I use different detail textures without those ugly edges? I can''t tell OpenGL to do per pixel blending, right? It would be far to slow anyways... Marty

Share this post


Link to post
Share on other sites
Sorry, I didn''t read right... I understand what you''re trying to do, but I''m not sure exactly how to do it...

I''m also working on a terrain engine, and I use a different detail texture depending upon the height, but not in the same way...

What I do is that I load two different (you could easily make this more if you wanted) and depending upon the height, I select a certain percentage of the color from each of them... I use this for the ordinary texture too.

I got this from an article on flipcode.

Share this post


Link to post
Share on other sites
What i mean is (the base texture doesn''t really matter):

How do i make textures blend into one another without having to check the aplha for each pixel in the tile.

1 = tile with texture 1
2 = tile with texture 2
* = smooth transition
__ __ __ __ __ __ __
|1 |2 |3 |* |2 |2 |2 |
|__|__|__|__|__|__|__|
|1 |1 |1 |* |* |2 |2 |
|__|__|__|__|__|__|__|
|1 |1 |1 |1 |* |2 |2 |
|__|__|__|__|__|__|__|

Now I don''t like my terrain to be blocky so the transitions can''t be in a limited amount if directions, more like the colors when I render an untextures triangle like this:

glBegin(GL_TRIANGLES);
glColor3f(1,0,0);
glVertex3f(-0.5, 0.5, 1);
glColor3f(0,1,0);
glVertex3f( 0.5, 0.5, 1);
glColor3f(0,0,1);
glVertex3f( 0.0, 0.0, 1);
glEnd;

Thanx,
Marty.

PS: I''ll have a look at flipcode...

Share this post


Link to post
Share on other sites
You could instead have one big texture over the whole terrain... This would give a non-blocky result.

Check out those articles on flipcode it''s nearly exactly what you''re looking for, unless you have som good reason you don''t want one texture for the whole terrain...

Share this post


Link to post
Share on other sites
Since it's gonna be a large RTS-game type map (about two times as wide and long as the large maps in C&C), it would take up more memory than any computer currently has to do everything in one texture.
This is, unless this texture is of a relatively low resulution, but then I would need detail textures. Here's where the problem comes. Some detailtextures are like decals (roads and stuff) while others should have a smooth transition (grass -> dirt -> rock -> etc...).
I'll divide the landscape in an octree like manner (more like quadtree since the camera height is limited I only do the x and y positions of the heightmap). The invisible parts of the landscape will be culled out. This means I can use very high quality detail textures and a lot of decals, because only so much is rendered.

Marty

[edited by - Marty666 on March 28, 2003 8:43:18 AM]

Share this post


Link to post
Share on other sites