Using the alpha channel as the input to "fac". (Cycles)

Say I have a Mix shader and I have a texture for a Diffuse BSDF and Glossy BSDF and I want to use the alpha channel of one image to determine the amount of “mix” between the two.

If I just connect the alpha output to fac in the mix shader then I don’t get the results I want. Whether the alpha channel is all white or all black, it doesn’t seem to make any difference. Basically it seems like I need to normalize the alpha values to something between 0 and 1 before they get input to fac in the mix shader, but I can’t seem to figure out how to do that.

I tried a math node set to divide by 255 but that didn’t do it.

Is there any way to debug what the output of various nodes actually is in numerical terms? Other than the obvious color coding, I’m not sure what sort of outputs are compatible with what sort of inputs. I especially don’t understand what “vector” does.

White, in cycles, is always 1… so for 8bit images it is converted across from being 255 to 1… So dividing it by 255 would have resulted in a value close to 0 the whole time.

The other thing is that the colour output, is either multiplied by the alpha output, or discarded and replaced with a value of one (the use_alpha tickbox).

Anyway i suggest plugging the alpha output straight into a diffuse node and the diffuse noded into the material output. that way you should see a black and white image on your object… if you dont, then you wont see any mix material going on.

Well, you should:



This is what puzzles me a bit. Do you really have an image with an embedded alpha channel? Or are we talking about an alpha mask = black and white image?