[Android Lollipop] OpenGL ES GL_ONE on fragment shader

Hi all,

I encounter an interesting problem. Any comments, please feel free to share with me. The problem is as following.

I am working on a fragment shader. The shader is used to make the pixel opaque. So I use the following statement.

gl_fragColor = vec4(texColor.rgb, 1.0)

But this does not work in my project. Through some investigation, I found some clues.

(1) texColor.a is greater than 1.0. And texColor.rgb is also greater than 1.0. If I set alpha as 65535.0, every thing seems good. Can rgba be greater than 1.0?

(2) The MORE interesting problem is HERE. Here is the point of this thread. The following statement can make every thing work well.

gl_fragColor = vec4(texColor.rgb, 1)

I also try GL_ONE, instead of 1. It works well too. A float point should be used here. But 1 seems make the alpha of the pixel as MAX. Any one knows this cool feature? Or this is a bug from my code?

Thanks a lot. Have a nice day.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.