Skip to main content
GameDev.net gamedev.net
🔒 Locked

Texturing a terrain engine

Started by Galshin Oct 21, 2000 at 1:52 AM 8 replies 800+ views
Original Post
Galshin
Galshin
I have seen a lot of information floating around the net on how to generate dynamic LOD meshes from heightmaps, etc... etc... What I haven''t found a lot of information on is texturing the terrain. I have the following questions: 1. What are some ways of texturing terrain that allows for seamless transitions between various textures (grass, dirt, rock, etc...) 2. What are ways of storing what textures should go where on a terrain map (maybe a seperate map corresponding to the heightmap that dictates what textures to draw where) And while we''re at it: 1. What are the best terrain generating algorithms out there (Quadtrees vs. ROAM vs. Binary triangle trees, etc...) 2. How to add effects like water to the terrain. 3. Brainstorms on how to add overhangs and caves, etc... to the terrain.. oh, and sharp drop offs (like the cliffs of Dover) without having to have rediculously large heightmaps. Basically any and all information I can get on terrain engines would be usefull (especially the texturing question) Thanks in advance, Galshin
Ferrit
Ferrit
Check out www.tashco.com

I'm sorry if I've mislead anyone, but I didn't create he above site.
The credit for that goes to tascho Studios.



Edited by - Ferrit on October 21, 2000 3:38:37 PM
md2ge
md2ge
I have a question about this. Right now I''m using a large (1024x1024) texture for my landscape, I figure it would look a lot better using a tiling system similar to what they talk about in that tutorial, what I can''t figure out is how to deal with LOD, In my engine I use a quadtree, after a certain distance a "patch" of terrain doubles it''s size in both directions, in other words I take 4 patches and turn them into one, this 4 patches would normally use 4 different textures at normal (LOD) resolution but now it would need to use a combination of the 4 to make a single texture? Or can textures be actually calculated real time?

Recalculating all the textures every time the camera moves seems to me slow, combining 4 textures into 1 run-time seems would faster but still not sure if it would work.

There''s probably a simpler, obvious solution I haven''t considered, as usual =)

Rick
Galshin
Galshin
Ok so I read that one article on how they blended textures together. I can only assume that all of those textures are pre-calculated? Surely they don''t calculate them on the fly. From what I understand of that article, do they pre-generate a whole bunch of textures for their terrain?

So if you have a 256x256 sized texture which covers X x X dimensions on the heightmap, doesn''t that require a bunch of textures for the entire terrain? Or are they stretched out enough to where you only need like 4 x 4 256 x 256 textures. (or something in that neighborhood.

Even this technique would have the same problems as the tiling technique... If you have LOD terrain, and a square of terrain doesn''t line up with your textures, then you would have to combine textures or something like that on the fly.

The only solution I can think of, which might actually work with the tiling technique, would be to set a minimum resolution of your LOD algorithm... So, if at minimum, your terrain engine never generated below a certain tesselation level, then you could set the size of your textures to that resolution. Then you are guaranteed that you never have to combine textures.

Any thoughts?

Galshin
zerwit
zerwit
I am also currently having a problem with texturing my terrain. In the article they say that one 256x256 texture covers an 8x8 area of the heightfield. So if you have a heightfield of 1024x1024 thats like 16,000 textures! Even with 512x512 its like 4,000 texures which is still way too much. So I the only way to use their technique is on a heighfield of like 64x64.

I was thinking about having maybe 6 preset textures, and each heightfield sample would have one of those textures. The problem is of course, your lod will make it screw up.

The technique I''m currently using load''s a texture the size of the whole terrain and just puts it on. This way I can put lighting into the texture directly. The downside is that its very low resolution. I would be very interested to hear how other people have done it.

*** Triality ***
*** Triality ***
bishop_pass
bishop_pass
quote:
Original post by Galshin

2. How to add effects like water to the terrain.



Oh Lord! The whole water on terrain question again. There was a rather lively debate regarding this a few months back of which I was one of the more verbal contributors.

Try this LINK to read it.



_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in
Galshin
Galshin
Any other ideas. I am not a fan of the 1 texture per heightmap idea because the terrain looks blurry (unless you use a really big texture) Does anyone have any metric on how big texture map you need to make a 1024 x 1024 heightmap look good? Or is a 1024 x 1024 heightmap too big?

Is there some intelligent way to tile the terrain? Eg. tile a single texture map over all grassy areas, and then make special "transition" texture maps that blend between terrain types... eg. transition textures to blend between grass and rock?

Galshin
DefaultUser
DefaultUser
Hi! I just want to ask how you guys put images in your messages, like Ferrit. And when putting source-codes they have that special box for it. How do they do that?

-Thanks
Forget about that buggy code, let's start all-over - from scratch. Let's go!
Premandrake
Premandrake
I''m going to simplify this discussion down to texture transitions and how they are generated.

Generally, texture transitions are generated on the fly as the texture comes into view, or is within a certain radius of the camera. You can do this by software mixing the textures together, then uploading the new texture to the card.

This algorithm works well for dynamic quadtrees because you can use lod for the textures also (this is how to solve the memory problem of having a huge terrain). So, if the quadtree unit is off in the distance you can use a smaller texture as the landscape unit gets further away. So you might drop to 64x64, then 32x32 and so on..

Two simple ways of finding which texture to use at any particular point is to either use: a) The height of the landscape at the given point, b) The slope of the landscape at the given point. So if you had two textures and were using (a), then if your height was 128, you would blend in half of tex1 and half of tex2. This will produce nice transitions and can be done very quickly, if optimized properly.

Hmm.. As for the caves/overhangs question, you don''t have to generate your data from a height-map if you are using a quadtree or even octree. Of course you will need different lod methods for handling these special features, but thats all part of the fun .

Hope this helps...

PreManDrake

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.