sgLightManager Class Reference

#include <sgLightManager.h>

Inheritance diagram for sgLightManager:

Inheritance graph
[legend]
List of all members.

Public Types

 lpqtProduction = 0
 lpqtDesign = 1
 lpqtDraft = 2
 sgReceiveSunLightProp
 sgAdaptiveSelfIlluminationProp
 sgCustomAmbientLightingProp
 sgCustomAmbientForSelfIlluminationProp
 sgPropertyCount
enum  lightingProfileQualityType {
  lpqtProduction = 0,
  lpqtDesign = 1,
  lpqtDraft = 2
}
enum  sgLightingPropertiesEnum {
  sgReceiveSunLightProp,
  sgAdaptiveSelfIlluminationProp,
  sgCustomAmbientLightingProp,
  sgCustomAmbientForSelfIlluminationProp,
  sgPropertyCount
}

Public Member Functions

 sgLightManager ()
virtual ~sgLightManager ()
AvailableSLInterfacesgetLightingInterfaces ()
virtual void activate ()
virtual void deactivate ()
virtual const char * getId () const
virtual AvailableSLInterfacesgetSceneLightingInterface ()
virtual LightInfocreateLightInfo ()
virtual LightInfogetDefaultLight ()
sgLightInfocreateSGLightInfo ()
void registerGlobalLight (LightInfo *light, SimObject *obj, bool zonealreadyset)
void unregisterGlobalLight (LightInfo *light)
void registerLocalLight (LightInfo *light)
void unregisterLocalLight (LightInfo *light)
void registerGlobalLights (bool staticlighting)
void unregisterAllLights ()
void getAllUnsortedLights (LightInfoList &list)
 Returns all unsorted and un-scored lights (both global and local).
void getBestLights (LightInfoList &list)
 Copies the best lights list - this DOESN'T find the lights! Call setupLights to populate the list.
void sgBuildDualLightLists (const LightInfoList &list, LightInfoDualList &listdual)
 Accepts a pre-filtered list instead of using the best lights list so interiors can filter lights against zones and then build the the dual list.
void setupLights (SceneObject *obj)
 For DST objects.
void setupLights (SceneObject *obj, const Point3F &camerapos, const Point3F &cameradir, F32 viewdist, S32 maxlights)
 For the terrain and Atlas.
void setupLights (SceneObject *obj, const Box3F &box, S32 maxlights)
 Finds the best lights that overlap with the bounding box based on the box center.
void resetLights ()
 Reset the best lights list and all associated data.
virtual void setLightInfo (ProcessedMaterial *pmat, const Material *mat, const SceneGraphData &sgData, U32 pass, GFXShaderConstBuffer *shaderConsts)
 Sets shader constants / textures for light infos.
virtual bool initTextureStateBlock (const U32 currTexFlag, const U32 textureSlot, GFXStateBlockDesc *stateblock)
 Allows us to setup texture states, return true if we've done work.
virtual bool setTextureStage (const SceneGraphData &sgData, const U32 currTexFlag, const U32 textureSlot, GFXShaderConstBuffer *shaderConsts, ShaderConstHandles *handles)
 Allows us to set textures during the Material::setTextureStage call.
virtual sgMatInstancegetDynamicLightingMaterial (BaseMatInstance *root, sgLightInfo *light, bool tryfordual)
 Gets the dynamic lighting material for root+light combo.
virtual bool lightScene (const char *callback, const char *param)
LightInfosgGetDefaultLight ()
LightInfogetSpecialLight (SpecialLightTypesEnum type)
void setSpecialLight (SpecialLightTypesEnum type, LightInfo *light)
void sgSetupZoneLighting (bool enable, SimObject *sobj)
virtual void hdrPrepare (const Point2I &offset, const Point2I &extent)
virtual void hdrRender ()

Static Public Member Functions

