Re: Near clipping plane/ Z fighting

New Message Reply Date view Thread view Subject view Author view

Brian Furtaw (brian++at++hotsauce.clubfed.sgi.com)
Thu, 15 Apr 1999 11:54:52 -0400


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


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Thu Apr 15 1999 - 09:11:14 PDT

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