Hi forum, I am trying to implement the diffuse shading using shaders and i need to access the model view and projection matrix in the shader. There are built-in uniform variables in osg to get those information.
Is it possible to extract the model , view and projection matrices separately ? There is only function i found in the sceneview.cpp to extract the viewmatrix by the following snippet: Code: stateset->getOrCrateUniform(); Is there any unifroms to find the rest of the matrices? In one of the post robert suggested to enable the following: Code: osgState state; state.setUseModelViewAndProjectionUniforms(true); How to set the state to the model on which i shall do the shading calculation ? So far i only know how to extract the stateset of the model by the following call: Code: osg::StateSet* stateset = model->getOrCreateStateSet(); If there any examples in the repository answer to all my questions, please refer me to it. Thanks Sajjadul ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52722#52722 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

