[osg-users] How to access material properties from a GLSL shader?

Armin Samii artoonie at gmail.com
Wed Jan 8 14:53:28 PST 2020

Does openscenegraph provide easy access to osg::Material values in the 
shaders? If so, in which Uniforms are the various properties set? If not, 
is the best path forward to set my own Uniforms based on osg::Material?

For context: I had an OBJ/MTL that loaded and rendered fine by default, but 
when I turn on `setUseVertexAttributeAliasing`, the texture coordinates 
seem to break. I am trying to replace the default rendering with my own 
shader instead, but can't reproduce the original look and feel. While 
texture coordinates and texture loading does work with shaders, I cannot 
seem to find how to access the colors specified in the MTL files.

(A google search shows several results for "openscenegraph material 
shaders" which looks helpful, but they are all in the forum, which is now 
inaccessible. Apologies if this question has been asked and answered 

You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+unsubscribe at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/e74bc901-c900-4620-9741-7347471a8fc9%40googlegroups.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20200108/0269777e/attachment.html>

More information about the osg-users mailing list