8 #ifndef STRUCTURESHADOWSOSG_H
9 #define STRUCTURESHADOWSOSG_H
12 #include <osg/TexGenNode>
13 #include <osg/PolygonOffset>
14 #include <osg/CameraNode>
23 void SetSunDirection(osg::Vec3 SunPosition);
24 void ComputeShadows();
25 bool Initialise(osgUtil::SceneView *pSceneView, osg::Node *pStructures,
26 osg::Node *pShadowed,
const int iResolution,
float fDarkness,
27 int iTextureUnit,
const FSphere &ShadowSphere);
28 void SetShadowDarkness(
float fDarkness);
29 void SetShadowSphere(
const FSphere &ShadowSphere,
bool bForceRedraw);
30 void SetPolygonOffset(
float fFactor,
float fUnits);
31 void ExcludeFromShadower(osg::Node *pNode,
bool bExclude);
32 bool IsExcludedFromShadower(osg::Node *pNode);
38 void setMatrix(
const osg::Matrix& Matrix)
43 virtual void apply(osg::State& state)
const
46 glLoadMatrix(m_Matrix.ptr());
55 osg::ref_ptr<osg::CameraNode> m_pCameraNode;
56 osg::ref_ptr<osg::Texture2D> m_pTexture;
57 osg::ref_ptr<osg::Material> m_pMaterial;
58 osg::ref_ptr<osgUtil::SceneView> m_pSceneView;
59 osg::ref_ptr<osg::Node> m_pShadowed;
60 osg::ref_ptr<osg::TexGenNode> m_pTerrainTexGenNode;
61 osg::ref_ptr<osg::Group> m_pTop;
62 osg::ref_ptr<osg::Uniform> m_pAmbientBias;
63 osg::ref_ptr<osg::PolygonOffset> m_pPolygonOffset;
64 float m_fShadowDarkness;
66 bool m_bStructureOnStructureShadows;
67 osg::Vec3 m_SunDirection;
68 static osg::TexGenNode *m_pStructureTexGenNode;
69 int m_iTargetResolution;
70 int m_iCurrentResolution;
71 bool m_bUsingLiveFrameBuffer;
72 std::list<osg::Node*> m_ExcludeFromShadower;
73 float m_fPolygonOffsetFactor;
74 float m_fPolygonOffsetUnits;
78 #endif // STRUCTURESHADOWSOSG_H