[osg-users] depth problem (clip) - Bonus : osgDepthPartition problem (shake)
robert.osfield at gmail.com
Tue Apr 26 03:33:56 PDT 2011
In svn/trunk and 2.9.11 onwards there is now support built into
osgViewer for doing depth partitioning, I haven't had a chance to roll
this into the old osgdepthpartition example yet though. You can see
the osgViewer depth partitition code in the osgshadow example so have
a look there, the osgViewer is simpler to manage than the
osgdepthpatition example as it moves the task into viewer
configuration, via multiple slave cameras, rather than scene graph
Using osgViewer will simply you app, but it won't fix the precision
issues of objects in the scene. The way to solve there are to keep
geometry objects relative to their local origin and have a
MatrixTransform placed above them in the scene graph position them in
their final 3D position in space. The OSG's camera matrices and the
cull traversal of the projection and modelview matrices is all done in
doubles so it's able to handle large values of translation that will
cancel out when the camera is near to geometry.
On Tue, Apr 26, 2011 at 10:36 AM, Clem Barbier <furane at gmail.com> wrote:
> I want to realize a scene (as solar system, same problem). As you can imagine, I have a clipping problem. Here's an example :
> My first cube (foreground) is clip (the second is far : 10^12).
> I have searched why and I have read information about Z-Buffer :
> After, I have read osg forum (and others google results) to find a solution :
> - Change nearfarRatio. But change nearfarRatio doesn't solve clip problem and z-fighting problem at the same time, my scene is too big.
> - Use osgDepthPartitionExample : It's very good solution and my cubes are exactly draw. But I want to draw line (as orbit) and it's catastrophic ! Line appear/disappear or shake when I move camera (rotate and zoom). Nevertheless, near and far for each camera seem to be good (next to each other). It's very annoying. I can post screen or video if you want to see.
> Have you any explanation ? some solution ? (cut scene ? use 2 cameras and not 5 when i have lines ? use "osg normal render" and use one camera for foreground ? cut the scene background and project part cut onto far plan ? something else ? ... ?)
> Thank you!
> Read this topic online here:
> osg-users mailing list
> osg-users at lists.openscenegraph.org
More information about the osg-users