static sgLightManagerget ()
static void cleanup ()
template<class T>
static void sgSafeSet (GFXShaderConstBuffer *shaderConsts, const String &name, T value)
static bool sgGetProperty (U32 prop)
static void sgSetProperty (U32 prop, bool val)
static bool sgAllowDiffuseCustomAmbient ()
static bool sgAllowAdaptiveSelfIllumination ()
static bool sgAllowCollectSelfIlluminationColor ()
static bool sgAllowReceiveSunLight ()
static bool sgAllowDynamicShadows ()
static U32 sgGetDynamicShadowQuality ()
static bool sgAllowDynamicLightingDualOptimization ()
static bool sgAllowDRLSystem ()
static bool sgAllowFullDynamicRangeLighting ()
static bool sgAllowFullHighDynamicRangeLighting ()
static bool sgAllowBloom ()
static bool sgAllowToneMapping ()
static ColorF sgGetSelfIlluminationColor (ColorF defaultcol)
static void sgSetAllowDynamicRangeLighting (bool enable)
static void sgSetAllowHighDynamicRangeLighting (bool enable)
static void sgSetAllowDRLBloom (bool enable)
static void sgSetAllowDRLToneMapping (bool enable)
static void sgInit ()
static bool sgAllowShadows ()
static bool sgAllowFullLightMaps ()
static U32 sgGetLightMapScale ()
static void sgGetFilteredLightColor (ColorF &color, ColorF &ambient, S32 objectzone)

Public Attributes

Signal< void(bool)> mSgActivate
sgDRLSystem drlSystem

Static Public Attributes

static U32 sgDynamicShadowDetailSize
static bool sgMultipleDynamicShadows
static bool sgShowCacheStats
static F32 sgDRLTarget
static F32 sgDRLMax
static F32 sgDRLMin
static F32 sgDRLMultiplier
static F32 sgBloomCutOff
static F32 sgBloomAmount
static F32 sgBloomSeedAmount
static U32 sgAtlasMaxDynamicLights

Private Types

typedef LightManager Parent

Private Member Functions

void sgFindBestLights (const Box3F &box, S32 maxlights, const Point3F &viewdir, bool camerabased)
void sgScoreLight (sgLightInfo *light, const Box3F &box, const SphereF &sphere, bool camerabased)
bool getLightingAmbientColor (SceneObject *obj, ColorF *col, sgLightInfo **light)

Static Private Member Functions

static S32 QSORT_CALLBACK sgSortLightsByAddress (const void *, const void *)
static S32 QSORT_CALLBACK sgSortLightsByScore (const void *, const void *)

Private Attributes

SceneLightingmSceneLighting
AvailableSLInterfacesmLightingInterfaces
sgLightInfosgSpecialLights [slSpecialLightTypesCount]
sgLightInfosgTranslatedSun
LightInfoList sgRegisteredGlobalLights
LightInfoList sgRegisteredLocalLights
LightInfoList sgBestLights

Static Private Attributes

static sgLightManagersmsgLightManagerSingleton
static bool sgLightingProperties [sgPropertyCount]
static U32 sgLightingProfileQuality
static bool sgLightingProfileAllowShadows
static LightInfosgDefaultLight
static bool sgUseDynamicShadows
static U32 sgDynamicShadowQuality
static bool sgUseDynamicLightingDualOptimization
static bool sgUseSelfIlluminationColor
static ColorF sgSelfIlluminationColor
static bool sgFilterZones
static S32 sgZones [2]
static S32 sgMaxBestLights
static bool sgInGUIEditor
static bool sgUseDynamicRangeLighting
static bool sgUseDRLHighDynamicRange
static bool sgAllowDynamicRangeLighting
static bool sgAllowDRLHighDynamicRange
static bool sgAllowDRLBloom
static bool sgAllowDRLToneMapping

Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
lpqtProduction 
lpqtDesign 
lpqtDraft 

Enumerator:
sgReceiveSunLightProp 
sgAdaptiveSelfIlluminationProp 
sgCustomAmbientLightingProp 
sgCustomAmbientForSelfIlluminationProp 
sgPropertyCount 


Constructor & Destructor Documentation

sgLightManager::sgLightManager (  ) 

virtual sgLightManager::~sgLightManager (  )  [virtual]


Member Function Documentation

