As you can see in the picture , I am mixing a colour from the image editor (for real time texture painting ) with a colour picker going into the mix node .
The image editor has alpha enabled and it's background is set to transparent .
Just mixing these colours together with the mix blend type is obviously not enough , since the mix attenuates the colour values .
So I used the alpha out of the texture node , inverted it and used this to control the fac input of the mix node .
So this is the kind of behaviour one would expect , like the photoshop layers
the only issue I am having right now is that the anti-aliasing filter is pretty obvious were the colours are mixed , like s soft edge surrounding the colours .
Especially noticeable on the red line
I tried adjusting the brush curve , also set the image node to NON colour data ..but it is still obvious
Does anyone have a better method for mixing colours ( of which one is from the imnage editor ) , or is this the best method
cheers
1 Answer
The alpha channel is always separate than the image, that is why it is available as a separate socket and can be used independently than the RGB information. In other words the Color output socket for the image node ignores the alpha channel, you must use the alpha output socket to use it as control on other nodes.
Also, you don't need to invert the alpha channel if you connect the Image node to the bottom socket. Just feed the color output to the bottom socket and set the other color on the top one.
It's easier if you think of the alpha channel as a mask.
Read the following links:
Overlay more than one transparent images in one shader
and
Change Color Associated with Transparency?
and:
Transparent image like a decal on mesh with principled BSDF shader
and