Re: Near clipping plane/ Z fighting

New Message Reply Date view Thread view Subject view Author view

Rob Jenkins (robj++at++sgi.com)
Fri, 16 Apr 1999 00:27:41 -0700


One note on the zbuffer resolution: As Brian says, the resolution with
depth is non linear, the curve depends on the *ratio* of near:far, ie
the higher that ratio the more 'bunched up' towards the near clip the
res gets. In other words, when you're dynamically changing near and far
clip what you're aiming for is to always have the minimum ratio near:far
that you can have. Clearly, moving near out has the biggest effect on
that ratio ( moving near from 1 to 2 halves the ratio, moving far from
100 to 99 doesn't change it much at all ). This means that if you have
to leave the far clip way out there it could still be OK as long as you
can push near out.

Cheers
Rob

Brian Furtaw wrote:
>
> Tammy,
>
> What you are seeing is called z fighting. Think of the zbuffer as a
> distribution of bit planes from the near clipping plane to the far clipping
> plane. Most of the bit planes are near the front of the viewing frustum to give
> fine z resolution (high bit precision) where you need it most, and a courser
> resolution further away (low bit precision). What this means is that objects or
> portions of objects can fight for visibilty due to rounding errors. By moving
> the near clipping out you increase the bit precision in the area you are
> interested in and the z fighting disappears.
>
> Solutions to this are implementations using the stencil buffer to layer (or
> decal) objects on top one another. OpenGL has a call glPolygonOffsetEXT which
> again ensures layering. Of course Performer has taken care of the details of
> these implementations and wrapped it up in a class called pfLayer.
>
> So to answer your question adjust your near and far clipping plane every frame
> to encompass a bounding sphere of viewable geometry to give you the maximum
> possible z resolution where you need it. But use pfLayer to keep objects which
> are very close together from z fighting.
>
> Brian
>
> On Apr 15, 9:57am, Tammy Martin wrote:
> > Subject: Near clipping plane/ Z fighting
> > Hi
> > I was wondering if someone could give me some information
> > about what is the optimal distance for the near clipping plane. I
> > have an application where I draw ground tracks very near to the
> > terrain, this causes a flickering to occur. However, I noticed that if I
> > push the near clipping plane closer to the object the flickering will
> > disappear. Our default near clipping plane is set to 5.0 feet. Is
> > there some type of formula that will give the value you should set
> > your near clipping plane to based on camera distance, FOV, etc?
> > Is there a book or manual that describes these issues?
> >
> > Thank you.
> >
> > Tammy
> > tmartin++at++metricsys.com
> >
> > -----------------------------------------------------------------------
> > List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> > Submissions: info-performer++at++sgi.com
> > Admin. requests: info-performer-request++at++sgi.com
> >-- End of excerpt from Tammy Martin
>
> --
> o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o
>
> Brian Furtaw (brian++at++sgi.com)
> Graphics Guru
> 12200-G Plum Orchard Drive Office:(301)572-3293 Fax: (301)572-3280
> Silver Spring, Maryland 20904 OPenGL/Performer/Optimizer/Volumizer
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com

-- 
________________________________________________________________
Rob Jenkins	Silicon Graphics 	mailto:robj++at++sgi.com

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Fri Apr 16 1999 - 00:34:12 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.