For some reason I get weird patchy lighting effects/flickering when using glutSolidSphere and the camera is relatively far away from the object. See below:
This also happens with glutSolidCube and I assume the others as well.
I've tried everything I could find in similar questions but no luck with that
I've tried enabling all of the below and different combinations of the below and tried doing so in multiple places
glEnable(GL_BLEND);
glEnable(GL_DEPTH_TEST);
glEnable(GL_LINE_SMOOTH);
glEnable(GL_NORMALIZE);
glDepthFunc(GL_LEQUAL);
And also removed all glEnable(GL_TEXTURE_2D); anyhere
The problem happens when I turn on lighting with glEnable(GL_LIGHT0);
and occurs with glShadeModel(GL_SMOOTH) and glShadeModel(GL_FLAT) and also if I don't enable GL_COLOR_MATERIAL and even occurs with just a positional light like so:
float light_position[] = {100.0f, 100.0f, 100.0f, 1.0f};
glLightfv(GL_LIGHT0, GL_POSITION, light_position);
What else could this be?