方法一:earth文件配置关闭
<options>
<lighting>false</lighting>
<terrain>
<lighting>false</lighting>
</terrain>
</options>
方法二:后台代码关闭
SkyNode->setLighting(osg::StateAttribute::Values::OFF);
// osg::StateAttribute::Values的值如下
enum Values
{
/** means that associated GLMode and Override is disabled.*/
OFF = 0x0,
/** means that associated GLMode is enabled and Override is disabled.*/
ON = 0x1,
/** Overriding of GLMode's or StateAttributes is enabled, so that state below it is overridden.*/
OVERRIDE = 0x2,
/** Protecting of GLMode's or StateAttributes is enabled, so that state from above cannot override this and below state.*/
PROTECTED = 0x4,
/** means that GLMode or StateAttribute should be inherited from above.*/
INHERIT = 0x8
};
未关闭的效果
关闭后的效果