开发者

opengl es transparent fog in android

开发者 https://www.devze.com 2022-12-31 21:58 出处:网络
I was wondering why the fog i use in opengl es on my android phone isn\'t transparent when i set the colors alpha to 0. I set the background to transparent and it works fine and the Color class or the

I was wondering why the fog i use in opengl es on my android phone isn't transparent when i set the colors alpha to 0. I set the background to transparent and it works fine and the Color class or the toFloatBuffer() method are working fine for my meshes but when i set the fog color to transparent then this fact is ignored. here is the basic code i use for fog in the onSurfaceCreat开发者_StackOverflowed() method of my renderer:

gl.glFogf(GL10.GL_FOG_MODE, GL10.GL_LINEAR);
gl.glFogf(GL10.GL_FOG_START, 4.0f);
gl.glFogf(GL10.GL_FOG_END, 10.0f);
gl.glFogfv(GL10.GL_FOG_COLOR, new Color(0,0,0,0).toFloatBuffer());
gl.glEnable(GL10.GL_FOG);


This is the expected behavior. Fixed-function fog in OpenGL and OpenGL ES only changes the final R, G, and B components of the fragment. The A component is left untouched (i.e. the A component of GL_FOG_COLOR is unused).

0

精彩评论

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

关注公众号