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

Hartwig Wiesmann hartwig.wiesmann at skywind.eu
Fri Mar 9 23:57:29 PST 2018


In my dynamic scene (objects can be added or removed) I use a perspective projection and automatic near and far plane calculation. To prevent during camera movement culling of objects between the camera and the near plane I calculate before each camera movement if there are objects in the pyramid built by the camera's location and the near plane. This is done by using a polytope intersector. If there are objects in-between I limit the camera movement.

If the movement of the camera is moderate everything works fine but if there are big steps in the camera movement I still see near plane culling (for one frame or so). Because due to the camera movement the near plane will also change and therefore my calculation is slightly wrong for the next frame, I suppose. But this change of the near plane will only be calculated in the next cull traversal and my correction will be again corrected in the next movement and therefore the flicker, I guess.

I have already tried to use a slightly larger FOV or further near plane for the pyramid but this does not really help (the flicker can still be seen). Especially when the camera is looking more parallel to the scene.

I fear that I have to give up automatic near and far calculation or what are you doing in such a case?

If I have to give up automatic near-far calculation I basically have to do before finalising the camera movement a new near-far calculation and if there are still collisions limit or correct the camera movement or adjust the near plane. But this basically means that I have to run my own cull traversal. Or are there any other solutions?

PS: As the scene is dynamic I cannot pre-calculate the near and far planes.

Thank you for your suggestions in advance!


Read this topic online here:

More information about the osg-users mailing list