AvailableSLInterfaces* sgLightManager::getLightingInterfaces (  ) 

static sgLightManager* sgLightManager::get (  )  [inline, static]

static void sgLightManager::cleanup (  )  [inline, static]

virtual void sgLightManager::activate (  )  [virtual]

Reimplemented from LightManager.

virtual void sgLightManager::deactivate (  )  [virtual]

Reimplemented from LightManager.

virtual const char* sgLightManager::getId (  )  const [virtual]

Implements LightManager.

virtual AvailableSLInterfaces* sgLightManager::getSceneLightingInterface (  )  [virtual]

Implements LightManager.

virtual LightInfo* sgLightManager::createLightInfo (  )  [virtual]

Implements LightManager.

virtual LightInfo* sgLightManager::getDefaultLight (  )  [virtual]

Implements LightManager.

sgLightInfo* sgLightManager::createSGLightInfo (  ) 

void sgLightManager::registerGlobalLight ( LightInfo light,
SimObject obj,
bool  zonealreadyset 
) [virtual]

Implements LightManager.

void sgLightManager::unregisterGlobalLight ( LightInfo light  )  [inline, virtual]

Implements LightManager.

void sgLightManager::registerLocalLight ( LightInfo light  )  [inline, virtual]

Implements LightManager.

void sgLightManager::unregisterLocalLight ( LightInfo light  )  [inline, virtual]

Implements LightManager.

void sgLightManager::registerGlobalLights ( bool  staticlighting  )  [virtual]

Implements LightManager.

void sgLightManager::unregisterAllLights (  )  [virtual]

Implements LightManager.

void sgLightManager::getAllUnsortedLights ( LightInfoList list  )  [virtual]

Returns all unsorted and un-scored lights (both global and local).

Implements LightManager.

void sgLightManager::getBestLights ( LightInfoList list  )  [inline, virtual]

Copies the best lights list - this DOESN'T find the lights! Call setupLights to populate the list.

Implements LightManager.

void sgLightManager::sgBuildDualLightLists ( const LightInfoList list,
LightInfoDualList listdual 
)

Accepts a pre-filtered list instead of using the best lights list so interiors can filter lights against zones and then build the the dual list.

..

void sgLightManager::setupLights ( SceneObject obj  )  [virtual]

For DST objects.

Finds the best lights including a composite based on the environmental ambient lighting amount *and installs them in OpenGL*.

Implements LightManager.

void sgLightManager::setupLights ( SceneObject obj,
const Point3F camerapos,
const Point3F cameradir,
F32  viewdist,
S32  maxlights 
) [virtual]

For the terrain and Atlas.

Finds the best lights in the viewing area based on distance to camera.

Implements LightManager.

void sgLightManager::setupLights ( SceneObject obj,
const Box3F box,
S32  maxlights 
) [virtual]

Finds the best lights that overlap with the bounding box based on the box center.

Implements LightManager.

void sgLightManager::resetLights (  )  [virtual]

Reset the best lights list and all associated data.

Implements LightManager.

virtual void sgLightManager::setLightInfo ( ProcessedMaterial pmat,
const Material mat,
const SceneGraphData sgData,
U32  pass,
GFXShaderConstBuffer shaderConsts 
) [virtual]

Sets shader constants / textures for light infos.

Implements LightManager.

virtual bool sgLightManager::initTextureStateBlock ( const U32  currTexFlag,
const U32  textureSlot,
GFXStateBlockDesc stateblock 
) [virtual]

Allows us to setup texture states, return true if we've done work.

Implements LightManager.

virtual bool sgLightManager::setTextureStage ( const SceneGraphData sgData,
const U32  currTexFlag,
const U32  textureSlot,
GFXShaderConstBuffer shaderConsts,
ShaderConstHandles handles 
) [virtual]

Allows us to set textures during the Material::setTextureStage call.

Implements LightManager.

virtual sgMatInstance* sgLightManager::getDynamicLightingMaterial ( BaseMatInstance root,
sgLightInfo light,
bool  tryfordual 
) [virtual]

Gets the dynamic lighting material for root+light combo.

