Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef __SP_LIGHTMAP_GENERATOR_BASE_H__
00009 #define __SP_LIGHTMAP_GENERATOR_BASE_H__
00010
00011
00012 #include "Base/spStandard.hpp"
00013
00014 #ifdef SP_COMPILE_WITH_LIGHTMAPGENERATOR
00015
00016
00017 #include "Base/spDimensionMatrix4.hpp"
00018 #include "Base/spMaterialColor.hpp"
00019 #include "Base/spTreeNodeImage.hpp"
00020 #include "Base/spBaseExceptions.hpp"
00021 #include "SceneGraph/spSceneLight.hpp"
00022
00023 #include <boost/function.hpp>
00024 #include <vector>
00025
00026
00027 namespace sp
00028 {
00029
00030 namespace scene
00031 {
00032
00033 class Mesh;
00034 class Light;
00035
00036 }
00037
00038 namespace tool
00039 {
00040
00041
00042
00043
00044
00045
00046 namespace LightmapGen
00047 {
00048
00049 struct SVertex;
00050 struct STriangle;
00051 struct SFace;
00052 struct SLight;
00053 struct SLightmap;
00054 struct SLightmapTexel;
00055 struct SModel;
00056 struct SAxisData;
00057 struct SRasterizerVertex;
00058
00059 typedef scene::ImageTreeNode<SLightmap> TRectNode;
00060
00061 }
00062
00063
00064
00065
00066
00067
00068 static const video::color DEF_LIGHTMAP_AMBIENT = video::color(20);
00069 static const u32 DEF_LIGHTMAP_SIZE = 512;
00070 static const f32 DEF_LIGHTMAP_DENSITY = 10.0f;
00071 static const u32 DEF_LIGHTMAP_BLURRADIUS = 2;
00072
00073
00074
00075
00076
00077
00078 enum ELightmapGenerationsFlags
00079 {
00080 LIGHTMAPFLAG_NOCOLORS = 0x00000001,
00081 LIGHTMAPFLAG_NOTRANSPARENCY = 0x00000002,
00082 };
00083
00084 enum ELightmapGenerationStates
00085 {
00086 LIGHTMAPSTATE_INITIALIZING,
00087 LIGHTMAPSTATE_PARTITIONING,
00088 LIGHTMAPSTATE_SHADING,
00089 LIGHTMAPSTATE_BLURING,
00090 LIGHTMAPSTATE_BAKING,
00091 LIGHTMAPSTATE_COMPLETED,
00092 };
00093
00094
00095
00096
00097
00098
00104 typedef boost::function<bool (f32 Progress)> LightmapProgressCallback;
00112 typedef boost::function<void (const ELightmapGenerationStates State, const io::stringc &Info)> LightmapStateCallback;
00113
00114
00115
00116
00117
00118
00119 struct SP_EXPORT SCastShadowObject
00120 {
00121 SCastShadowObject(scene::Mesh* Obj) throw(io::NullPointerException);
00122 ~SCastShadowObject();
00123
00124
00125 scene::Mesh* Mesh;
00126 };
00127
00128 struct SP_EXPORT SGetShadowObject
00129 {
00130 SGetShadowObject(scene::Mesh* Obj, bool DefStayAlone = false) throw(io::NullPointerException);
00131 SGetShadowObject(
00132 scene::Mesh* Obj, const std::vector< std::vector<f32> > &DefTrianglesDensity,
00133 bool DefStayAlone = false
00134 ) throw(io::NullPointerException);
00135 ~SGetShadowObject();
00136
00137
00138 scene::Mesh* Mesh;
00139 bool StayAlone;
00140
00141 std::vector< std::vector<f32> > TrianglesDensity;
00142 };
00143
00144 struct SP_EXPORT SLightmapLight
00145 {
00146 SLightmapLight();
00147 SLightmapLight(const scene::Light* Obj) throw(io::NullPointerException);
00148 ~SLightmapLight();
00149
00150
00151 scene::ELightModels Type;
00152
00153 dim::matrix4f Matrix;
00154 video::color Color;
00155
00156 f32 Attn0, Attn1, Attn2;
00157 f32 InnerConeAngle, OuterConeAngle;
00158
00159 bool Visible;
00160 };
00161
00162
00163 }
00164
00165 }
00166
00167
00168 #endif
00169
00170 #endif
00171
00172
00173
00174