PNG transparency in shaders

How can i use transparent PNG’s as textures? Is there a special shader keyword for this?

Try adding blendfunc blend to the shader stage.

I tried blendfunc add and blend, both without good results. Some frames get transparent, others do not.

I think saving background color when exporting PNGs messes up transparency in ioq3. GIMP has an option for enable/disable in export dialog, I don’t know about other programs.

Yes, but i don’t have a background color. It’s a transparent, 24-bit PNG. Should i use alpha instead? :frowning:

Any ideas on how to fix this, guys? Do i really have to use alphas? :frowning: Or am i missing a special shader configuration?

Bumping up: i have used TGA’s with transparency in alpha and flatten-out RGB. Transparent PNG, both 24 and 8 bit. Still no luck. Here’s an example:

I think to make black transparent use blendFunc GL_ONE GL_ONE in the stage. Many q3 shaders do this in scripts/gfx.shader.

Edit: ah, it’s the same as blendFunc add suggested in other topic.

1 Like

Dude, go to your rgba section and add a mask layer, should be black and white.

Make the image 32bit.

With this you can make anything any kind of transparent, from 0% - 100%. I’m trying to do something with this right now.