[osg-users] using mutiple cameras and view dependent uniforms
Robert Osfield
robert.osfield at gmail.com
Wed Aug 1 03:16:49 PDT 2007
Hi Darby,
Exactly what informtation do you need about the View? The View's
master Camera's local view matrix? Or the slave Camera's local View
matrix?
I don't know if its what you are after by the OSG by default defines a
osg_ViewMatrix and osg_ViewMatrixInverse uniforms which you can use in
your shaders, OpenGL itself also defined gl_ModelViewMatrix and
gl_ModelViewMatrixInverse.
W.r.t draw callback. these are only called once if you are display
listing Drawables (this is done by default).
Robert.
On 7/31/07, Darby Thompson <darbyt at gwu.edu> wrote:
> Hi,
>
> I'm currently using a CompositeViewer on a scene which uses GLSL shaders that are view dependent. Originally I had a Uniform variable storing the current view position with a Callback to update. The callback used a pointer to the Viewer to get the Camera view position, but now this is redundant since it has been converted to a Composite Viewer. I can't update using a regular update callback since that is only called once per frame rather than once per view/camera. I tried attaching a drawCallback to the Camera but it never got called and I can't find any working examples of attaching a drawCallback to a drawable object or examples of finding the current camera position during traversal when using multiple cameras... Any suggestions as to how I should proceed (without completely duplicating my scene data for each camera) would be greatly appreciated!
>
> Thanks,
> Darby
> _______________________________________________
> 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