9 #ifndef shadowMapImplMinimal_H_
10 #define shadowMapImplMinimal_H_
17 #include <osg/Material>
18 #include <osg/MatrixTransform>
19 #include <osg/LightSource>
20 #include <osgUtil/CullVisitor>
22 #include <osg/Texture2D>
24 namespace makOsgShadowFX
37 virtual void setupShadowReceivingScene();
39 virtual void aimShadowCastingCamera(
const osg::Light *light,
40 const osg::Vec4 &worldLightPos,
const osg::Vec3 &worldLightDir,
41 const osg::Vec3 &worldLightUp = osg::Vec3(0,1,0) );
43 virtual void aimShadowCastingCameraWithBounds(
const osg::BoundingSphere &bounds,
44 const osg::Light *light,
const osg::Vec4 &worldLightPos,
45 const osg::Vec3 &worldLightDir,
const osg::Vec3 &worldLightUp = osg::Vec3(0,1,0) );
47 virtual osg::BoundingBox computeScenePolytopeBounds(
const osg::Matrix* m = NULL );
49 virtual void cutScenePolytope(
const osg::Matrix & matrix,
const osg::Matrix & inverse,
50 const osg::BoundingBox &bb =osg::BoundingBox(-1,-1,-1,1,1,1) );
52 virtual void frameShadowCastingCamera(
const osg::Camera* cameraMain,
53 osg::Camera* cameraShadow,
int pass=1 );
55 virtual osg::BoundingBox computeShadowReceivingCoarseBounds();
66 static void trimProjection( osg::Matrixd & projection, osg::BoundingBox subrange,
unsigned int trimMask = (1|2|4|8|16|32));
67 static void clampProjection ( osg::Matrixd & projection,
float n = 0,
float f = FLT_MAX );
68 static void extendProjection( osg::Matrixd & projection, osg::Viewport * viewport,
const osg::Vec2& margin );