[osg-users] How does OSG pass in the correct incoming ModelViewProjectionMatrix using SHAder version 330?

OpenSceneGraph Users osg-users at lists.openscenegraph.org
Mon Jun 22 05:31:44 PDT 2020


There is no need to provide the modelview and projection matrices yourself,
and I'd recommend against doing so as you'd loose much of the OSG
functionality relating to Camera's and accumulating modelview and
projection matrices/

When using shaders the OSG can provide the projection and modelview
matrices via osg_* built in uniforms that stand in place of the older
OpenGL gl_* matrices (these are deprecated in OpenGL and don't exist for
GLES2 and GL3 core profile).  You need to enable this mapping. by setting
the osg::State's    UseModelViewAndProjectionUniforms to true. The
osgsimplegl3 example illustrates how this is done.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20200622/57e97c06/attachment.html>


More information about the osg-users mailing list