PNG texture image goes black on transparent parts

Hello good blenderers !

I am currently working on model that requires a PNG image overlaping on a blender texture (the grey band above the keyboard on the following image)

The problem is, even if part of the image is transparent, it appers at black in the viewport (and render). I tried a lot of stuff to pass over this, but nothing works… The MixRGB doesn’t take in count the transparency. I checked in google, and all the solutions proposed are not for this kind of situation (a mix between two textures), only for one texture alone.

Does anybody knows how to manage this problem ? The band must be totally visible as well as the white-but-a-very-bit-yellow-plastic texture, like shown in the first image (i divided the plane where the band image is on to achieve that, but i don’t like this method)

Thanks ! :slight_smile:

See the alpha output from your image texture node? That’s where your transparency is. If you don’t read it, you’re not even letting Blender know about your transparency.

Make a mix shader, use it to mix between a 1.0 white transparency BSDF and your main BSDF, plug texture alpha into the mix factor.

Doesn’t work… The part where the plastic texture made in Blender is below the transparent part of the PNG image becomes fully transparent (black in material preview). It must remain visible.

Or did i make a mistake maybe ?

Your nodes are fine, but I don’t understand what you want. I thought you didn’t have transparency, and you wanted transparency.

If you want transparency, just not there, then edit the image.

Maybe, I am not getting something right, but as Bandages mentioned, it is quite difficult to understand, what exactly the problem is.

I also don’t see any inputs in to your alpha channel.

I have rebuilt your setup You are in material preview mode so you see eevee. To see in eevee Alpha you have to use the blend mode e.g. on Alpha clip I also have the two slots in the mix shader swap maybe it’s this.
However, your color ramp makes little sense

1 Like

What i want to achieve is to mix the grey band PNG image texture (that have transparency all around, to fit the keyboard plane-size) to the plastic keyboard one, created in Blender. Like if it was a kind of sticker on it.

The alternative i found to this problem is to cut the plane with a rectangle that fit the grey band image, but i don’t like this method ; too much constraints.

The actual problem with the mix RGB in my first post is that the transparent part of the PNG image appears black, and i want it to stray transparent so we can see the plastic texture made in Blender.

In your images, you’re only using a single texture. I don’t know if this is a grey band or your keyboard texture or what. In those images, you’re not mixing between two images-- you’re mixing between one image and a colorized noise (which is neither bands, nor a keyboard).

If your “gray band image” defines which areas should be transparent, and by how much, then you can use it to mix with transparency like I’ve described. The question is whether it properly encodes what should be transparent-- if it encodes that the way that you want it to be transparent. If it doesn’t, what makes sense is to edit the image so that it does.

The keys are 3D object. Don’t mind it, it is not important for the problem. Just take in count the plane and the grey band, nothing else.

This last one has been created in Photofilter. Everything around the band has been set in photofilter to be transparent ; but we must see the band on itself.

The plastic texture where the band is on ha been created on Bledner itself (with noise texture, a color ramp, and also a bump fto make it more realistic, but this last one doesn’t matter for the problem i encounter)

Now imagine a square. This square has the plastic texture made in Blender on it (so a noise texture + color ramp) ; and i want to put on the same surface the grey band ; to overlap it with the plastic texture. The grey band texture has the exact same size than the square it’s going on, because 90% of the PNG image used has been set as transparent in Photofilter (the remaining 10% being the grey band itself).

So, indeed the two textures are on the same surface, BUT, for a reason i don’t know (apparently the alpha node not properly used from what i understand of the answers to my post), the transparent part is not transparent in Blender but black. What i want to do is to make this transparent part of the PNG image remain transparent, and like that we can see the plastic texture below the transparent part of the PNG image

I’m sorry, I think there’s just too serious a language barrier here, and so we’re just going around in circles.

If your image accurately represents the parts that you want to be transparent, then you can mix transparency in like I said. But after you did that, you wrote that some part that was becoming transparent should not become transparent.

I’ve said that a few times, so it doesn’t make much sense to keep saying it when I don’t think that we’re understanding each other.

You could try uploading a file with packed images. Sometimes that can make it more clear what you want. Sometimes, though, it doesn’t, not on its own.

PROBLEM SOLVED !!

I found the solution by checking on google using different ways to describe the problem and found an alternative solution. Here is it, in case somebody has the same issue one day : https://blender.stackexchange.com/questions/46424/add-a-transparent-image-on-top-of-a-material