PNG transparency in shaders

#1

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

#2

Try adding blendfunc blend to the shader stage.

#3

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

#4

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.

#5

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

#6

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

#7

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:

http://imgur.com/vAAbVyW

#8

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
#9

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.