   Terrain Splatting
  Hi, I've been searching for some terrain splatting methods for a while, but each solution I found has some nasty limitations. Apart from one case all solutions describe blending of 4 up to 9 textures. One different was about Megatexture. Let's assume my priority is to be able to blend as many textures as I wish (or as many as I can think of, e.g. 50 types of grass).  I'm just wondering if really the only reasonable way to achieve this goal is to use a MegaTexture? Is it an illusion that terrain in some games seems more attractive than it is in fact, as if it was consisting of many more textures than just a few? A Megatexture, let me say in general, has also other specifics and doesn't have to be terrain blending only. So from another point of view I'm not even sure if terrain blending is a sufficient argument to use megatexture. Especially that this approach is quite demanding. What do you think about it?Is there any competing solution to blending of very numerous textures? I'm a bit out of luck in finding an answer to my doubts, so I'd appreciate a suggestion about what to look for at least. Of course if such a blending technique exists.Thanks!   
  If you render in multiple passes you can blend as many materials as you like. It won't be fast tough...But, the 4 to 9 (?) texture limit is per draw call. So if you cut your geometry up into chunks that need no more than 4 (usually less, actually) textures blended, you don't need any fancy virtual texturing stuff. That's how games normally do it.I hope that helps!;  Many games use geometric decals to spice up an otherwise quite boring landscape. Crysis, for instance, does this. You can use them to add grass patches distributed irregularly, pebble clumps...you alpha blend these decals with the underlying terrain and the result is acceptable.But if you end up using megatexture for the terrain, then use it for everything!   ;  It's highly unlikely you need more than 4-8 textures in a given pixel. Try splitting your terrain up into smaller meshes, and texture each mesh with 4-8 unique textures. (After writing this I just realized that this is exactly what Rattenhirn wrote :()You'll have to put together a unique editor, but the TES series does this and I'd imagine WoW and most other big names do this too.As Arkano22 mentioned, decals are also a great way to go.Or, use grayscale detail textures and pack 4 textures in 1 texture (1 per RGBA channel) and work with it from there. Have an additional layer as a color map, and some extra textures as color noise.   ;  Like someone said, if you split it into multiple draw calls yes, in one given texel you can have up to only 4 merging textures, but over the map you could have infinite, if you make it cleverly.   ;  Thanks for your answers! It seems that terrain rendering is in most cases trickier rather than complex.May I only ask what you mean by geometric decals? Simply a separate object with its own texture or/and shader? Well, this is a neat approach I think.What about splitting first (and then splatting :))? It was the solution I was always closest to and maybe I'll try to mix both techniques you suggested.One thing bothers me, though. Consider blending only. I'd like to have a base (background) texture - for instance sand. Now it'd be great to have some grass here and there, which I want to put over the sand with a brush tool in my map editor. The question is, how should this brush actually work? Edit an alphamap? But what if the terrain is large? So again, should I split the alphamap into chunks? I've seen a nice example of terrain splatting with 4 textures and an alphamap for a 512 pixel square area. So could it be a way to go to divide the terrain into such areas and do the splatting separately in each of them? Or maybe is this just the place, where decals should be introduced? I'm asking about such details, because although I think I get the basics, there's something missing to grasp things fully.And I guess, a megatexture is an overkill in my rather simple case.[Edited by - crocodilealonso on May 10, 2010 9:46:02 AM];  Alpha maps follow the same rules as the other textures. Only use them where you actually need them. If your terrain is 80% sand and 20% grass with alphamapped edges, you only need alpha maps where sand touches grass.   ;  Ok, thanks. I'll think about how to bring it to life.   ;  You can put the splatting weights into the vertices if you want, and linearly interpolate between the verts instead of using an alpha map if that makes things easier for you.   