Why does this texture with transparent background turn white on glass?


I’d like to know the reason for this problem:

I created a texture without background to place it on a vitreous object. The font color is black, but it only appears in white in cycles. I could the use the Bright/Contrast or an additional RGB node to add some color but I can never turn it black again, the text only fades.

The invert node doesn’t work. Does anybody has an idea to fix this?

There is a couple of ways I would approach it. Either assign general glass then texted glass to separate faces, or a single texted glass material where you put all the non text UV faces outside the 0-1 UV range and setup an additional mask for it (shown below as it’s the most complex). That mask is then multiplied with the text alpha, and the result is used to shader mix two separate materials - a glass material and a text material, I’m using simple glass shader and diffuse shader for simplicity. You should not add together two principled shaders.

That UV map is special (similar as an anisotropic UV layout would not be used for something else) for this purpose only. If you want a UV layout for baking or assigning a dust texture or something, make a generic UV layout for that.

Firstly, don’t use the Bright/Contrast node to generate a color. You should only use it to brighten or enhance the contrast of an existing color or texture. Use an Input>RGB node instead, or just use the existing color swatch in the mix node.

Secondly, when using a Mix node, the bottom value is used when the mix value is 1. So using the alpha of your texture, the text and lines would have an alpha of 1, and the transparent background has an alpha of 0. You’ve set the bottom value of your Mix to be white, therefore it makes your markings white. Just swap the color inputs around and it will use the color from the texture instead.

Thirdly, the only time you should ever add shaders while maintaining any realism is when adding emission to a mesh object, or adding emission + scatter + absorption together in a volume. Adding 2 Principled Shaders, (or diffuse, glossy etc.) will make the object scatter twice as much light as it should. Use a mix shader instead.

That said, something like this will work much better.

Also, @CarlG, you know can set the image texture to Clip instead of Repeat, and it won’t extend past the 0-1 UV bounds, right? That node group is completely unnecessary.

Originally I had some procedural stuff affecting the text color, that setup does not work using clip which is limited to texture only. So yeah, for texture only, use clip.