SRenderLight

C++
struct SRenderLight {
  int32 m_Id;
  uint32 m_n3DEngineUpdateFrameID;
  uint32 m_nEntityId;
  uint32 m_Flags;
  Vec3 m_Origin;
  float m_fRadius;
  ColorF m_Color;
  float m_SpecMult;
  float m_fHDRDynamic;
  int16 m_sX;
  int16 m_sY;
  int16 m_sWidth;
  int16 m_sHeight;
  ITexture* m_pDiffuseCubemap;
  ITexture* m_pSpecularCubemap;
  Vec3 m_ProbeExtents;
  float m_fBoxWidth;
  float m_fBoxHeight;
  float m_fBoxLength;
  uint8 m_nAttenFalloffMax;
  uint8 m_nSortPriority;
  struct ILightSource* m_pOwner;
  ShadowMapFrustum** m_pShadowMapFrustums;
  float m_fShadowBias;
  float m_fShadowSlopeBias;
  float m_fShadowResolutionScale;
  float m_fShadowUpdateMinRadius;
  uint16 m_nShadowMinResolution;
  uint16 m_nShadowUpdateRatio;
  uint8 m_ShadowChanMask : 4;
  uint8 m_ShadowMaskIndex : 4;
  ITexture* m_pLightAttenMap;
  IDynTextureSource* m_pLightDynTexSource;
  ITexture* m_pLightImage;
  Matrix44 m_ProjMatrix;
  Matrix34 m_ObjMatrix;
  float m_fLightFrustumAngle;
  float m_fProjectorNearPlane;
  const char* m_sName;
  SShaderItem m_Shader;
  CRenderObject * m_pObject[MAX_RECURSION_LEVELS];
  IOpticsElementBase* m_pLensOpticsElement;
  ISoftOcclusionQuery* m_pSoftOccQuery;
  ITexture* m_pReflectionImage;
  IRenderMesh* m_pDeferredRenderMesh;
  const char* m_sDeferredGeom;
  ILightAnimWrapper* m_pLightAnim;
  Matrix34 m_ClipBox;
  AABB m_vFadeAABB;
  Matrix34 m_BaseObjMatrix;
  float m_fTimeScrubbed;
  Vec3 m_BaseOrigin;
  float m_fBaseRadius;
  ColorF m_BaseColor;
  float m_BaseSpecMult;
  float m_fAttenuationBulbSize;
  float m_fAreaDiffuseSoftness;
  float m_fAreaWidth;
  float m_fAreaHeight;
  float m_fAreaFov;
  uint8 m_nAnimSpeed;
  uint8 m_nLightStyle;
  uint8 m_nLightPhase;
  uint8 m_LensOpticsFrustumAngle;
};
File

IShader.h

SRenderLight::m_BaseColor Data Member
C++
ColorF m_BaseColor;
Description

w component unused..

SRenderLight::m_BaseObjMatrix Data Member
C++
Matrix34 m_BaseObjMatrix;
SRenderLight::m_BaseOrigin Data Member
C++
Vec3 m_BaseOrigin;
Description

World space position.

SRenderLight::m_BaseSpecMult Data Member
C++
float m_BaseSpecMult;
SRenderLight::m_ClipBox Data Member
C++
Matrix34 m_ClipBox;
SRenderLight::m_Color Data Member
C++
ColorF m_Color;
Description

w component unused - todo pack spec mul into alpha (post c3 - touches quite some code)

