[osg-users] DepthPartition

Robert Osfield robert.osfield at gmail.com
Tue Jan 14 05:09:21 PST 2020

On Tuesday, 14 January 2020 04:47:32 UTC, Infinite Reality wrote:
> What is the principle of Depth Partition?

Depth buffer precision is dependent upon the near/far distance ratio, the 
lower this ratio the lower the precision and more z fighting you have - 
where pixels of polygons that are close together start to be rendered in 
the wrong order, so pixels from polygons that are further away get rendered 
instead of ones that are slightly nearer.

The depth partition technique breaks the view into distinct partitions, 
this might be just two partitions or many, usually two is enough.  The 
partitions abut so the far distance of near partition equals the near 
distances of the far partition.  The partitions are rendered before the 
nearer ones with the depth buffer being cleared before the next nearest 
partition is rendered, the colour buffer is kept for each pass.

The distance of the junction between the two partitions is not the mid 
distance between the overall near/far, but is computed to keep the near/far 
ratios and hence precision the same for each partition. The OSG's depth 
partition class computes this distance for you.

One alternate to depth partitioning is to use a non linear depth buffer as 
suggested by Maxim.  This requires custom shaders to work, but as this is 
normal for modern applications anyway this isn't much extra work.  Have a 
look online for more details on these approaches.


You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+unsubscribe at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/a6956422-79a1-4ed8-863c-71da3d1811d5%40googlegroups.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20200114/e8feadc9/attachment.html>

More information about the osg-users mailing list