LightManager
Engine/source/lighting/lightManager.h
Public Types
SpecialLightTypesEnum { slSunLightType slSpecialLightTypesCount }
Public Static Attributes
The light manager activation signal.
Protected Static Attributes
The current active light manager.
Protected Attributes
The scene lighting interfaces for lightmap generation.
A dummy default light used when no lights happen to be registered with the manager.
bool
Is true if this light manager has been activated.
The list of global registered lights which is initialized before the scene is rendered.
The scene graph the light manager is associated with.
mSpecialLights [slSpecialLightTypesCount]
The registered special light list.
Public Functions
LightManager(const char * name, const char * id)
activate(SceneManager * sceneManager)
getAllUnsortedLights(Vector< LightInfo * > * list)
Returns all unsorted and un-scored lights (both global and local).
const char *
getId()
Return an id string used to load different versions of light manager specific assets.
const char *
getName()
Return an id string used to load different versions of light manager specific assets.
getSpecialLight(SpecialLightTypesEnum type, bool useDefault)
Returns the special light or the default light if useDefault is true.
bool
isActive()
Returns true if this light manager is active.
bool
bool
lightScene(const char * callback, const char * param)
Called when the static scene lighting (aka lightmaps) should be computed.
registerGlobalLight(LightInfo * light, SimObject * obj)
registerGlobalLights(const Frustum * frustum, bool staticlighting, bool enableZoneLightCulling)
registerLocalLight(LightInfo * light)
setLightInfo(ProcessedMaterial * pmat, const Material * mat, const SceneData & sgData, const SceneRenderState * state, U32 pass, GFXShaderConstBuffer * shaderConsts)
Sets shader constants / textures for light infos.
setSpecialLight(SpecialLightTypesEnum type, LightInfo * light)
Set a special light type.
bool
setTextureStage(const SceneData & sgData, const U32 currTexFlag, const U32 textureSlot, GFXShaderConstBuffer * shaderConsts, ShaderConstHandles * handles)
Allows us to set textures during the Material::setTextureStage call, return true if we've done work.
unregisterGlobalLight(LightInfo * light)
unregisterLocalLight(LightInfo * light)
Public Static Functions
createLightInfo(LightInfo * light)
findByName(const char * name)
Returns the active LM.
getLightManagerNames(String * outString)
Returns a tab seperated list of available light managers.
Protected Functions
_addLightInfoEx(LightInfo * lightInfo)
Attaches any LightInfoEx data for this manager to the light info object.
Find the pre-pass render bin on the scene's default render pass.
Protected Static Functions
Returns the static light manager map.
_update4LightConsts(const SceneData & sgData, GFXShaderConstHandle * lightPositionSC, GFXShaderConstHandle * lightDiffuseSC, GFXShaderConstHandle * lightAmbientSC, GFXShaderConstHandle * lightInvRadiusSqSC, GFXShaderConstHandle * lightSpotDirSC, GFXShaderConstHandle * lightSpotParamsSC, GFXShaderConstHandle * hasVectorLightSC, GFXShaderConstHandle * vectorLightDirectionSC, GFXShaderConstHandle * vectorLightColorSC, GFXShaderConstHandle * vectorLightBrightnessSC, GFXShaderConstBuffer * shaderConsts)
This helper function sets the shader constansts for the stock 4 light forward lighting code.
Detailed Description
Public Types
SpecialLightTypesEnum
Enumerator
- slSunLightType
- slSpecialLightTypesCount
Public Static Attributes
Signal< void(const char *, bool)> smActivateSignal
The light manager activation signal.
Protected Static Attributes
LightManager * smActiveLM
The current active light manager.
Protected Attributes
AvailableSLInterfaces * mAvailableSLInterfaces
The scene lighting interfaces for lightmap generation.
Point3F mCullPos
The root culling position used for special sun light placement.
LightInfo * mDefaultLight
A dummy default light used when no lights happen to be registered with the manager.
const String mId
The constant light manager identifier initialized in the constructor.
bool mIsActive
Is true if this light manager has been activated.
const String mName
The constant light manager name initialized in the constructor.
LightInfoList mRegisteredLights
The list of global registered lights which is initialized before the scene is rendered.
SceneManager * mSceneManager
The scene graph the light manager is associated with.
LightInfo * mSpecialLights [slSpecialLightTypesCount]
The registered special light list.
Public Functions
LightManager(const char * name, const char * id)
~LightManager()
activate(SceneManager * sceneManager)
Reimplemented by: AdvancedLightManager, BasicLightManager
deactivate()
Reimplemented by: AdvancedLightManager, BasicLightManager
getAllUnsortedLights(Vector< LightInfo * > * list)
Returns all unsorted and un-scored lights (both global and local).
getDefaultLight()
getId()
Return an id string used to load different versions of light manager specific assets.
It shoud be short, contain no spaces, and be safe for filename use.
getName()
Return an id string used to load different versions of light manager specific assets.
It shoud be short, contain no spaces, and be safe for filename use.
getSceneLightingInterface()
getSceneManager()
getSpecialLight(SpecialLightTypesEnum type, bool useDefault)
Returns the special light or the default light if useDefault is true.
isActive()
Returns true if this light manager is active.
isCompatible()
Reimplemented by: AdvancedLightManager, BasicLightManager
lightScene(const char * callback, const char * param)
Called when the static scene lighting (aka lightmaps) should be computed.
registerGlobalLight(LightInfo * light, SimObject * obj)
Reimplemented by: AdvancedLightManager
registerGlobalLights(const Frustum * frustum, bool staticlighting, bool enableZoneLightCulling)
registerLocalLight(LightInfo * light)
setLightInfo(ProcessedMaterial * pmat, const Material * mat, const SceneData & sgData, const SceneRenderState * state, U32 pass, GFXShaderConstBuffer * shaderConsts)
Sets shader constants / textures for light infos.
Reimplemented by: AdvancedLightManager, BasicLightManager
setSpecialLight(SpecialLightTypesEnum type, LightInfo * light)
Set a special light type.
setTextureStage(const SceneData & sgData, const U32 currTexFlag, const U32 textureSlot, GFXShaderConstBuffer * shaderConsts, ShaderConstHandles * handles)
Allows us to set textures during the Material::setTextureStage call, return true if we've done work.
Reimplemented by: AdvancedLightManager, BasicLightManager
unregisterAllLights()
Reimplemented by: AdvancedLightManager
unregisterGlobalLight(LightInfo * light)
unregisterLocalLight(LightInfo * light)
Public Static Functions
createLightInfo(LightInfo * light)
findByName(const char * name)
getActiveLM()
Returns the active LM.
getLightManagerNames(String * outString)
Returns a tab seperated list of available light managers.
initLightFields()
Protected Functions
_addLightInfoEx(LightInfo * lightInfo)
Attaches any LightInfoEx data for this manager to the light info object.
Reimplemented by: AdvancedLightManager, BasicLightManager
_findDeferredRenderBin()
Find the pre-pass render bin on the scene's default render pass.
_initLightFields()
Reimplemented by: AdvancedLightManager, BasicLightManager
Protected Static Functions
_getLightManagers()
Returns the static light manager map.
_update4LightConsts(const SceneData & sgData, GFXShaderConstHandle * lightPositionSC, GFXShaderConstHandle * lightDiffuseSC, GFXShaderConstHandle * lightAmbientSC, GFXShaderConstHandle * lightInvRadiusSqSC, GFXShaderConstHandle * lightSpotDirSC, GFXShaderConstHandle * lightSpotParamsSC, GFXShaderConstHandle * hasVectorLightSC, GFXShaderConstHandle * vectorLightDirectionSC, GFXShaderConstHandle * vectorLightColorSC, GFXShaderConstHandle * vectorLightBrightnessSC, GFXShaderConstBuffer * shaderConsts)
This helper function sets the shader constansts for the stock 4 light forward lighting code.