Sign in to follow this  
danw

OpenGL glsl texture alpha channel problem

Recommended Posts

hello! in apple's "OpenGL shader builder" I played around and stumbeld upon the following problem: the fragment shader: uniform sampler2D texture; void main() { vec4 color; color = texture2D( texture, gl_TexCoord[0].st ); gl_FragColor = vec4( color.rgb, 1.0 ); } should by my understanding completely ignore the textures alpha channel, but it doesn't. it just "mistakes" transparency with darkness (everything transparent is painted darker, according to the level of transparency). If I change the last line to gl_FragColor = vec4( color.rgb, color.a ); of course transparency is implemented, as expected. As I would like to store other information than transparency in my alpha channel, I don't like the alpha channel to mess around with the values of the three color channels. I think it could have something to do with glBlend modes, but I am not sure. Thank all replies in advance, Daniel

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this