Re: [osg-users] Transform matrix as Uniform to shaders

2017-10-08 Thread Nikolai Christensen
Thank you! Cheers, Nikolai -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=72132#72132 ___ osg-users mailing list osg-users@lists.openscenegraph.org

Re: [osg-users] Transform matrix as Uniform to shaders

2017-10-05 Thread Sebastian Messerschmidt
Hi Nickolai, In case you're really after the ModelMatrix you need to use the osg_ViewMatrixInverse and multiply it with your current osg_ModelViewMatrix. As Robert already mentioned you need to set the osg::State::setUseModelViewAndProjectionUniforms(true) in order to make this work.

Re: [osg-users] Transform matrix as Uniform to shaders

2017-10-05 Thread Robert Osfield
Hi Nikolai, If you are using a GL2 build of the OSG then you can just use the built-ins like gl_ModelViewMatrix. If you are using GL3/GLCoreProfile or GLES2 then you'll tell the OSG to provide osg_ModelViewMatrix etc. in place of the gl_ModelViewMaitrx etc. You can tell the OSG to provide the

[osg-users] Transform matrix as Uniform to shaders

2017-10-04 Thread Nikolai Christensen
Hi, I need a matrix for the transform from root scene node to the node where the mesh the shaders currently are operating on is in. Does OSG pass such a matrix automatically to the shaders? If yes, is there other uniforms passed and is there a list of them somewhere? Sorry if my question is