[osg-users] problem with osgFX::SpecularHighlights

Lv Qing donlvqing at msn.com
Sat Apr 16 19:09:46 PDT 2011


Hi,


when shl->setLightNumber(8) 

it prints "

Warning: detected OpenGL error 'invalid enumerant' at after RenderBin::draw(..) "

when set Light Numbe below 8 ,it is OK.


Code:

int main()
{
	osgViewer::Viewer* viewer = new osgViewer::Viewer();

	osg::Group* root = new osg::Group();

	osg::Node* node = new osg::Node() ;
	node = osgDB::readNodeFile("test.ive");
	
	osgFX::SpecularHighlights* shl = new      osgFX::SpecularHighlights();
	
	shl->setTextureUnit(0);

	shl->setLightNumber(8);
	
	shl->setSpecularColor(osg::Vec4(1.0f,0.0f,0.0f,1.0f));
	
	shl->setSpecularExponent(16.0f);

	shl->addChild(node);

	root->addChild(shl);
	osgUtil::Optimizer optimizer ;
	optimizer.optimize(root) ;
	viewer->setSceneData(root);
	viewer->realize();
	viewer->run();
	return 0 ;
}




... 

Thank you!

Cheers,
Lv

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








More information about the osg-users mailing list