State leak
Brought to you by:
ruben
When using Hw Meshes, glColor is not set but ColorMode is set to osg::Material::AMBIENT_AND_DIFFUSE which results in random color
I fixed this bz turning off ColorMode.in HwMeshStateSetCache::createHwMeshStateSet
osg::Material * osgMat = (osg::Material *)stateSet->getAttribute(osg::StateAttribute::MATERIAL);
if(osgMat!=NULL)
osgMat->setColorMode( osg::Material::OFF );