[osg-users] Slave camera lighting with disabled main camera

Ravi Mathur ravidavi at utexas.edu
Wed Jan 10 08:24:45 PST 2018


robertosfield wrote:
> Ops, don't send modifications without compiling them first...
> 
> The View::LightingMode and SceneView::LightingMode aren't compatible
> enum's so can't be passed as is.  I've spotted a better way of doing
> this update, putting into the Renderer::updateSceneView() method along
> with the setting of the fusion distance.
> 
> Could you test this one?
> 
> Robert.
> 
> _______________________________________________
> osg-users mailing list
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
>  ------------------
> Post generated by Mail2Forum


Unfortunately your update to Renderer::updateSceneView() doesn't address the issue, nor would I expect it to. SceneView already gets the updated osg::View::LightingMode value inside SceneView::inheritCullSettings(), which is called inside Renderer::cull() (line 69, just a few lines down from the call to updateSceneView()).

The problem is that the Renderer is never run for the master camera since I disabled it using mastercamera->setGraphicsContext(NULL). So the SceneViews for the slaves, which use the master camera's StateSet as their _globalStateSet, still have lighting enabled.

I'm not saying this behavior is wrong per se, since I did explicitly disable the master camera. But if any change is to made to the OSG, it would have to be in ViewerBase::renderingTraversals() since that is where the master camera's Renderer::cull() method would normally be called.

Let me think of an appropriate minimal update to ViewerBase::renderingTraversals(). Basically it needs to first update the lighting modes for each disabled camera's StateSet before performing Renderer::cull() for each enabled camera.

Ravi

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72713#72713







More information about the osg-users mailing list