10 #include <osg/LightSource>
12 #include <osg/LightModel>
17 #include <xercesc/parsers/XercesDOMParser.hpp>
20 #include <osgShadow/ShadowMap>
21 #include <osgShadow/SoftShadowMap>
22 #include <osgShadow/ShadowTexture>
23 #include <osgShadow/LightSpacePerspectiveShadowMap>
24 #include <osg/CullFace>
27 #include <osg/BlendFunc>
28 #include <osg/AlphaFunc>
29 #include <osg/Geometry>
30 #include <osg/Texture2D>
31 #include <osgDB/readFile>
39 namespace APLightsEditor
45 osg::ref_ptr<osg::Group> lightGroup;
47 osg::ref_ptr<osgShadow::ShadowMap> sm;
48 osg::ref_ptr<osgShadow::SoftShadowMap> ssm;
51 osg::ref_ptr<osg::ClearNode> clearColor;
52 osg::ref_ptr<osg::LightModel> lightModel;
53 osg::ref_ptr<osg::StateSet> lightSS;
54 std::vector<osg::Node*> flares;
55 unsigned int maxLights;
60 osg::ref_ptr<osg::Uniform> maximum;
63 osg::ref_ptr<osg::Camera> ndCamera;
64 osg::ref_ptr<osg::Camera> ndCameraBack;
65 osg::ref_ptr<osg::Camera> doCamera;
66 osg::ref_ptr<osg::Camera> bounceCamera;
67 osg::ref_ptr<osg::Camera> blurXCamera;
68 osg::ref_ptr<osg::Camera> blurYCamera;
69 osg::ref_ptr<osg::StateSet> ndSS;
70 osg::ref_ptr<osg::StateSet> ndBSS;
71 osg::ref_ptr<osg::StateSet> doSS;
72 osg::ref_ptr<osg::StateSet> bounceSS;
73 osg::ref_ptr<osg::StateSet> blurXSS;
74 osg::ref_ptr<osg::StateSet> blurYSS;
75 osg::Vec2 giTextureSize;
76 osg::Vec2 viewportSize;
78 std::string envMapPath;
81 void clamp(
double clampValue,
double& number);
82 double computeSunSunriseOrSunset(
int day,
int month,
int year,
bool sunrise);
184 int add(osg::Vec4 position = osg::Vec4(0,0,0,1),
185 osg::Vec3 direction = osg::Vec3(0,0,-1),
186 float spotCutOff = 180,
194 int add(osg::LightSource* lightSource);
199 int addSun(
int day,
int month,
int year,
int hour,
int minute, osg::Vec4* sunPosition = NULL);
204 bool remove(
int lightNum);
216 osg::Light*
at(
int lightNum);
342 osg::Texture2D*
createBuffer(osg::Vec2 textureSize, osg::Texture::FilterMode filter,
343 osg::Texture::WrapMode wrap, GLint internalFormat, GLenum sourceFormat);
347 void setUpCamera(osg::ref_ptr<osg::Camera> camera, osg::Vec2 textureSize, osg::ref_ptr<osg::StateSet> camSS,
348 osg::ref_ptr<osg::Shader> vert, osg::ref_ptr<osg::Shader> frag);