SRenderLight::m_fAreaDiffuseSoftness Data Member
C++
float m_fAreaDiffuseSoftness;
SRenderLight::m_fAreaFov Data Member
C++
float m_fAreaFov;
SRenderLight::m_fAreaHeight Data Member
C++
float m_fAreaHeight;
SRenderLight::m_fAreaWidth Data Member
C++
float m_fAreaWidth;
SRenderLight::m_fAttenuationBulbSize Data Member
C++
float m_fAttenuationBulbSize;
SRenderLight::m_fBaseRadius Data Member
C++
float m_fBaseRadius;
SRenderLight::m_fBoxHeight Data Member
C++
float m_fBoxHeight;
SRenderLight::m_fBoxLength Data Member
C++
float m_fBoxLength;
SRenderLight::m_fBoxWidth Data Member
C++
float m_fBoxWidth;
SRenderLight::m_fHDRDynamic Data Member
C++
float m_fHDRDynamic;
Description

0 to get the same results in HDR, <0 to get darker, >0 to get brighter.

SRenderLight::m_Flags Data Member
C++
uint32 m_Flags;
Description

light flags (DLF_etc).

SRenderLight::m_fLightFrustumAngle Data Member
C++
float m_fLightFrustumAngle;
SRenderLight::m_fProjectorNearPlane Data Member
C++
float m_fProjectorNearPlane;
SRenderLight::m_fRadius Data Member
C++
float m_fRadius;
Description

xyz= Origin, w=Radius. (Do not change order)

SRenderLight::m_fShadowBias Data Member
C++
float m_fShadowBias;
SRenderLight::m_fShadowResolutionScale Data Member
C++
float m_fShadowResolutionScale;
SRenderLight::m_fShadowSlopeBias Data Member
C++
float m_fShadowSlopeBias;
SRenderLight::m_fShadowUpdateMinRadius Data Member
C++
float m_fShadowUpdateMinRadius;
SRenderLight::m_fTimeScrubbed Data Member
C++
float m_fTimeScrubbed;
SRenderLight::m_Id Data Member
C++
int32 m_Id;
Description

Commonly used on most code paths (64 bytes)

SRenderLight::m_LensOpticsFrustumAngle Data Member
C++
uint8 m_LensOpticsFrustumAngle;
Description

from 0 to 255, The range will be adjusted from 0 to 360 when used.

SRenderLight::m_n3DEngineUpdateFrameID Data Member
C++
uint32 m_n3DEngineUpdateFrameID;
SRenderLight::m_nAnimSpeed Data Member
C++
uint8 m_nAnimSpeed;
SRenderLight::m_nAttenFalloffMax Data Member
C++
uint8 m_nAttenFalloffMax;
SRenderLight::m_nEntityId Data Member
C++
uint32 m_nEntityId;
SRenderLight::m_nLightPhase Data Member
C++
uint8 m_nLightPhase;
SRenderLight::m_nLightStyle Data Member
C++
uint8 m_nLightStyle;
SRenderLight::m_nShadowMinResolution Data Member
C++
uint16 m_nShadowMinResolution;
SRenderLight::m_nShadowUpdateRatio Data Member
C++
uint16 m_nShadowUpdateRatio;
SRenderLight::m_nSortPriority Data Member
C++
uint8 m_nSortPriority;
SRenderLight::m_ObjMatrix Data Member
C++
Matrix34 m_ObjMatrix;
SRenderLight::m_Origin Data Member
C++
Vec3 m_Origin;
Description

World space position

SRenderLight::m_pDeferredRenderMesh Data Member
C++
IRenderMesh* m_pDeferredRenderMesh;
Description

Arbitrary render mesh.

SRenderLight::m_pDiffuseCubemap Data Member
C++
ITexture* m_pDiffuseCubemap;
Description

Very small cubemap texture to make a lookup for diffuse.

SRenderLight::m_pLensOpticsElement Data Member
C++
IOpticsElementBase* m_pLensOpticsElement;
SRenderLight::m_pLightAnim Data Member
C++
ILightAnimWrapper* m_pLightAnim;
SRenderLight::m_pLightAttenMap Data Member
C++
ITexture* m_pLightAttenMap;
Description

User can specify custom light attenuation gradient

SRenderLight::m_pLightDynTexSource Data Member
C++
IDynTextureSource* m_pLightDynTexSource;
Description

