本文转至http://www.cnblogs.com/shapherd/archive/2010/08/10/osg.html
作者写的比较好,再次收藏,希望更多的人可以看到这个文章
互联网是是一个相互分形并学习的平台,我希望我每个人可以将我们认为有价值的东西,在不损害他人利益的情况下分享给更多的人。
OSG对阴影的支持也相当的好,可以很容易的写出简单的阴影效果,可以参考例子osgShadow
OSG有一个专门的shadow类来支持阴影效果,提供了很多接口,如:
void setBackdropType(BackdropType type) //说明:设置阴影类型。 void setBackdropOffset(float offset=0.07f) void setBackdropOffset(float horizontal,float vertical) //说明:设置阴影的离开程度与方向 void setBackdropColor(const osg::Vec4&color) //说明:设置阴影颜色 void setColorGradientMode(ColorGradientMode mode) //说明:设置颜色映射方式,可以得到渐变效果