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
00020 #ifndef __CS_CSGFX_SHADER_LIGHTSVCACHE_H__
00021 #define __CS_CSGFX_SHADER_LIGHTSVCACHE_H__
00022
00023 #include "csextern.h"
00024
00025 #include "csutil/array.h"
00026 #include "csutil/ref.h"
00027 #include "iutil/strset.h"
00028 #include "ivideo/shader/shader.h"
00029
00037 class CS_CRYSTALSPACE_EXPORT csLightShaderVarCache
00038 {
00039 public:
00041 enum LightProperty
00042 {
00044 lightDiffuse = 0,
00046 lightSpecular,
00048 lightPositionWorld,
00050 lightTransformWorld,
00052 lightTransformWorldInverse,
00054 lightAttenuation,
00059 lightAttenuationTex,
00061 lightDirectionWorld,
00063 lightInnerFalloff,
00065 lightOuterFalloff,
00067 lightType,
00069 lightAttenuationMode,
00071 lightShadowMapProjection,
00073 lightShadowMapPixelSize,
00074
00076 _lightCount
00077 };
00078
00080 enum DefaultSV
00081 {
00083 varAmbient = 0,
00085 varLightCount,
00086
00088 _varCount
00089 };
00090 private:
00091 csRef<iShaderVarStringSet> strings;
00092 CS::ShaderVarStringID defaultVars[_varCount];
00093
00094 CS::ShaderVarStringID lightSVIdCache_unnumbered[_lightCount];
00095
00096 void ClearDefVars ();
00097 public:
00102 csLightShaderVarCache () { ClearDefVars (); }
00103
00108 void SetStrings (iShaderVarStringSet* strings);
00109
00118 CS::ShaderVarStringID GetLightSVId (LightProperty prop);
00119
00129 CS::ShaderVarStringID GetDefaultSVId (DefaultSV var);
00130 };
00131
00132 #endif // __CS_CSGFX_SHADER_LIGHTSVCACHE_H__