开发者

Ignore alpha when rendering texture?

开发者 https://www.devze.com 2023-02-05 04:51 出处:网络
This should be simple but it\'s proving to be a real head-scratcher... I have a texture with an alpha channel. On one render pass I want to render the texture but ignore开发者_运维技巧 the alpha chan

This should be simple but it's proving to be a real head-scratcher...

I have a texture with an alpha channel. On one render pass I want to render the texture but ignore开发者_运维技巧 the alpha channel. No matter what settings I use, pixels with alpha less than 1 are not drawn.

Surely any alpha testing/rejection/blending should be disabled by these commands?

gl.glDisable(GL10.GL_BLEND);
gl.glDisable(GL10.GL_ALPHA_TEST);

I realise that I could work with two versions of the texture, one with alpha and one without. But surely there is a way to just ignore the alpha channel?


You probably have to use different source and destination blend modes for glBlendFunc than you're using now. If you, for example use GL_ONE for source and GL_ZERO for destination, then there will be no alpha pixels involved.

http://www.opengl.org/sdk/docs/man/xhtml/glBlendFunc.xml

0

精彩评论

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