Texture Splatting

Blitz3D Forums/Blitz3D Programming/Texture Splatting

N(Posted 2004) [#1]
How come it seems that nobody has put texture splatting to use in Blitz3D? It would work really very well for terrain I believe.

I suppose the memory could add up over time if you used over, say, 3 or 4 textures, but given they had a low resolution of about 128 to 256 they would only take up about 2.2mb per splat texture. Of course, you could strip out those textures that are never used and cut down on it a bit.

In any case, I think that texture splatting could be very, very useful for terrain in Blitz3D. Come tomorrow I'll be attempting to write up a pseudo-terrain system that utilizes it. If I make any progress I'll open-source it.

If anyone else would like to have a go at it, this is the reference I'll be using (as far as I'm concerned it's the best): http://www.cbloom.com/3d/techdocs/splatting.txt


jhocking(Posted 2004) [#2]
What's the difference between "splatting" and the use of vertex alpha for painting terrain that you are helping to develope with FLE?


N(Posted 2004) [#3]
Far less polygons and splitting a mesh into segments for LOD wouldn't screw up the appearance. In the case of vertex alpha, there'd be a very (and I mean very) noticeable seam in the texture blending.

Ultimately, texture splatting would probably end up being more efficient (my former idea of textures using 2.2mb per splat was incorrect) in the long run due to it not having the disadvantages that vertex alpha-blended terrain present with (distance-based, typically) LOD.

Either way, it's a preference thing. I think exploring alternatives such as this would be a wise idea.


jhocking(Posted 2004) [#4]
Sorry, I didn't mean what are the advantages of splatting, I meant what IS splatting? I was under the impression that using vertex alpha for painting terrain is splatting. That link is a little too verbose for me to understand (what I read certainly sounds like the vertex alpha thing.) Could you provide a quick explanation?


AntonyWells(Posted 2004) [#5]
I'm also confused..to me it just reads like a fancier way of saying texture packing?

If all you're after is code to pack multiple small textures 'smartly' into a big texture, get my omni showcase. it has a leaf library contained in it to do just this...

if not, I'll give the tutorial another read, this time with my brain set to 'on'.


N(Posted 2004) [#6]
I'd provide a quick explanation, jhocking, but frankly, I'm still learning what it is and how it works, so you'd have to ask someone with prior experience in using this method. If I get anywhere then I'll happily explain it.

Dude: I don't think that's exactly what this does, but that's not to say I haven't taken a look at your Omni project. It's rather nice, but at the moment I don't have a use for it.


JoshK(Posted 2004) [#7]
My guess is he means using a texture mask for each layer, instead of relying on vertex alpha.


AntonyWells(Posted 2004) [#8]
Oh, if that's the case Vivid does this already with pixel shaders. It's possible to use a 3rd uv +mask layer to define the mask, and then you (Well vivid)multply's texture 1 by the pixel color of the mask texture, inverses the luminance, then multiplys that by the second texture...Then add the results together, and multiply by your ambient level..and bada bing. Perfect seemly texture transistions.

It works beautifully, and barely affects the frame-rate.

And cos your limiting each texture by a color alpha map you can also overlay a 3rd texture in this..A control texture.
Literally making it possible to write ANTONY in white letters, save this as the mask, combine this with the terrains rock and snow texture..run, to be greeted by ANTONY wrote in snow, the rest in rock...

Rambling again, but anyway, if you can get it running b3d noel, I'd go for it. I can't see how myself..(Many artists have told me it's possible in b3d...but their explinations made no sense to me ;) )


Pete Rigz(Posted 2004) [#9]
If I'm on the right track I think the closest you can get to this kind of texturing in Blitz is the insaner demo in the samples folder. That demo blends a path texture with a grass texture using an alpha map. With Blitz's texturing I think blending 2 textures together like that is the limit because if you load in another texture and another alpha map for it it overwrites the other textures you had.

In that link you posted he seemed to be using methods not available to blitz in terms of manipulating textures. He seems to have 1 alpha texture for each texture used on a terrain tile stretched across the tile, which is ok for him because he has the means to use multiple alpha maps per surface for each texture. Unfortunately I don't think this is possible in blitz. I'd love for someone to prove me wrong though because it'd be damn useful! :)

Theres no reason why there would be seams between tiles for a tiled terrain using vertex alpha though. Theres just the overhead problem of all the extra tris.


JoshK(Posted 2004) [#10]
Use a separate surface for each layer.


Pete Rigz(Posted 2004) [#11]
But doesn't that mean that you'd have to create the extra overlapping tris and be back to that problem. Maybe that is how that guy is doing it then, I thought he was using all the texture units on the card :)

I might just try that on my terrain system see if it works out quicker but I'm not convinced it would.