Sign in to follow this  

Terrain painting, working 4 texture limit

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

For my engine, I'm working on the terrain painting functionality in the world editor program. I'm using texture splatting to render my terrain chunks, this gives me a 4 texture limit on individual chunks... and until I find a better technique for texturing, this is how it's going to stay.

 

In my editor I have a large range of textures to choose from, and currently when you paint onto the terrain, the engine searches through the Chunk's 4 textures, if it finds the one that we're currently painting.. then it just adds to that channel.

 

But, the problem comes if we have 4 textures painted onto a chunk.. and we try painting another... currently my engine finds the texture with the least coverage and swaps that over to the one we're painting... which works, but sometimes it means swapping a texture that I'd rather not lose (it may have less coverage.. but it's more important.. like a thin path to walk on or something).

 

I'm just wondering how other engines /programmers address this problem of painting with limited textures, without hassling the level artist too much?

 

Jon

Share this post


Link to post
Share on other sites

Split your textures.

 

You can either do it one of two ways.

 

1) Texture merging

   

    Instead of having four textures (say  grass, sand, rock, earth) you combine them into a single texture. Grass top left. Sand top right. etc.

    Then in the pixel shader you modify the UV coordinates to grab the texture you want (or the mix of textures you want)

 

2) Multipass rendering

  

   Draw your terrain with four textures, then do another draw pass with another four textures.

   

 

I prefer the first technique, but the second is used very successfully in many engines. 

Share this post


Link to post
Share on other sites

Thanks guys, this helps alot! It's a shame we can't have 'virtual texture units' it would solve so many issues with texturing.

 

Jon :)

Share this post


Link to post
Share on other sites

Another approach which I worked on at a past company was to allow the artists to work on as many layers as they want, by flattening the result into rendertargets at runtime, with the flattened rendertargets placed akin to clipmaps. The editor gave the artists an indicator as to the complexity of the area and what general performance would be like.

Share this post


Link to post
Share on other sites
I paint "unlimited" layers onto my terrain by making each layer point to its painted triangles as a lookup into an overall chunk indexbuffer. I then draw each layer in a separate pass. Means you can then just treat each layer like a generic material with supporting normal maps, gloss maps, etc.

If you do need more than 4 layers per chunk, this is the best way I've found to do it on DX9 as tiling textures from an atlas is not something I ever got to look right. I believe in later versions of DX you can use 3d textures instead of atlases for one pass multi-layer rendering.

Share this post


Link to post
Share on other sites

For my engine, I'm working on the terrain painting functionality in the world editor program. I'm using texture splatting to render my terrain chunks, this gives me a 4 texture limit on individual chunks... and until I find a better technique for texturing, this is how it's going to stay.

 

 

I prefer this texturing technique to traditional texture splatting (Skip to the texturing part). It allows you to use much more than just the four (or five) texture maps.

Share this post


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