[osg-users] Prevention of near plane culling while moving camera

Robert Osfield robert.osfield at gmail.com
Sat Mar 10 09:34:33 PST 2018

Hi Hartwig,

On 10 March 2018 at 17:02, Hartwig Wiesmann <hartwig.wiesmann at skywind.eu> wrote:
> When the camera is placed perpendicular to the scene (a large plane with some objects on it) everything can be seen. If the camera is looking at the scene under an angle of 70 degrees (between look-vector and plane's normal) the lower part (or better the lower element fragments) is clipped(!).

Could you post a couple of screenshots to illustrate what you mean as
it's so open ended about what you scene could be.

> I know it has to do with the clear/far ratio and therefore I would like to limit the camera movement. To do so I am checking if there are primitives that are going to be clipped. If this is the case I backtrack the camera.
> But this leads to some flicker.

Limiting the camera view also doesn't seem like a great approach, my
guess is that it would feel unnatural for users having the camera
behave in none obvious ways.

> How can I implement a logarithmic z-buffer when not using shaders?

You can't implement it without shaders.  The best you can do is
multi-pass depth partition approach.  osgViewer has support for
dividing up a view into multiple depth partition.  Go have a look
through the headers and the osgdepthpartition example.

However, before you start looking into anything fancy I'd suggest
getting to bottom of what the problems you are seeing first - it might
be something really simple can be done to improve things without doing
anything complicated.


More information about the osg-users mailing list