Hi Chritoph,

The right way to do is to to assign an osg::Uniform to each
osg::View's master Camera's StateSet i,e


  view->getCamera()->getOrCreateStateSet()->addUniform(new
osg::Uniform("viewport", osg:::Vec4(x,y,w,h));

Robert

On 9 May 2018 at 10:20, Christoph Dohmen <[email protected]> wrote:
> Hi all,
>
> I need to use the viewport dimensions for some calculations in my vertex 
> shader. The most found way of doing the update of the viewport-size uniform 
> is the ViewportCallback derived from osg::Uniform::Callback which 
> encapsulates a camera.
> But what happens if I have multiple views?
> How can I fetch the viewport size in my shader per viewer?
>
> Thank you!
>
> Cheers,
> Christoph
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=73573#73573
>
>
>
>
>
> _______________________________________________
> 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