Hi, I created models with osgmaxexp but I use OpenGL3.3 with osg and got error 
message 
Warning: detected OpenGL error 'invalid enumerant' at after RenderBin::draw(..)
Warning: Material::apply(State&) - not supported.
Warning: Material::apply(State&) - not supported.
I use this statement to disable some modes but materials errors are also exist.
osg::Node* highp = osgDB::readNodeFile("2h.IVE");
osg::StateSet* stateset2 = new osg::StateSet();
                                osg::Program* program2 = new osg::Program;
                                stateset2->setAttribute(program2);
                                
program2->addShader(osg::Shader::readShaderFile(osg::Shader::VERTEX, 
osgDB::findDataFile("model.vert")));
                                
program2->addShader(osg::Shader::readShaderFile(osg::Shader::FRAGMENT, 
osgDB::findDataFile("model.frag")));
                                osg::Uniform* baseTextureSampler = new 
osg::Uniform("sampler0",0);
                                stateset2->addUniform(baseTextureSampler);
                                osg::Uniform* u_color = new 
osg::Uniform("u_color",osg::Vec4(1.0,1.0,1.0,1.0));
                                unsigned int mode = 
osg::StateAttribute::OVERRIDE | osg::StateAttribute::OFF;
                                stateset2->setMode(GL_LIGHTING,mode);
                                 osg::Material* material = new osg::Material;
                                material->setColorMode(osg::Material::OFF); // 
switch glColor usage off
                                stateset2->setAttributeAndModes(material, 
osg::StateAttribute::ON);
                                stateset2->addUniform(u_color);
                                highp->setStateSet(stateset2);

How can I switch off osg::Material from my model? 

... 

Thank you!

Cheers,
Roman

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=29265#29265





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to