Hi,

I'm having some strange problems with some shader related code I've written..

The problem(s) is/are somewhere in a large chunk of code tied to my own engine built atop osg. I've tried to extract from the whole mess small reproducible problems in the hope it'll help me work out what's going wrong in the bigger picture.

Attached is a file (5x5 wooden, .osg format) containing a simple model with a shader on the root node.

Attachment: 5x5wooden.osg
Description: Binary data


When the model is loaded and the following code is run over the resulting osg::Node*

osg::StateSet *ss = border->getOrCreateStateSet();
osg::Program *ssp = dynamic_cast<osg::Program*>(ss->getAttribute (osg::StateAttribute::PROGRAM));
if(ssp != NULL)
{
        if(ssp->isFixedFunction() == false) cout << "program is NOT FIXED\n";
        else cout << "program IS FIXED\n";
}       
else cout << "program object could not be found\n";

The output shows that the program attached to the root node is fixed function (empty of shaders). Inspection of the .osg file shows two shaders though.

Similarly if I attach some shaders programatically and output the result to disk in .osg format, inspection of the resultant file shows an empty program object.

Attached is another model (black, .osg format) which doesn't exhibit the problem and renders correctly with shader.

Attachment: black.osg
Description: Binary data


If I recall correctly the shaders were originally attached programatically with the output dumped to disk using a version of osg somewhere between 0.98 and 1.0.

This doesn't seem very logical, however it is reproducible every time on my main work computer.

Thanks for any time,
Alan.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to