On Wed, 1 Dec 1999, JONATHAN DINERSTEIN wrote:

>         As an example of the kind of rendering errors I want to get rid of,
> check out:
>         http://www.npl.com/~jon/
> 
> It is a jpeg so some amount of loss has happened, but you can still easily see
> the problem.  All I did was have GLUT draw a sphere of about 20 slices by 10
> stacks.  There is no specular or ambient, and I used the default settings for
> LIGHT0.
> 
> As you can see, except where the lighting is really bright, the seam between
> polygons is brighter than the interior of polygons.  So, even when doing no
> specular, there's still some rather poor rendering.  I never got this kind of
> error in my own Gouraud engine, so my guess is that this is caused primarily by
> using fixed point math.  Am I wrong here???
 
What you are seeing is 'mach banding'.  This is a peculiar artifact of the
human visual system - an 'optical illusion' you might say.

When the rate of change of brightness switches abruptly, the eye/brain sees
a 'seam'.  Since colour is linearly interpolated across a polygon, then when
the colours at the vertices of one polygon are closer in brightness to one
another than the colours at the vertices of an adjacent polygon - then the
rate of change of brightness will be different between those polygons - and
your brain will 'amplify' that change in 'brightness slope' into a mach band.

Per-pixel lighting ("per fragment lighting" in OpenGL parlance) is the
solution - but hardware rendering engines don't do that (yet) because it's
a LOT more math. Phong shading and per-pixel lighting are really just the
same thing.

If you didn't see this with your old engine, it was either doing something
fancier than gouraud - or you simply didn't look at test cases that were
identical to this one.

ALL Gouraud shaders are doomed to producing mach bands.

Steve Baker                (817)619-2657 (Vox/Vox-Mail)
Raytheon Systems Inc.      (817)619-2466 (Fax)
Work: [EMAIL PROTECTED]      http://www.hti.com
Home: [EMAIL PROTECTED] http://web2.airmail.net/sjbaker1



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

Reply via email to