Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __CS_CSPLUGINCOMMON_RENDERMANAGER_SHADOW_COMMON_H__
00020 #define __CS_CSPLUGINCOMMON_RENDERMANAGER_SHADOW_COMMON_H__
00021
00026 #include "ivideo/graph3d.h"
00027 #include "ivideo/shader/shader.h"
00028
00029 #include "csplugincommon/rendermanager/texturecache.h"
00030 #include "csutil/customallocated.h"
00031 #include "csutil/parray.h"
00032
00033 namespace CS
00034 {
00035 namespace RenderManager
00036 {
00037 class PostEffectManager;
00038
00040 class CS_CRYSTALSPACE_EXPORT ShadowSettings
00041 {
00042 public:
00044 struct Target : public CS::Memory::CustomAllocated
00045 {
00047 csRenderTargetAttachment attachment;
00049 CS::ShaderVarStringID svName;
00051 TextureCache texCache;
00052
00053 Target (csRenderTargetAttachment attachment,
00054 CS::ShaderVarStringID svName,
00055 const char* format, uint texFlags)
00056 : attachment (attachment), svName (svName),
00057 texCache (csimg2D, format,
00058 CS_TEXTURE_3D | CS_TEXTURE_CLAMP | texFlags,
00059 "shadowmap",
00060 TextureCache::tcachePowerOfTwo | TextureCache::tcacheExactSizeMatch)
00061 {}
00062 };
00063 typedef csPDelArray<Target> TargetArray;
00064
00066 TargetArray targets;
00068 csRef<iShader> shadowDefaultShader;
00070 csStringID shadowShaderType;
00072 bool provideIDs;
00074 CS::ShaderVarStringID svMeshIDName;
00075
00077 csRef<PostEffectManager> postEffects;
00078
00085 void ReadSettings (iObjectRegistry* objReg, const char* shadowType);
00091 void AdvanceFrame (csTicks time);
00092 protected:
00093 bool ReadTargets (TargetArray& targets, iConfigFile* cfg,
00094 const char* prefixed, iShaderVarStringSet* svStrings,
00095 iObjectRegistry* objReg);
00096 };
00097 }
00098 }
00099
00100 #endif // __CS_CSPLUGINCOMMON_RENDERMANAGER_SHADOW_COMMON_H__