Changing fog settings at runtime


I tried to change the fog settings at runtime. But somehow the start and end ranges are incorrect. Testing the same settings right in the code I get a correct fog appearance.

Do I need to clear some fog values before I am able to reinitialize?

                Gl.glFogf(Gl.GL_FOG_START, zFar - (zFar / 5f));
                Gl.glFogf(Gl.GL_FOG_END, zFar - (zFar / 100f * 5));

Ok, sorry. I found out that fog works great. My problem has another root:

Glu.gluPerspective(fovY, aspect_ratio, zNear, zFar);

This command does not work when executed at runtime. I am changing the value for the far plane but it has no effect (at least the distance I can see is not greater).

Ok I solved it :smiley:

I forgot to switch to PROJECTION and load Identity matrix before changing the perspective:

        Glu.gluPerspective(fovY, aspect_ratio, zNear, zFar);