Hi List,

i'm developing an opengl program and with
my new version i get heavy display distortions
when running under Linux with dri/3dfx voodoo3 3000

it happens when calling some display lists after
using glut's stroke fonts.

i'm using SDL for window/event management, so glut
is only used for the fonts and i do not init glut
or something.

it does only happen on dri, when switching
the xserver to 24bpp (no dri), everything is fine
as well as when running on BeOS.

to me it seems to be a very complex thing so
i'll paste some code to try to explain what happens:


at first, building two display lists
for objects. using GLU:
(tried a lot of things here but nothing helps,
eg not deleting the quadric, removing the Orientation call
and so on...)

        TDFSB_DisplayLists= glGenLists(3);
        TDFSB_CylinderList=TDFSB_DisplayLists+0;
        TDFSB_HelpList=TDFSB_DisplayLists+1;
        TDFSB_AudioList=TDFSB_DisplayLists+2;
        TDFSB_SolidList=glGenLists(1);
        TDFSB_BlendList=glGenLists(1);

/* building  Textfilecylinder */
        q = gluNewQuadric();
         gluQuadricCallback(q, GLU_ERROR, (_GLUfuncptr)errglu);
        gluQuadricDrawStyle(q,GLU_FILL);
        gluQuadricNormals(q, GLU_SMOOTH);
     glNewList(TDFSB_CylinderList, GL_COMPILE);
            glTranslatef(0.0, 0.0, -1.0);
            gluCylinder(q, 0.6, 0.6, 2.0, 16, 1);
            glTranslatef(0.0, 0.0, 2.0);
            gluDisk(q, 0.0, 0.6, 16, 1);
            glTranslatef(0.0, 0.0, -2.0);
            gluDisk(q, 0.0, 0.6, 16, 1);
     glEndList();
 gluDeleteQuadric(q);


/* building audio object */
        q = gluNewQuadric();
         gluQuadricCallback(q, GLU_ERROR, (_GLUfuncptr)errglu);
         glNewList(TDFSB_AudioList, GL_COMPILE);
            glTranslatef(0.0, 0.0, 0.0);
            glRotatef(90,1.0,0.0,0.0);
            gluQuadricDrawStyle(q,GLU_FILL);
            gluQuadricNormals(q, GLU_SMOOTH);
            gluCylinder(q, 0.2, 1.0, 0.5, 16, 1);
             gluQuadricOrientation(q, GLU_INSIDE);
            glRotatef(180,0.0,1.0,0.0);
            gluCylinder(q, 0.2, 1.0, 0.5, 16, 1);
         glEndList();
         gluDeleteQuadric(q);


later, building another Display List calling
the the Lists above, but... even if the lists
above are _not called here the problem shows up:
(tried to use glutSoldiCube instead of the Lists, nothing helps)

    glNewList(TDFSB_BlendList,GL_COMPILE);
        glEnable (GL_LIGHTING);
        glEnable(GL_BLEND); glDepthMask(GL_FALSE);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
        for(help=root;help;help=help->next)
        {
            mx=help->posx; mz=help->posz; my=help->posy;
            if (( (help->regtype==2) && ((help->mode)&0x1F)==0))
            {
            <Material definitions here>
                glPushMatrix();
                    if ( ((help->mode)&0x20)) { glTranslatef(mx,0,mz);
glScalef(0.25,0.55,0.25);glColor3f(0.8, 0.8, 0); glRotatef(90,1,0,0); }
                    else { glTranslatef(mx,3.5,mz);
glScalef(help->scalex, 4.5, help->scalez); glColor3f(0.8, 0.8, 0);
glRotatef(90,1,0,0); }
                    glCallList(TDFSB_CylinderList);
                glPopMatrix();
            }
            else if (( (((help->regtype)==6)||((help->regtype)==4)) &&
((help->mode)&0x1F)==0))
            {
            <Material definitions here>
                glPushMatrix();
                    if ( ((help->mode)&0x20))
                    { glTranslatef(mx,0,mz);
glScalef(0.25,0.55,0.25);glColor3f(0.8, 0.8, 0); glRotatef(90,1,0,0); }
                    else
                    { glTranslatef(mx,my,mz); glScalef(help->scalex,
help->scaley, help->scalez); glColor3f(0.8, 0.8, 0);
glRotatef(90,1,0,0); }
                    glCallList(TDFSB_AudioList);
                glPopMatrix();
            }
            if ( ((help->mode)&0x1F) >= 10)
            {
            <Material definitions here>
                glPushMatrix();
                    if (((help->mode)&0x20))
                    { glTranslatef(help->posx, 0.2, help->posz);
glScalef(1.2, 1.2, 1.2); }
                    else
                    { glTranslatef(help->posx,
help->posy+.25,help->posz);
glScalef((help->scalex)+.25,(help->scaley)+.25,(help->scalez)+.25); }
                    glutSolidCube(2);
                glPopMatrix();
            }
            if ( ((help->mode)&0x20))
            {
            <Material definitions here>
                glPushMatrix();
                glTranslatef(mx, 0, mz);
                if ((help->mode)==0x25)

glutSolidSphere(0.5,TDFSB_BALL_DETAIL,TDFSB_BALL_DETAIL);
glutSolidSphere(1,TDFSB_BALL_DETAIL,TDFSB_BALL_DETAIL);
                glPopMatrix();
            }
        }
            <restoring old Material definitions here>
    glDepthMask(GL_TRUE);glDisable(GL_BLEND);
    glDisable(GL_LIGHTING);
    glEndList();

