|
参考array神的书的代码:
- osg::Node* light0 = createLightSource(0, osg::Vec3(0.0f,0.0f,3.0f), osg::Vec4(0.0f,1.0f,0.0f,1.0f) );
- osg::Node* light1 = createLightSource(1, osg::Vec3(0.0f,-3.0f,-3.0f), osg::Vec4(0.0f,1.0f,0.0f,1.0f) );
- lightTransform->addChild( light0 );
- lightTransform->addChild( light1 );
- lightTransform->getOrCreateStateSet()->setMode( GL_LIGHT0, osg::StateAttribute::ON |osg::StateAttribute::OVERRIDE);
- lightTransform->getOrCreateStateSet()->setMode( GL_LIGHT1, osg::StateAttribute::ON |osg::StateAttribute::OVERRIDE);
复制代码
但是就是只有第一个光源起了作用, 第二个没有作用, 不知道为什么. 搞了很长时间了 |
|