![]() |
Public API 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. |
Helper to cache names of shader variables relevant to lighting.
Definition at line 37 of file lightsvcache.h.
Other generally useful shader variables that can be obtained.
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.
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.
|
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.
csLightShaderVarCache::csLightShaderVarCache | ( | ) | [inline] |
Construct an instance.
Definition at line 102 of file lightsvcache.h.
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.
var | Variable for which a name is to be retrieved. |
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.
prop | Light property for which a variable name is to be retrieved. |
void csLightShaderVarCache::SetStrings | ( | iShaderVarStringSet * | strings | ) |
Set the string set to query the name identifiers from.