On 01/27/2011 12:58 PM, Steven Powers wrote:
I'm working with some legacy code that uses ARBv1.0 shader code for some of the 
leaf nodes.

The ARB shaders work just fine but they are never envoked when I place a GLSL 
shader (simple shadowing shader) on the root node.

I've tried setting the mask of the ARB shader to ON | OVERRIDE | PROTECTED and 
I made sure the mask of the GLSL shader is ON | OVERRIDE.

If I swap the ARB shader on the leaf node with a stand-in GLSL shader it works 
fine.

Some differences:

ARB shaders are loaded as osg::VertexProgram and osg::FragmentProgram

GLSL shaders are loaded as osg::Program with osg::Shader attached.

Both implementations share the same Node with identical state sets.

Any clues are appreciated.

ARB and GLSL are two different StateAttributes. OSG will treat them as orthogonal, but the hardware obviously won't. Or, to put it another way, you can't have both GLSL and ARB programs running, but OSG probably doesn't know that.

You probably need to explicitly turn off the osg::Program at the same time as you enable the osg::VertexProgram on the nodes in question. Something like this:

stateSet = node->getOrCreateStateSet();
osg::Program * program = new osg::Program();
stateSet->setAttributeAndModes(program, osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED);

--"J"
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to