Re: Near clipping plane/ Z fighting

New Message Reply Date view Thread view Subject view Author view

Angus Dorbie (dorbie++at++sgi.com)
Fri, 23 Apr 1999 13:39:51 -0700


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.

Let's call them planes of discrete resolvable z distance. To label these
bit planes is misleading. You'd need a LOT of zbuffer bits for this.

Cheers,Angus.

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

-- 
"Microsoft's system was like a forest that hadn't had a controlled
 burn in decades, just waiting for one person with a match to turn
 it into a disaster. Melissa was Microsoft's fault. They left their
 system wide open to this sort of abuse, they knew it could happen
 and did nothing." -- Bruce Perens

For advanced 3D graphics Performer + OpenGL based examples and tutors: http://www.dorbie.com/


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Fri Apr 23 1999 - 13:39:54 PDT

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