Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Mesa DRI Fog Distorted

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2010
    Posts
    2

    Mesa DRI Fog Distorted

    I just ported some apps to linux but every Mesa DRI driver I try breaks up the fog.

    This problem occurs across every distro, graphic card, and fog mode.

    It also happens with every Mesa DRI driver dated the last five years, but the ATI and NVIDIA proprietary linux drivers display the fog fine.

    The following is the smallest example is could make. Its supposed to look like a long red carpet, but instead it looks like a bloody sidewalk:

    GLfloat fogColor[] = {0.5,0.5,0.5,1.0}; // Grey
    glEnable(GL_FOG);

    /* Linear mode:
    glFogi(GL_FOG_MODE,GL_LINEAR);
    glFogfv(GL_FOG_COLOR,fogColor);
    glFogf(GL_FOG_START, 1024.0);
    glFogf(GL_FOG_END, 4096.0);
    */

    /* EXP2 mode: */
    glFogi(GL_FOG_MODE,GL_EXP2);
    glFogfv(GL_FOG_COLOR,fogColor);
    glFogf(GL_FOG_DENSITY,0.0005f);

    glHint(GL_FOG_HINT, GL_NICEST);

    glBegin(GL_QUADS);
    glColor3f(1,0,0); // Red
    glVertex3f(-512, -512, -1024);
    glVertex3f( 512, -512, -1024);
    glVertex3f( 512, -512, -2048);
    glVertex3f(-512, -512, -2048);
    glEnd();

    glBegin(GL_QUADS);
    glColor3f(1,0,0); // Red
    glVertex3f(-512, -512, -2048);
    glVertex3f( 512, -512, -2048);
    glVertex3f( 512, -512, -3072);
    glVertex3f(-512, -512, -3072);
    glEnd();

    glBegin(GL_QUADS);
    glColor3f(1,0,0); // Red
    glVertex3f(-512, -512, -3072);
    glVertex3f( 512, -512, -3072);
    glVertex3f( 512, -512, -4096);
    glVertex3f(-512, -512, -4096);
    glEnd();

  2. #2
    Junior Member Newbie
    Join Date
    Apr 2010
    Posts
    2

    Re: Mesa DRI Fog Distorted

    Never mind. I got it backwards. The Mesa DRI drivers got it right, and both ATI and NVIDA got it wrong. Imagine that! glShadeModel should have been SMOOTH, not FLAT...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •