OpenSceneGraph icon indicating copy to clipboard operation
OpenSceneGraph copied to clipboard

[Question]: It it possible to change focus distance of the camera?

Open ar4development opened this issue 1 year ago • 3 comments

Hi!

I've come here from esmini openscenario player that is built upon openscengraph engine. There one can set camera position and direction for the viewer.

However there is no option to set focus distance of the camera. So I examined osg code a bit (also coding examples) and did not find any place where one could set focus distance.

So the question is: is it even possible? Could you advice on what would be the proper way of setting such a camera property?

ar4development avatar Nov 17 '24 18:11 ar4development

The osg::Camera doesn't have a focus distance because the standard OpenGL fixed function pipleline has no concept of focus.

Focus distance is tied to depth blurr rendering techniques, so requires multipass rendering a custom shaders. This is something that users must write themselves.

robertosfield avatar Nov 17 '24 20:11 robertosfield

The osg::Camera doesn't have a focus distance because the standard OpenGL fixed function pipleline has no concept of focus.

Focus distance is tied to depth blurr rendering techniques, so requires multipass rendering a custom shaders. This is something that users must write themselves.

Thank you! could you also advise on focal length. I would like to reproduce FOV of my real camera .

ar4development avatar Nov 23 '24 17:11 ar4development

I can point you in the right direction for OSG features but not general graphics. You'll need to do your own research, there is plenty of resources available on the web.

robertosfield avatar Nov 23 '24 17:11 robertosfield