Вопрос

Please take a look at this: http://imgur.com/a/S8eOC

The problem:

The grid is drawn perfectly fine without fog. When fog is enabled, the vertical lines disappear. I then rotate a little to the left and and all lines start to get invisible; if I had rotated even more, they would completely disappear. It seems that it depends on the viewing angle. I thought it could be a problem with the lighting but I turned that off and the result was the same.

I also tried different fog types but the results were the same. If I look straight down (90º angle with the grid plane) I can clearly see all the grid lines.

What's pup with this behavior? Can it be fixed?

The code is very basic but here it is in case it's important:

main():

glEnable(GL_FOG);
glHint(GL_FOG_HINT, GL_NICEST);

renderScene():

float fogColor[3] = {0.8f, 0.8f, 0.8f};
glFogfv(GL_FOG_COLOR, fogColor);
glFogi(GL_FOG_MODE, GL_EXP2);
glFogf(GL_FOG_DENSITY, 0.01f);

Нет правильного решения

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top