Hi Fred,

The osg::Camera has support for setting the reference frame so that it
inherits the viewpoint for LOD calculation so that you get the same
LOD's for your render to texture pass as you would for your main view.
 In osgShadow you'll this used and set up thus:

   _camera->setReferenceFrame(osg::Camera::ABSOLUTE_RF_INHERIT_VIEWPOINT);

This doesn't require any other changes so no need to try Sergey's
suggestion of LODScale() which would achieve rather different results.

Robert.


On 2 April 2012 13:12, Frederic Bouvier <[email protected]> wrote:
> Hi,
>
> FlightGear now includes a deferred renderer that produce shadows. As the 
> lighting is done from a Gbuffer in a fullscreen quad render, I can't (correct 
> me if I'm wrong) use osgShadow.
>
> So in my implementation, I render the geometry of the whole scenegraph to a 
> depth texture using an orthographic projection in the direction of the light. 
> The view matrix sets the sun position at 10000m from a position ahead of the 
> viewer. But when the viewer is near an object that has a LOD node that has a 
> range of 0 - 9000m, the model is not renderer in the shadow map and the 
> viewer doesn't see a shadow.
>
> So the question : is there special code in osgShadow that address this kind 
> of situation : a LOD range for the viewer unsuitable for the light source ?
>
> I tried to override the LOD::traverse method in a specific cull visitor that 
> calls Group::traverse instead, but I was said it is a bad thing, and I can 
> understand it breaks PagedLOD and any descendant too.
>
> Regards,
> -Fred
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to