Texture Splatting

Hi all

I have the following challenge:

I have a (square) mesh that represents a terrain/ground. I also have several textures and alphamaps that define, how the ground is painted.

It works as follows:

Image “Layer0” is painted first
Image “Layer1” is then painted over it, but premultiplied by image “Alpha1”
Image “Layer2” is then painted over it, but premultiplied by image “Alpha2”
Image “Layer3” is then painted over it, but premultiplied by image “Alpha3”

So far, so good, I can do this easily in photoshop and it works fine (for images, see top post on my site at http://www.riseofthemammoth.org/index.php/opengl.html).

The question is: How in the world do I have to setup the texture stack of my material (or what node setup do I have to create) to replicate this?

I’ve basically come to the point where I premultiply LayerX with AlphaX using texture nodes, but I don’t see a way to “overlay” Layer0 - Layer3 by their alpha. All mix options generate various levels of crap…

I can of course do all the combining outside of Blender, but that will increase the amount of files and data a lot.

Cheers

Hamu

Ok, since nobody came up with anything so far, here’s what I did (and I do NOT like it, even though it works fine, it looks way too complex):

http://www.riseofthemammoth.org/images/textures/nodesetup01.png

http://www.riseofthemammoth.org/images/textures/nodesetup02.png

I basically do the math of an alpha-based overlay by hand: color = layer0 * (1- alpha1) + layer1 * alpha1

Sounds like this functionality should already be in Blender, I’m just too stupid to find it…

Ah well… if anyone knows of a more elegant way of solving this, please let me know.

Cheers

Hamu

BTW, alternatively, I can precalculate this texture (it’s a 2048x2048 texture), but would Blender be able to handle 16 x 16 tiles with a 2048x2048 texture each? It’s kind of like a 32768 x 32768 texture, I guess…

Since I run on a x64 machine, memory wouldn’t be the issue, but will performance be acceptable (it’s not a game/realtime-environment, but rather a machinima/animation movie kind of thing…)

Cheers

Hamu

Have you tried the Mix node yet? It combines two textures and uses an alpha to determine which texture gets which part - it should do the same as your AlphaOverlay, except in one node.

It doesn’t seem to, no matter which mix settings I use… might be related to the fact, that I have the alpha and the colors in different maps… however, I’d be glad to be corrected :slight_smile:

Isn’t this what you’re trying to achieve? (Sort of, anyway, these alphas aren’t the greatest)

Attachments


I’ll give it a try and post an update…

ok… using the current alphamaps, this doesn’t work (they have the ALPHA value, not a value from white to black). If I recreate the alphamaps as BW, it might work…