Jump to content
  • Advertisement
Sign in to follow this  
boldyman

Terrain multiple detail textures

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

Hello, My current terrain engine uses a 'base' texture that is stretch across the whole terrain. And a detail texture is applied on a tile, to give the terrain (of course) more detail. I like to take the detail approach a step further. I want to use multiple detail textures. (So you can have a detail texture for grass and a detail texture for rocks and so on). (Like battlefield 2, they use a similar approach). Im thinking of making an array that holds tile information . (Say i have two tiles. Tile one uses the grass detail and tile two uses the rock detail). This should be easy to impliment. Now the problem. To make it look good, the grass and the rock detail should be "blended" to gether. In other words the there should be a transition between the grass and the rock texture. (Like transition tiles in 2d games). My questions: - with what technic can i to this ? (what is the name). - Are there websites on the subject ? (maybe a demo with source). - Have someone build the same thing ? (Please give me some tips). Thanx

Share this post


Link to post
Share on other sites
Advertisement
Maybe towards the end of this article might help. It's my first published article and not that deep but I'd be happy to discuss it via email/PM - basically I assign a "groundtype" to each vertex in my heightmap and blend between them.

Share this post


Link to post
Share on other sites
Yes this is almost the same thing i try to do. (ive read the article quickly).

I use procedural texture generation to generate the 'base' texture.
I just thought of it.
I think ill try to use the same technic for the detail textures.
(Not sure yet how to implement. Because the base texture is stretch accross the whole terrain. If using the same method, the detail of the detail texture will be lost.)

If someone has done this before and can give me some pointers, please do

Share this post


Link to post
Share on other sites
I know this can be done with shaders, if your willing to go that route. I believe the function that will do it is lerp, and I believe that the best route would have a third tile with the blend value then you can us the two textures and the blend value and lerp will blend them.

aText = grass texture
bText = rock texture
blendText = blend value texture

lerp(aText, bText, blendText)

I am not very good with shaders so this could be completely wrong.

Zwigby

Share this post


Link to post
Share on other sites
Ive never used shaders before. (Did buy the orange book but didn't have time to read it, yet).

I will look into it .

But what i understand is that all things that are done with shaders can be done without shaders. But you have to know the name of the technic to do a google on it.

Anyone else have a suggestion ?

Share this post


Link to post
Share on other sites
There's the term "texture splatting"...

The way you'd do this with a shader is you'd have a material texture where each color channel is a weight value for a different detail texture. For example, say you use R for rock, G for grass, B for sand. At a transition from rock to grass you might have R 0.6, G 0.4, B 0.0... So the final color would be 0.6*(rock texture color) + 0.4*(grass texture color). The detail textures themselves can be scaled as small as you want, only the material texture is stretched across the terrain.

Btw it's possible to do a version of this without shaders by using three black and white detail textures packed into one texture, and the DOT3 operator (usually used in normal mapping). But I haven't tried this myself :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!