On Thu, 2 Dec 1999, Stephen J Baker wrote:

> 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.

Phong shading can still have mach banding. To get rid of this, just enable
dithering.

> 
> 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.

Using dithering reduces the problem significantly as does higher color
resolution (e.g. 24bpp).

--
Doug Rabson                             Mail:  [EMAIL PROTECTED]
Technical Director, Qube Software Ltd.  Phone: +44 171 289 4201



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

Reply via email to