Create Sun light source in OSG

僤鯓⒐⒋嵵緔 提交于 2019-12-04 15:37:27
Ruan Caiman

For what it's worth, the OSG forum/mailing list is usually pretty good about answering questions: http://forum.openscenegraph.org/

To try to answer your question here - it depends on the properties of the material you are trying to light.

I've found that materials on some models I load will only react to one particular of the 3 light types (specifically, some model are specular-only), so I just turn on all 3:

osg::Light *light = new osg::Light;
light->setAmbient(osg::Vec4(1.0,1.0,1.0,1.0));
light->setDiffuse(osg::Vec4(1.0,1.0,1.0,1.0));
light->setSpecular(osg::Vec4(1,1,1,1));  // some examples don't have this one

For your case, you might alternatively be able to redefine the ambient and/or diffuse properties of your terrain.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!