Hi Paul, I have just tried your example out and the OSG is working perfectly, the problem stems for dumptruck.osg not defining a color array on one of the geometries, but defining it for the other two. In your app you enable the AMBIENT_AND_DIFFUSE colour material mode, which shows up this disparity, but dumptruck.osg disable the the colour material mode which makes OpenGL ignore any vertex colour arrays so hides the problem in the model.
If you are seeing similar problems in your own app/models then go looking for missing colour/normal arrays on geometries. For dumptruck.osg I've added the missing colour array and checked into into svn/trunk of OpenSceneGaph-Data, this fixes the problem you've observed. Robert. On Fri, Jan 23, 2009 at 5:24 PM, Paul Melis <[email protected]> wrote: > Paul Melis wrote: >> Paul Melis wrote: >>> Hi Robert, >>> >>> Robert Osfield wrote: >>>> I would like to finish this week with a 2.7.9 dev release, could users >>>> do a check out of svn/trunk and let know if your build succeeds/or >>>> where it fails. >>>> >>> Not really a build failure of such, but could you take a look at the >>> example I posted in the thread "Re: [osg-users] Statesets with >>> renderBin make sub-models invisible", dated 01/22/2009 10:18 AM. >>> Either I'm misunderstanding overriding of stateset attributes or >>> something weird is going on. >> Yaiks, I did testing of the code in that post with 2.6. I'll retry >> with SVN tonight, to see if the behaviour shows there as wel.. > Ok, with SVN the behaviour is the same, i.e. not all Geometries are > using the material override (see attachement), nor is the OVERRIDE value > saved to the output file mat.osg. > > Paul > > #include <osg/Material> > #include <osg/StateSet> > #include <osgDB/ReadFile> > #include <osgDB/WriteFile> > #include <osgViewer/Viewer> > > int main() > { > osg::ref_ptr<osg::Node> model; > > model = osgDB::readNodeFile("dumptruck.osg"); > > osg::ref_ptr<osg::Material> mat; > mat = new osg::Material(); > mat->setColorMode(osg::Material::AMBIENT_AND_DIFFUSE); > mat->setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4(0, 0.99, 0.9, 0)); > > osg::StateSet *ss = model->getOrCreateStateSet(); > ss->setAttributeAndModes(mat.get(), > osg::StateAttribute::ON|osg::StateAttribute::OVERRIDE); > > osgDB::writeNodeFile(*(model.get()), "mat.osg"); > > osgViewer::Viewer viewer; > > viewer.setSceneData(model.get()); > viewer.run(); > } > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

