Terrain Texturing

Started by
5 comments, last by Hamster 21 years, 11 months ago
Hello, I''ve finally found an understandable LOD terrain algorithm that I''ve been playing with for a while. I''m now wondering how to texture it professionally to get landscapes such as those in Battlezone II, where rock styrations appear on steep gradients, sand ripples on dunes and gravel on flat ground. All these different textures blend into each other seamlessly and realistically. I''m wondering whether the technique used is to generate a huge texture in one file and apply it to the terrain model, or have a file which specifies which of a set of small textures should go where and its associated alpha value. If that is the case, would you reccomend using multitexturing extensions or just alphablending everything on top of each other. Thanks for your help "In the beginning, there was nothing... which exploded." - Terry Pratchett
Advertisement
Applying a large texture over the existing terrian is exactly what I would do. The one catch is that if you use only one image on a large terrain, the texture will be badly stretched. What I would do is cut up a large texture into a bunch of parts and lay them over the terrain in the proper order, then overlay that with a detail texture (To add a little something extra).

------------------------------------------------------------

Stupid divide by zero error. I should be allowed to tear a hole in the fabric of time and space if I want!
I have this idea maybe a bit brute force but very easy to understand for creating a texture map... It might eat up alot of memory while generating texcture or not depending on how it is done...

Technique 1
Say you have your 512x512 gray scale map, you then also have 512x512 sand , dirt, grass, snow images and so on for each height. You load up your heightmap data and then you start of by the lowest height range (sand) you read the first pixel and check it''s the height range of the sand image. You take that one pixel for the sand texture and you keep going on... once you have finished with the sand load up the dirt texture and restart... the good thing about this... Is because your going pixel by pixel, you can have details per texture, so you can have diffrent cracks, spots, what ever for sand then for dirt...

Technique 2
You load the greyscale image data and you dfine a color value for each height range. Then for each height you apply the defined color... Problem with this is that everything will look solid. Then you can apply a detail texture above the final result...

Also depending on the height ranges the pixels will have to be blended in accordinlgy so teh textures transition correctly between them and not look like solid borders... This is for both techniques.....
my problem with using one large texture is that unless I write a program to generate it (from the heightmap or something), the look of the game varies from map to map, as a map i create might look alot different from a map my friend makes.

Recently ive been considering writing a program to produce a per vertex color index of sorts, id write a seperate program because i want to able to add roads and other things. There would be no texture in this file, just precalculated colors. Then I would apply a detail texture, which would do what a one generaly would think a ''texture'' does, it adds a feel to the terrain.

At least for my game this might work well, since I have a fixed camera angle, I can afford to tesselate allot of my triangles. Then again this might be too much work. Just compile the before mentioned color index thing into a regular texture and be done with it?

Sounds like an article is needed on this....... Mwuahahaha. Or a book (wink wink nudge nudge)!

Trent (ShiningKnight)
THE Engine
trent@voxelsoft.com
quote:Original post by ShiningKnight
Sounds like an article is needed on this


Like the other several also detailing the subject haha!



Death of one is a tragedy, death of a million is just a statistic.
If at first you don't succeed, redefine success.
You might be interested in this:

http://www.flipcode.com/cgi-bin/msg.cgi?showThread=03-30-2002&forum=iotd&id=-1

--Buzzy

This topic is closed to new replies.

Advertisement