I have an app where I use a 3-D orthographic view which I want fogged linearly based on z, which ranges from 0.0 to 1.0. The code I have written works as desired on nVidia and Matrox hardware, but on 3dfx hardware everything in the scene is rendered as though it was fogged the maximum amount (ie, everything is flat grey), and on the ATI Rage128 there is no fogging at all. I feel it must be some error in how I have setup the orthographic projection. The viewing volume I want is w/ dimensions of width & height matching my window dimensions, and a depth range of 0.0 to 1.0 (near to far clip planes). So, I’m setting things up like this:
GLfloat fog_color[]= {0.75, 0.75, 0.75, 1.0};
glFogi(GL_FOG_MODE, GL_LINEAR);
glFogfv(GL_FOG_COLOR, fog_color);
glFogf(GL_FOG_START, 0.f);
glFogf(GL_FOG_END, 1.f);
glEnable(GL_FOG);
glViewport(0, 0, width, height);
glDepthRange(0.f, 1.f);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.f, width, height, 0.f, 0.f, 1.f)); // width & height are my window dimensions
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
… drawing code follows
As I said, this works as desired on everything I have tested it on other than ATI (Rage128 specifically) and 3dfx (Voodoo3 & Voodoo5 specifically). Any ideas what might be the problem here? Any suggestions apreciated!