Jump to content
  • Advertisement
Sign in to follow this  
rubenhak

Translucent RGBA texture

This topic is 2573 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
How would I check the internal format?
When I open the image with Photoshop i can see that it has an alpha channel.

Share this post


Link to post
Share on other sites
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);

Share this post


Link to post
Share on other sites
Hidden
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]);

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

Share this post


Link to post
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!