I have a texture that is partially transparent. What do I need to enable so that it renders that part of the texture transparent? Currently it renders the lower index texture in the transparent part of the texture so you get a texture on 开发者_如何转开发top of another?
As far as I remember this requires you to have a texture that has an alpha channel, something like GL_RGBA
as internal format.
And you need to glEnable(GL_BLEND);
to enable alpha blending and glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
to get the standard alpha blending where the image's alpha value decides how much it covers the image already there.
精彩评论