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

2020-01-10 Thread Armin Samii
Thanks, Chris. Those materials are not available post-GLES 1.2, and I couldn't find anywhere in the OSG codebase that exposed materials as uniforms. I did find this: https://github.com/gwaldron/osgearth/blob/master/src/osgEarth/Lighting.cpp Which traverses the scene graph, finds Materials, and rep

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

2020-01-08 Thread Chris Djali / AnyOldName3
Hi, osg::Material pretty much encapsulates OpenGL's fixed-function material state, so things like glMaterialfv (that controls material settings for whole draw calls) and glColorMaterial (that controls what vertex colours actually affect). If you're using a suitably old GLSL version, you can ac

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

2020-01-08 Thread Armin Samii
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 wh