Skip to main content
GameDev.net gamedev.net
🔒 Locked

Translucent RGBA texture

Started by rubenhak Dec 2, 2011 at 7:26 PM 3 replies 1k views
Original Post
rubenhak
rubenhak
Hi Everybody,

I've got a 32 bit translucent TGA texture which I want to render on a simple quat. But cant make it to get rendered properly. Parts where my texture is transparent do not get rendered as transparent. What is the common problem with this approach?

When I specify alpha value with glColor(...) it makes my quad translucent, but how to make alpha value to come from the texture?

I turned on blending, generated texture with GL_RGBA and GL_UNSIGNED_BYTE mode. Don't know what I'm doing wrong.

Any help is appreciated.

Thank you,
Ruben
Brother Bob
Brother Bob
You need to post more information and code. My initial guess though is that your texture doesn't have an alpha channel. Check that the internal format, and not just the source data format, is actually a format with an alpha channel.
Brother Bob
Brother Bob
The internal format is the third parameter to glTexImage.
Kaptein
Kaptein
it will have an alpha value regardless
just shade your models with only alpha, and you can see if your alpha channel is completely 1.0, or actually has values like this:

gl_FragColor = vec4(my_frag_color[3]);


if its completely white (or black), then it is as rob said above most likely =)

it could also be you forgot to enable blending: glEnable(GL_BLEND);

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.