[osg-users] depth problem (clip) - Bonus : osgDepthPartition problem (shake)

Clem Barbier furane at gmail.com
Tue Apr 26 02:36:04 PDT 2011


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:

More information about the osg-users mailing list