csLightShaderVarCache Class Reference
Helper to cache names of shader variables relevant to lighting. More...
#include <csgfx/lightsvcache.h>
Public Types | |
enum | DefaultSV { varAmbient = 0, varLightCount, _varCount } |
Other generally useful shader variables that can be obtained. More... | |
enum | LightProperty { lightDiffuse = 0, lightSpecular, lightPositionWorld, lightTransformWorld, lightTransformWorldInverse, lightAttenuation, lightAttenuationTex, lightDirectionWorld, lightInnerFalloff, lightOuterFalloff, lightType, lightAttenuationMode, lightShadowMapProjection, lightShadowMapPixelSize, _lightCount } |
Properties of lights for which shader variables are known. More... | |
Public Member Functions | |
csLightShaderVarCache () | |
Construct an instance. | |
CS::ShaderVarStringID | GetDefaultSVId (DefaultSV var) |
Obtain the name for for a lighting-relevant shader variable whose name does not depend on the number of a light. | |
CS::ShaderVarStringID | GetLightSVId (LightProperty prop) |
Obtain the name for for a lighting-relevant shader variable. | |
void | SetStrings (iShaderVarStringSet *strings) |
Set the string set to query the name identifiers from. |
Detailed Description
Helper to cache names of shader variables relevant to lighting.
Definition at line 37 of file lightsvcache.h.
Member Enumeration Documentation
Other generally useful shader variables that can be obtained.
- Enumerator:
varAmbient "light ambient"
varLightCount "light count"
_varCount Number of other variables.
Definition at line 80 of file lightsvcache.h.
Properties of lights for which shader variables are known.
- Enumerator:
lightDiffuse Diffuse color.
lightSpecular Specular color.
lightPositionWorld Position (world space).
lightTransformWorld Transform (from light to world space).
lightTransformWorldInverse Inverse transform (from world to light space).
lightAttenuation Attenuation vector.
lightAttenuationTex Attenuation texture.
- Deprecated:
- Deprecated in 1.3.
lightDirectionWorld Direction (world space).
lightInnerFalloff Spot inner falloff.
lightOuterFalloff Spot outer falloff.
lightType Light type (csLightType casted to int).
lightAttenuationMode Attenuation mode (csLightAttenuationMode casted to int).
lightShadowMapProjection Shadow map projection matrix.
lightShadowMapPixelSize Shadow map pixel sizes + dimensions.
_lightCount Number of properties.
Definition at line 41 of file lightsvcache.h.
Constructor & Destructor Documentation
csLightShaderVarCache::csLightShaderVarCache | ( | ) | [inline] |
Construct an instance.
- Remarks:
- The instance is only useable after a call to SetStrings().
Definition at line 102 of file lightsvcache.h.
Member Function Documentation
CS::ShaderVarStringID csLightShaderVarCache::GetDefaultSVId | ( | DefaultSV | var | ) |
Obtain the name for for a lighting-relevant shader variable whose name does not depend on the number of a light.
A caching scheme is used to avoid having to re-request a name from the given string set every time one is needed.
- Parameters:
-
var Variable for which a name is to be retrieved.
- Returns:
- Name of the relevant variable, csInvalidStringID in case of an error.
CS::ShaderVarStringID csLightShaderVarCache::GetLightSVId | ( | LightProperty | prop | ) |
Obtain the name for for a lighting-relevant shader variable.
A caching scheme is used to avoid having to re-request a name from the given string set every time one is needed.
- Parameters:
-
prop Light property for which a variable name is to be retrieved.
- Returns:
- Name of the relevant variable, csInvalidStringID in case of an error.
void csLightShaderVarCache::SetStrings | ( | iShaderVarStringSet * | strings | ) |
Set the string set to query the name identifiers from.
- Remarks:
- Changing the string set will clear the cached names.
The documentation for this class was generated from the following file:
- csgfx/lightsvcache.h
Generated for Crystal Space 2.0 by doxygen 1.6.1