Archived

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

Different approaches to texturing a terrain.

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

Here are some ideas I have to texture my terrain. Note it is NOT a rectangular map, it uses a quadtree down to 64x64 or 32x32 and empty nodes are eliminated. 1)Tiles. Set each tile to a texture. Pros: easy to render. Con 1: lots of calls to setTexture, lots of vertex buffers of going through the rendering loop once for each texture. Fix: Put all tiles in one big texture. BUT when you use LOD, might have a big tile covering 4 small ones with different textures. How do you choose a texture, or do you not allow LOD to put different texture tiles in the same section? Con 2: LOTS of extra textures needed to describe blends between different tiles. Fix: Blend between different textures at each vertex. 2)One huge texture Pros:Very easy for simple heightmaps Con 1: Very wasteful for non-rectangular maps. Fix: One texture for each leaf in quadtree BUT now the problem of lots of calls to SetTexture comes back again. Con2: Very memory hungry to get sufficient resolution Fix: Multitexture in detail textures for each surface type BUT now get the problems of the tile-based approach. Also, what about lightmapping e.g pre-generating shadows. Do I implement this by pre-lighting the vertices (data lost when skipping vertices for LOD), or by storing actual textures (more calls to SetTexture, more texture stages needed)?. Any ideas what sounds best? I am on a space saving kick hence saving 8bit values for lighting per vertex to avoid lots of normals in-game, using tiles nice because you can use one byte to specify a tile. Thanks very much this is a real pain, don''t know what losses in image quality are likely to be able to get away with, don''t want to waste months trying all the different ideas...
Read about my game, project #1
John 3:16

Share this post


Link to post
Share on other sites
Have you thought about maybe not having LOD in there? If you look at games that use the tiling technique (Warcraft 3 and the PSX Final Fantasy games, for example), you''ll see that they do not use any LOD in them. I think it''s because it''s a terrible head ache picking out which texture to use on the collapsed polys (ie. your problem). If I remember correctly, you are using this to make a racing game. If you possibly increased the size of the actual tiles, then you could draw more tiles into the screen, and have fewer tiles going from left to right on the screen (does that make sense?). You could still use LOD on the objects on the screen (trees, buildings, etc), which I assume you''ll have because basic heightmaps are very limiting in the amount of cool details you can do. Anyway, thats just the first thought that popped into my head when I read you post. Ignore it if you want...

--Buzzy
(formerly buzzy_b)

Share this post


Link to post
Share on other sites
The majority of fields, etc. that I''ve seen have always been one huge texture. Of course, in a game with non-rectangular maps this may not work so well, because as you said, wasted space.

But why are your maps NOT rectangular?



Feudal Conquest, An Online Strategy Game, has just become an Open Beta!

We''re looking for Beta Testers!

If you''re interested or just want more information, head on over to: http://www.feudalconquest.com

Share this post


Link to post
Share on other sites
ok, this might not appeal to u, but consider it if u can...

For the terrain fix up, say 4, textures. Make sure they are tilable in all direction (for creating Tilable terrain textures refer the article in gamasutra or gamedeveloper). Use these textures to map the terrain (use combinations to avoid uniformity) with appropriate tiling amount. If you need u can use a second texture as detail texture(again u can fix another 2 or 3 textures). Now create lightmap textures using lighting. Optimize the lightmap textures so that the total textures are withing 4 to 5.

Now traverse ur world and create a list of polys/tris to render. Sort them according to one of these textures (trial and error to find the fastest combination). Render these polys in groups of textures. If you are sorting using the terrain textures, then select this texture into the first slot and change the other texture stages between calls.

You might think that this is a lot of texture state changes, but again did you actually calculate the total number of texture state changes happening while drawing your world models (other than terrain)? you might find those numbers higher than this. So you should probably reduce those changes by combining different textures into one and select that texture once. I think you can balance out the extra state changes in the terrain module with the model/prop rendering module.

Everything is trial and error, there is no single generic solution, all solutions are situation specific...

ps: also if you can identify the pattern of texture combinations for terrain, then you can cache the render state block for the frequently used texture combinations and set these in one call for subsequent rendering.

hope this helps...


[edited by - aanand_420 on July 25, 2002 1:57:42 AM]

Share this post


Link to post
Share on other sites
1)My maps are not regular rectangles becuase I don''t want to waste space with a track-based game storing terrain you''ll never even see or go within a mile of.
2)I need to use LOD otherwise I''ll have 100K+ polys in scene at once - it''s a 3d game so if you look across the map at the horizon or anything close, then the poly count goes up hugely.
3)Making tiles bigger would make the terrain look ugly - I''m working on 0.5 -1.0m resolution for the heightmap, tiles bigger than this reduce the ability to get fine detail into the level and take up lots of space.

Maybe could group into rectangles of the same terrain and apply LOD to those, so never have to cross boundaries. That means a much higher poly count than plain LOD, but you would get much better results. However trying to piece together all the different sections at different LOD to avoid gaps and errors in the terrain between adjacent sections sounds like a right pain to me.



Read about my game, project #1



John 3:16

Share this post


Link to post
Share on other sites