and finaly using the lists after some glut stroke fonts (very important,
if
i disable the fonts, the problem completely disappears):
(commenting this if(){} out completely removes the problem)

 if (TDFSB_FILENAMES)
  {
                    glPushMatrix();
      if (!((help->mode)&0x20)) glTranslatef( mx,my,mz ); else
glTranslatef( mx,1.5,mz );
      glDisable (GL_LIGHTING);

      if (TDFSB_FILENAMES==1)
                    {
          glRotatef(spin+(fmod(c1,10)*36),0,1,0);
           if (!((help->mode)&0x20))
glTranslatef(help->scalex,1.5,help->scalez);
       glRotatef(90-45*(help->scalez/help->scalex),0,1,0);
          }
      else if (TDFSB_FILENAMES==2)
                    {
                        u=mx-vposx; v=mz-vposz; r=sqrt(u*u+v*v);
                        if(v>=0) { glRotated( fmod(135+
asin(u/r)*(180/PI) ,360) ,0,1,0); }
                      else    { glRotated( fmod(315- asin(u/r)*(180/PI)
,360) ,0,1,0); }
                        if (((help->mode)==0x00)&&((help->regtype)==1))
glRotatef(-45,0,1,0);
                        if (!((help->mode)&0x20))
                        {
glTranslatef((help->scalex)+1,1.5,(help->scalez)+1);
glRotatef(90-45*(help->scalez/help->scalex),0,1,0);  }
                          else                            {
glTranslatef(0,0.5,0); glRotatef(45,0,1,0); }
                    }

              glScalef(0.005,0.005,0.005);

                    if (!((help->mode)&0x20))
                    {
                        glColor4f(TDFSB_FN_R,TDFSB_FN_G,TDFSB_FN_B,1.0);

                        strcpy(fullpath,help->name);
                        c3=(int)strlen(fullpath);

glTranslatef(-glutStrokeLength(GLUT_STROKE_ROMAN,(unsigned char
*)fullpath)/2,0,0);
                        for (c2=0;c2<c3;c2++)   {
glutStrokeCharacter(GLUT_STROKE_ROMAN, fullpath[c2]); }
          }
          else
          {
                        fh=((((GLfloat)spin)-180)/360);
                        if (fh<0) {fh=fabs(fh);
strcpy(fullpath,help->name); glColor4f(1-(fh),1-(fh),1-(fh),1.0);}
                        else {fh=fabs(fh);
strcpy(fullpath,help->linkpath);
glColor4f(0.85-(fh),1-(fh),1-(fh),1.0);}
                        c3=(int)strlen(fullpath);

glTranslatef(-glutStrokeLength(GLUT_STROKE_ROMAN,(unsigned char
*)fullpath)/2,0,0);
                        for (c2=0;c2<c3;c2++) {
glutStrokeCharacter(GLUT_STROKE_ROMAN, fullpath[c2]); }
          }
           glPopMatrix();
  }


 glPushMatrix();
 glCallList(TDFSB_BlendList);
 glPopMatrix();


thats it, sorry for so much code, but i don't know how to describe it
better....

on request i can send the whole program
i tried an nvidia based linux/dri system and couldn't provocate
the distortions.

the distortion are
- large white, diffuse transparent triangles
 or
- white lines, when glCallList(TDFSB_BlendList); is removed

regards
leander


_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to