virtual bool sgLightManager::lightScene ( const char *  callback,
const char *  param 
) [virtual]

Reimplemented from LightManager.

template<class T>
static void sgLightManager::sgSafeSet ( GFXShaderConstBuffer shaderConsts,
const String name,
value 
) [static]

LightInfo* sgLightManager::sgGetDefaultLight (  )  [inline]

LightInfo* sgLightManager::getSpecialLight ( SpecialLightTypesEnum  type  ) 

void sgLightManager::setSpecialLight ( SpecialLightTypesEnum  type,
LightInfo light 
)

void sgLightManager::sgFindBestLights ( const Box3F box,
S32  maxlights,
const Point3F viewdir,
bool  camerabased 
) [private]

void sgLightManager::sgScoreLight ( sgLightInfo light,
const Box3F box,
const SphereF sphere,
bool  camerabased 
) [private]

static bool sgLightManager::sgGetProperty ( U32  prop  )  [inline, static]

static void sgLightManager::sgSetProperty ( U32  prop,
bool  val 
) [inline, static]

static bool sgLightManager::sgAllowDiffuseCustomAmbient (  )  [inline, static]

static bool sgLightManager::sgAllowAdaptiveSelfIllumination (  )  [inline, static]

static bool sgLightManager::sgAllowCollectSelfIlluminationColor (  )  [inline, static]

static bool sgLightManager::sgAllowReceiveSunLight (  )  [inline, static]

static bool sgLightManager::sgAllowDynamicShadows (  )  [inline, static]

static U32 sgLightManager::sgGetDynamicShadowQuality (  )  [inline, static]

static bool sgLightManager::sgAllowDynamicLightingDualOptimization (  )  [inline, static]

static bool sgLightManager::sgAllowDRLSystem (  )  [inline, static]

static bool sgLightManager::sgAllowFullDynamicRangeLighting (  )  [inline, static]

static bool sgLightManager::sgAllowFullHighDynamicRangeLighting (  )  [inline, static]

static bool sgLightManager::sgAllowBloom (  )  [inline, static]

static bool sgLightManager::sgAllowToneMapping (  )  [inline, static]

static ColorF sgLightManager::sgGetSelfIlluminationColor ( ColorF  defaultcol  )  [inline, static]

static void sgLightManager::sgSetAllowDynamicRangeLighting ( bool  enable  )  [inline, static]

static void sgLightManager::sgSetAllowHighDynamicRangeLighting ( bool  enable  )  [inline, static]

static void sgLightManager::sgSetAllowDRLBloom ( bool  enable  )  [inline, static]

static void sgLightManager::sgSetAllowDRLToneMapping ( bool  enable  )  [inline, static]

static void sgLightManager::sgInit (  )  [static]

static bool sgLightManager::sgAllowShadows (  )  [inline, static]

static bool sgLightManager::sgAllowFullLightMaps (  )  [inline, static]

static U32 sgLightManager::sgGetLightMapScale (  )  [inline, static]

static void sgLightManager::sgGetFilteredLightColor ( ColorF color,
ColorF ambient,
S32  objectzone 
) [static]

void sgLightManager::sgSetupZoneLighting ( bool  enable,
SimObject sobj 
)

virtual void sgLightManager::hdrPrepare ( const Point2I offset,
const Point2I extent 
) [inline, virtual]

Implements LightManager.

virtual void sgLightManager::hdrRender (  )  [inline, virtual]

Implements LightManager.

static S32 QSORT_CALLBACK sgLightManager::sgSortLightsByAddress ( const void ,
const void  
) [static, private]

static S32 QSORT_CALLBACK sgLightManager::sgSortLightsByScore ( const void ,
const void  
) [static, private]

bool sgLightManager::getLightingAmbientColor ( SceneObject obj,
ColorF col,
sgLightInfo **  light 
) [private]


Member Data Documentation

sgLightInfo* sgLightManager::sgSpecialLights[slSpecialLightTypesCount] [private]

bool sgLightManager::sgLightingProperties[sgPropertyCount] [static, private]

S32 sgLightManager::sgZones[2] [static, private]