[osg-users] When gets the view matrix of a camera ipdated

Robert Osfield robert.osfield at gmail.com
Sat Nov 18 09:59:09 PST 2017


Hi Werner,

The initial draw callback is called at the start of the draw traversal
for that Camera's rendering graph, this rendering graph is populated
by the cull traversal which happens prior to the draw traversal, this
includes all the accumulation of all the matrices in the scene graph
into final modelview matrices, so changing the Camera's view matrix
during the initial draw callback won't affect the rendering result for
that frame.

You should set the Camera's view matrix in the update or at latest
cull traversal. Have a look at the RTT Camera's in the osgShadow
library.


Robert.


On 18 November 2017 at 16:06, Werner.Modenbach at texion.eu
<Werner.Modenbach at texion.eu> wrote:
> Hi all,
> I have written some classes for special effects like ambient occlusion or
> shadow.
> All those classes are using their own prerender cameras. The cameras use the
> initial draw callback for updating their view matrices by using the main
> cameras view matrix.
> Unfortunately it looks like the rendered shadow/ ambient occlusion matrices
> correspond to the previous frame. So my guess is that the view matrix of the
> main camera isn't updated from the camera manipulator at the time of the
> callback.
> Is there any better callback I can use for that?
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>


More information about the osg-users mailing list