By enabling FLAT shading I get a really large speedup:

======================================================================
*** /tmp/gamma.c        Sat Jun  5 16:32:58 1999
--- gamma.c     Sat Jun  5 16:33:13 1999
***************
*** 38,41 ****
--- 38,42 ----
    glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
    glMatrixMode(GL_MODELVIEW);
+   glShadeModel(GL_FLAT);
  }
======================================================================

I think rendering of Rects should always take place with flat rendering,
because smooth rendering doesn't make sense because it's impossible to
specify different colors/normals for the vertices. One possible solution
would be saving ctx->Light.ShadeModel, setting it to GL_FLAT, render the rect
and restore it. Did I miss something ? Maybe fogging ?

======================================================================
*** /tmp/rect.c.old     Sat Jun  5 17:06:28 1999
--- rect.c      Sat Jun  5 17:06:38 1999
***************
*** 60,71 ****
--- 60,76 ----
      *     flushes the vb...
      */
  
+    GLenum oldshademode;
+ 
     ASSERT_OUTSIDE_BEGIN_END(ctx, "glRect"); 
     RESET_IMMEDIATE(ctx);
+    oldshademode = ctx->Light.ShadeModel;
+    gl_ShadeModel( ctx, GL_FLAT );
     gl_Begin( ctx, GL_QUADS );
     gl_Vertex2f( ctx, x1, y1 );
     gl_Vertex2f( ctx, x2, y1 );
     gl_Vertex2f( ctx, x2, y2 );
     gl_Vertex2f( ctx, x1, y2 );
     gl_End( ctx );
+    gl_ShadeModel( ctx, oldshademode );
  }
======================================================================

This if course makes the patch to gamma.c useless.

BTW, referring to the TODO in rect.c: calling Driver->RectFunc() is
only possible if the projection and modelview matrices are orthogonal, right ?

-- 
|/
|\ai

---------------------------------------------------------------------
Kai Schuetz
mailto:[EMAIL PROTECTED]
Hi, I'm not a signature virus. Why don't you just copy me into your 
signature?
---------------------------------------------------------------------


_______________________________________________
Mesa-dev maillist  -  [EMAIL PROTECTED]
http://lists.mesa3d.org/mailman/listinfo/mesa-dev

Reply via email to