开发者

iPhone : OpenGL Rendering Transparent textures

开发者 https://www.devze.com 2023-03-25 03:42 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消