Does light attenuation work in opengl ES (GL10)? I havent seen any demos in google.
I've been trying to get light attenuation working (where light source fades further away something is from the light) but I'm finding as I move the camera I get flicker eg in the video after 10 seconds:
YouTube - ‪Android light flicker‬‏
Wondering if light attenuation works in Android and if so what might the problem be that I'm getting?
Ive been playing around with
gl.glLightf(lightarray, GL10.GL_LINEAR_ATTENUATION,1.0f);
gl.glLightf(lightarray, GL10.GL_CONSTANT_ATTENUATION, 0.0f);
gl.glLightf(lightarray, GL10.GL_QUADRATIC_ATTENUATION, 0.0f);
with doing different combination of the above settings but they all are like in the video.
I set the 4th vector element in the position vector to 1 which switches on attenuation:
gl.glLightfv(object3D.lightItem.gllight, GL10.GL_POSITION, new float[] { 0f, 0f, 1f, 1f }, 0);
I've been trying to get light attenuation working (where light source fades further away something is from the light) but I'm finding as I move the camera I get flicker eg in the video after 10 seconds:
YouTube - ‪Android light flicker‬‏
Wondering if light attenuation works in Android and if so what might the problem be that I'm getting?
Ive been playing around with
gl.glLightf(lightarray, GL10.GL_LINEAR_ATTENUATION,1.0f);
gl.glLightf(lightarray, GL10.GL_CONSTANT_ATTENUATION, 0.0f);
gl.glLightf(lightarray, GL10.GL_QUADRATIC_ATTENUATION, 0.0f);
with doing different combination of the above settings but they all are like in the video.
I set the 4th vector element in the position vector to 1 which switches on attenuation:
gl.glLightfv(object3D.lightItem.gllight, GL10.GL_POSITION, new float[] { 0f, 0f, 1f, 1f }, 0);