Placing an alpha map over a texture

Hi guys,

I am trying to model an abandoned hospital, and I’d like to have image-texture wallpaper, mixed with some grungy green/brown mold texture from noise, and on top of all that, I’d like a graffiti.

I get the graffiti showing okay on top of a procedural material, transparent and no box, but if I mix the proc and the wallpaper, placing the alpha-mapped PNG graffiti shows the edges of the image and it is not transparent.

I will attach the node image.

Any help muchly appreciated!

you need to add a transparent shader.

plug your graffiti image node into the transparent shader then connect it to the mix node that should work

But of course. Silly me! Thanks Troll!

hmmm… Maybe I better post this image. It is still there.

are you sure your image hahs an alpha channel? try switching the transparent shader to the top socket on the mix node?

It is a PNG-8 with Transparency checked on, and on a separate file it prints just the text over a procedural checkerboard texture.

Switching to the top socket makes all the area just black.

Yeah, checking that you have a useful alpha channel is the first thing to do. Just plug it into an Emission shader and plug that into the Surface socket. If it’s all black (or all white), you don’t have an alpha channel.

Next, you must not use a Transparent shader here but a Diffuse one. The alpha channel used a mix factor will cut out everything that isn’t opaque. That’s how it works.

And an advice: Don’t mix Diffuse shaders like that! Mix the colors and use a single Diffuse shader. It will speed up the rendering by cutting ms for every pixel. :wink:

Here is a schematic view of what your tree should look like. (And it works!) :wink:

thats interesting Kaluura, what does the emission shader do? and how come you dont need the transparent shader? every tutorial on alpha images i have seen uses the transparent node!

I’ll be replicating this node tree for my materials library thanks :slight_smile:

Many thanks indeed! It’s tips and tipsters like this that make this the best site ever.

I am getting a little embarrassed here. I have a PSD file that has only one transparent layer in it, and I try to save for web with Transparency checked, and yet, it shows up black in the Emission.

Is there something wrong with these settings?

@SmallTroll: Using an Emission shader is the best way to quickly view a texture (or any node output)… whatever the rest of the scene. That’s the reason.

And we don’t need any Transparent shader here because we don’t have to show anything transparent and because of the way we use the Alpha channel as factor. In the alpha channel, 0 means fully transparent and 1 means fully opaque, with all the values in between. So, the Color mix uses the color of the top socket (the other texture) where the grafitti is transparent and the grafitti itself (in the bottom socket) where it’s opaque. (FYI, in Blender’s world, we call this a decal.)

@usenetfan: (I’m not familiar with PS.) Isn’t there a “PNG-32” option? That’s what you want instead of “PNG-24”.

Nope, it only has PNG-8 and PNG-24.

I just googled a bit. (You should do the same… especially because of the various versions of PS with as many different interfaces. :spin: You’ll find something for your version.)

Or else, download the GiMP. (It’s free.) You load your PSD in it and save as PNG. It won’t tell you that PNG has no alpha, it will just work. :no: (I can’t believe how people are brainwashed by PS…)

Funny you should mention GIMP as I did just that, but the PNG still shows up black when connected to an emission shader and material output. I must be monumentally stupid.

But now I seem to have done something right, as the latest GIMPed graffiti shines through nicely. MANY thanks for all your help, folks!