[osg-users] Enable, Disable Multible Shaders

Robert Osfield robert.osfield at gmail.com
Tue Jan 5 02:47:05 PST 2016


Hi Brain,

OpenGL program/shaders can't be enabled/disabled using
glEnable/glDisable so the OSG can't enable/disable them through this
mechanism.  The only way to disable a shader in OSG is assign a null
(empty) osg::Program to a StateSet that decorates the subgraph that
you want to disable the shaders for.  Another approach is to avoid
placing an osg::Program above the whole scene graph, instead keep it
local where it's needed so it doesn't switch it one for all subgraphs.

On 25 December 2015 at 19:28, Brian Perry <perry.brian at gmail.com> wrote:
> Hi,
>
> I having a similar problem with stateset.  I have a program where all the geometry has a shader attached at the point of loading.  There is one object in this entire database of objects that have shaders attached to it somewhere and is causing this object to cast a shadow based on a singular shader based light source.  I tried to solve this problem by disabling the PROGRAM state attribute but disabling doesn't seem to prevent it from casting a shadow.  I don't understand though.  I can get the node for these objects and derive the state sets from those nodes but I can't seem to disable the object from casting a shadow.  Someone told me that there are attributes on textures and geometry that allow you to make it so that texture or geometry doesn't cast a shadow.
>
> Thank you!
> Brian
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=65923#65923
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


More information about the osg-users mailing list