I basically have an item which comes as two images with their own alpha maps. However, there doesnt appear to be a way to mix the images together.
Basically i want it as though in paint you’d pasted an image over another one - the background is still see-through, but wherever there isn’t transparency in either of the images, it will show fully.
Using an add shader at the end results in the image as given. Using a mix shader gives the item correctly with the transparent areas not visible, but also the entire item is somewhat transparent and ghostly. Is there any way to fix this?
First step is to mix both textures’ color information based of the alpha of the one that is supposed to be “on top”, then the combined (added) alpha of both textures is used to mix the transparency in.
Could you please show us what was your initial attempt at the Mix nodes? Node tree and samples of your images?
I somehow doubt Adding Transparencies created from image alphas is the right way to go…
I would upload the file, except i cant find any file sharing website except dodgy looking ones and blenderartists doesnt have a way to upload blend files any more, any suggestions?
Sorry, but that’s not even remotely close to my node setup…
Instead of my Color > MixRGB node you used a Mix Shader node and instead of my Converter > Math node you used an Add Shader node.
If you’re unsure what node is used, always mind the color coding of the inputs and outputs!
Sorry can you please explain which nodes in your image are which? I have no idea as it seems both of the shaders you used have the same look and name as the mix and add shaders and I cant tell which ones are and arent. I cant mind colours because in my blender version there arent any, and everything is grey.
By the way, with color coding I referred to the little colored dots marking the connectors of any node - those are colored in your version as well…
If you e. g. see a node with yellow connectors, you know that color information is supposed to be fed in there. If the connector is blue, it expects vector information. Green is for shading information etc.
Top left: MixRGB, top right: Mix Shader Bottom left: Math (in Add mode), bottom right: Add Shader
If you examine the data type those nodes need as input and produce as output, they look nothing alike!
Thanks, with that, i have managed to get it to work as you have. However, one other question remains, how do you turn on the node colours so you can understand which nodes you are looking at? In my version they all have grey colours by default, and if I had known they had in-built colours, the confusion would probably not have arisen.
Thanks, I too was able to use the nodes you posted.
I also have another question: how do you make one of those images partially transparent? (The one in the back) I can’t figure out at what part of the node tree you need to add a mix shader with a transparent shader or whatever.
Not sure if I understand your question… Could you give an example?
BTW, in my render the image in the back is partially transparent, due to its own alpha channel. If you want to add additional transparency to the image in the back - what is that transparency based on? A third texture?
My node setup is about (mostly) not having to mix shaders at all, but mixing both images based on their color and alpha levels. To further explain my node setup:
The red part combines the color data from both textures based on the alpha of the “top” one, thereby bringing that, well, on top.
The green part mixes the diffuse shader with a transparent shader based on the combined alpha of both textures. Changing the “type” of the math node allows for interesting effects, quite like “booleans” between the two textures’ alpha values:
By “partially transparent” I mean like glass. As in alpha=0.5 or whatever. So that, for the red image, the grey background partially shows through the red, but for the green image, it’s solid green. Like green (opaque) paint on red glass.
AH, I see. I think it’s easiest to just add a Converter > Math (Multiply) node between the Alpha output of the red texture and the top input of the Add node. The factor for the multiply will determine how transparent the red area is.
Mind you, though, that with my nodes you’re still only mixing colors. The other shading attributes are the same for the red and the green areas. So, if you e. g. want an opaque diffuse green decal on a red refractive glossy plane, you will need to change the approach from mixing colors to mixing shaders.