can be used to project dynamic textures

SRenderLight::m_pLightImage Data Member
C++
ITexture* m_pLightImage;
SRenderLight::m_pObject Data Member
C++
Description

Object for light coronas and light flares.

SRenderLight::m_pOwner Data Member
C++
struct ILightSource* m_pOwner;
Description

Shadow map fields

SRenderLight::m_pReflectionImage Data Member
C++
ITexture* m_pReflectionImage;
SRenderLight::m_ProbeExtents Data Member
C++
Vec3 m_ProbeExtents;
SRenderLight::m_ProjMatrix Data Member
C++
Matrix44 m_ProjMatrix;
SRenderLight::m_pShadowMapFrustums Data Member
C++
ShadowMapFrustum** m_pShadowMapFrustums;
SRenderLight::m_pSoftOccQuery Data Member
C++
ISoftOcclusionQuery* m_pSoftOccQuery;
SRenderLight::m_pSpecularCubemap Data Member
C++
ITexture* m_pSpecularCubemap;
Description

Cubemap texture to make a lookup for local specular.

SRenderLight::m_sDeferredGeom Data Member
C++
const char* m_sDeferredGeom;
Description

Optional deferred geom file

SRenderLight::m_Shader Data Member
C++
SShaderItem m_Shader;
SRenderLight::m_ShadowChanMask Data Member
C++
uint8 m_ShadowChanMask : 4;
SRenderLight::m_ShadowMaskIndex Data Member
C++
uint8 m_ShadowMaskIndex : 4;
SRenderLight::m_sHeight Data Member
C++
int16 m_sHeight;
SRenderLight::m_sName Data Member
C++
const char* m_sName;
Description

Optional name of the light source.

SRenderLight::m_SpecMult Data Member
C++
float m_SpecMult;
SRenderLight::m_sWidth Data Member
C++
int16 m_sWidth;
SRenderLight::m_sX Data Member
C++
int16 m_sX;
Description

Scissor parameters (2d extent).

SRenderLight::m_sY Data Member
C++
int16 m_sY;
SRenderLight::m_vFadeAABB Data Member
C++
AABB m_vFadeAABB;
Todo

Compress if possible with final implementation

SRenderLight::AcquireResources Method
C++
void AcquireResources();
SRenderLight::DropResources Method
C++
void DropResources();
SRenderLight::GetAnimSpeed Method
C++
float GetAnimSpeed() const;
SRenderLight::GetDeferredRenderMesh Method
C++
IRenderMesh * GetDeferredRenderMesh() const;
SRenderLight::GetDiffuseCubemap Method
C++
ITexture* GetDiffuseCubemap() const;
SRenderLight::GetFalloffMax Method
C++
float GetFalloffMax() const;
SRenderLight::GetLensOpticsElement Method
C++
IOpticsElementBase* GetLensOpticsElement() const;
SRenderLight::GetLightTexture Method
C++
ITexture* GetLightTexture() const;
SRenderLight::GetMemoryUsage Method
C++
void GetMemoryUsage(ICrySizer * pSizer) const;
SRenderLight::GetPosition Method
C++
const Vec3 & GetPosition() const;
SRenderLight::GetSpecularCubemap Method
C++
ITexture* GetSpecularCubemap() const;
SRenderLight::SetAnimSpeed Method
C++
void SetAnimSpeed(float fAnimSpeed);
SRenderLight::SetFalloffMax Method
C++
void SetFalloffMax(float fMax);
SRenderLight::SetLensOpticsElement Method
C++
void SetLensOpticsElement(IOpticsElementBase* pOptics);
SRenderLight::SetLightColor Method

Use this instead of m_Color.

C++
void SetLightColor(const ColorF & cColor);
SRenderLight::SetPosition Method
C++
void SetPosition(const Vec3& vPos);
SRenderLight::SRenderLight Constructor
C++
SRenderLight();