PNG alpha not working in Cycles

I’m following the method of plugging the alpha of a PNG texture into the FAC input of a mix shader to display the transparency of the image but it’s not working for me. Upper left shows the node layout and the panel at lower right is rendered.

Any ideas?

Are you sure that image has an alpha channel at all?
The UV image editor usually shows a checkerboard pattern for transparent areas if the drawing channel is set to “Color and Alpha”:


But it doesn’t with your image…

Edit: beat to the punch by Ikari!

I can see in the uv editor that your png doesn’t really have proper alpha. Try it with this png.

It would be better to unwrap the road mesh and use the texture directly on that, rather than floating a plane on top of it.

Thanks guys - and thanks for the image, I’ll try it with that one. I figured out that Photoshop CC is the culprit - it’s not saving out the alpha properly.

The road mesh is tiled (and the layout might change) which is why I’m using a floated plane. It’s small enough on the final render that it should look OK.

I’m having the same problem. But I’ve noticed that just same PNG get this error in Cycles. I tried using a PNG rendered with Blender to make sure I’m using a “good” PNG with a correct alpha channel, but the problem persists.
I just got it to work correctly using Openshade Language rendering trough the CPU, but as every body knows it’s too slow.
I thought that it was a 2.74 version bug. But today, I’ve just installed 2.75 RC version, made yesterday, and the problem persists. I also updated the GPU drivers. I’m using a i7 2600K with 16GB RAM, and a GTX 650-Ti (2GB) running Win7.
Is somebody else having this problem too?

There are no bugs with using the alpha channel in cycles, this guy’s issue was that his png had no alpha. Post a packed blend or some screenshots and you can fix it easily.

Here is a example file. The PNG used in this scene was rendered in blender.

https://dl.dropboxusercontent.com/u/66398827/PNG_Alpha.blend

Something is weird with your internal alpha information, it’s opens up with alpha is photoshop and looks ok, but (As you can see) it’s not working right. But when I save the file as a rgba png in photoshop and then use that image, it works fine.

Save this image and use it as your image texture, the nodes are fine. Your issue has something to do with how your saving that png in your other file.

Pizza2.png on dropbox

For me just unpacking the image and relinking the texture did the trick:


Didn’t even have to resave the png or anything. Might be something went bonkers while packing the file…

ikari, That’s weird. When say you relink what exactly are you doing? I can get the original image to work by:

  1. unpacking the blend.
  2. Deleting the image in the uv editor (hold shift and hit x)
  3. Saving blend, closing, opening blend
    Add the image back in.

I must say that this is weird behaviour, and I can’t explain it.

cbegngua, what version of blender are you using

What I did was:
a) External Data > Unpack all into Files.
In a node editor for the plane material:
b) Click “X” in the image texture node to “free” the node.
c) Click “Open” in the image texture node, browse to the unpacked png and select the file.
Result: Renders fine.

No opening, closing of Blender or saving and reloading of the file.

Ok, thanks.

Funny enough - if i watch image alpha in uv editor (which shows white square), switch to BI and make material using same image as a texture, as soon as i click Use Alpha on Texture tab - Image blender starts to “behave” and all of a sudden white square shows black mask parts. From now on Cycles works.
This was happening yesterday - (cutouts thread) on v.2.74.5; same on today’s 2.75 from builder. Seems like a bug.

It’s a puzzler. There doesn’t appear to be anything wrong with the image per se. And we know the nodes are fine. If I start a new blend and use it it’s fine. Somehow on that initial blend, Blender has “flagged” the alpha in that texture in some weird way that needs to be reset. The image texture has 2 users, which is odd…

Can nodes suffer a breakdown? I had a normal noise texture node that didn’t produce anything all of a sudden (it had worked before). When I created a new one with the same settings, the new one worked. Re-enabling the old one didn’t make it work though. Didn’t report, save, or even notice if Blender exited with errors. But very annoying, and took me a few hours to locate what was going on (because I didn’t expect that).

been there for a long time!

but did u try to re select from the UV option sub panel ?

happy cl

For my problem? In that case, no, I didn’t. Most likely I had object output rather than UV output selected anyway.

I still can’t get a PNG from Photoshop to work - but I did have success re-exporting one from GIMP.

Incidentally - can I get an image plane to render as a shadow only in Cycles?

EDIT: Never mind - Object panel, ray visibility, uncheck ‘Camera’ did the trick. :slight_smile: