Since we now have antialiasing it is more important to set your gamma-value
right - only then line will look really smooth.

I improved gamma.c a bit, which can be used to tune your gamma values:

- stippled patterns are now drawn as a small squares inside the homogenous ones
- this makes it easier to compare them

- additional to the white ramp red green and blue ramps are drawn, so you can
easily tune all three gamma values

Here comes the diff:
========================================================================
4,6c4,7
<    When the intensities in the top row nearly match the intensities in
<    the bottom row you've found the right gamma value.
< 
---
>    When the intensities of the inner squares nearly match the intensities
>    of their frames (from some distance the borders should disappear) then 
>    you've found the right gamma value.
>    
12c13,14
<    Brian Paul  19 Oct 1995 */
---
>    Brian Paul  19 Oct 1995
>    Kai Schuetz 05 Jun 1999 */
107,121c109
< static void 
< display(void)
< {
< 
<   glClear(GL_COLOR_BUFFER_BIT);
< 
< /** DITHERED ROW **/
< 
<   /* solid black */
< 
<   /* 25% white */
<   glEnable(GL_POLYGON_STIPPLE);
<   glColor3f(1.0, 1.0, 1.0);
<   glPolygonStipple(p25);
<   glRectf(-0.6, 1.0, -0.2, 0.01);
---
> static GLubyte *stippletab[4]={NULL, p25, p50, p75};
123,135c111,114
<   /* 50% white */
<   glPolygonStipple(p50);
<   glRectf(-0.2, 1.0, 0.2, 0.01);
< 
<   /* 75% white */
<   glPolygonStipple(p75);
<   glRectf(0.2, 1.0, 0.6, 0.01);
< 
<   /* 100% white */
<   glDisable(GL_POLYGON_STIPPLE);
<   glRectf(0.6, 1.0, 1.0, 0.01);
< 
< /*** GRAY ROW ***/
---
> static void
> gamma_ramp(GLfloat yoffs, GLfloat r, GLfloat g, GLfloat b)
> {
>   GLint d;
137c116,117
<   /* solid black */
---
>   glColor3f(0.0, 0.0, 0.0);   /* solid black, no stipple */
>   glRectf(-1.0, yoffs, -0.6, yoffs + 0.5);
139,141c119,120
<   /* 25% white */
<   glColor3f(0.25, 0.25, 0.25);
<   glRectf(-0.6, -0.01, -0.2, -1.0);
---
>   for(d=1; d < 4; d++) {      /* increasing density from 25% to 75% */
>     GLfloat xcoord=(-1.0 + d*0.4);
143,145c122,123
<   /* 50% white */
<   glColor3f(0.5, 0.5, 0.5);
<   glRectf(-0.2, -0.01, 0.2, -1.0);
---
>     glColor3f(r*d / 5.0, g*d / 5.0, b*d / 5.0);       /* draw outer rect */
>     glRectf(xcoord, yoffs, xcoord+0.4, yoffs + 0.5);
147,149c125,126
<   /* 75% white */
<   glColor3f(0.75, 0.75, 0.75);
<   glRectf(0.2, -0.01, 0.6, -1.0);
---
>     glColor3f(0.0, 0.0, 0.0); /* "clear" inner rect */
>     glRectf(xcoord + 0.1, yoffs + 0.125, xcoord + 0.3, yoffs + 0.375);
151,153c128,136
<   /* 100% white */
<   glColor3f(1.0, 1.0, 1.0);
<   glRectf(0.6, -0.01, 1.0, -1.0);
---
>     glColor3f(r, g, b);               /* draw stippled inner rect */
>     glEnable(GL_POLYGON_STIPPLE);
>     glPolygonStipple(stippletab[d]);
>     glRectf(xcoord + 0.1, yoffs + 0.125, xcoord + 0.3, yoffs + 0.375);
>     glDisable(GL_POLYGON_STIPPLE);
>   }
>   glColor3f(r, g, b);         /* solid color, no stipple */
>   glRectf(0.6, yoffs, 1.0, yoffs + 0.5);
> }
154a138,144
> static void 
> display(void)
> {
>   gamma_ramp( 0.5, 1.0, 1.0, 1.0); /* white ramp */
>   gamma_ramp( 0.0, 1.0, 0.0, 0.0); /* red ramp */
>   gamma_ramp(-0.5, 0.0, 1.0, 0.0); /* green ramp */
>   gamma_ramp(-1.0, 0.0, 0.0, 1.0); /* blue ramp */
165c155
<   glutInitWindowSize(400, 200);
---
>   glutInitWindowSize(500, 400);

==========================================================================

Hope you like it,

-- 
|/
|\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