[osg-users] Inherit parts of shader program

Ravi Mathur ravidavi at utexas.edu
Fri Sep 2 15:03:26 PDT 2016

Hi all,

I have a Geode that contains multiple Drawables. I set a Program containing a vertex Shader on the Geode's StateSet. This was done because all contained drawables should use the same vertex shader. Everything works great.

Now, I want to set a fragment shader on just one of the contained drawables, but keep using the vertex shader from the main geode. So I created a new Program, added the custom fragment Shader, and added the Program to the drawable's StateSet. But now that drawable doesn't use the parent geode's vertex shader! It just uses the OpenGL fixed-pipeline vertex shader.

Is there a way to inherit just the vertex shader from a Geode to one of its contained Drawables that has its own fragment shader? I feel like I'm approaching this incorrectly, hopefully someone can slap me into shape. :)


Read this topic online here:

More information about the osg-users mailing list