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; };
IShader.h
ColorF m_BaseColor;
w component unused..
Matrix34 m_BaseObjMatrix;
Vec3 m_BaseOrigin;
World space position.
float m_BaseSpecMult;
Matrix34 m_ClipBox;
ColorF m_Color;
w component unused - todo pack spec mul into alpha (post c3 - touches quite some code)
float m_fAreaDiffuseSoftness;
float m_fAreaFov;
float m_fAreaHeight;
float m_fAreaWidth;
float m_fAttenuationBulbSize;
float m_fBaseRadius;
float m_fBoxHeight;
float m_fBoxLength;
float m_fBoxWidth;
float m_fHDRDynamic;
0 to get the same results in HDR, <0 to get darker, >0 to get brighter.
uint32 m_Flags;
light flags (DLF_etc).
float m_fLightFrustumAngle;
float m_fProjectorNearPlane;
float m_fRadius;
xyz= Origin, w=Radius. (Do not change order)
float m_fShadowBias;
float m_fShadowResolutionScale;
float m_fShadowSlopeBias;
float m_fShadowUpdateMinRadius;
float m_fTimeScrubbed;
int32 m_Id;
Commonly used on most code paths (64 bytes)
uint8 m_LensOpticsFrustumAngle;
from 0 to 255, The range will be adjusted from 0 to 360 when used.
uint32 m_n3DEngineUpdateFrameID;
uint8 m_nAnimSpeed;
uint8 m_nAttenFalloffMax;
uint32 m_nEntityId;
uint8 m_nLightPhase;
uint8 m_nLightStyle;
uint16 m_nShadowMinResolution;
uint16 m_nShadowUpdateRatio;
uint8 m_nSortPriority;
Matrix34 m_ObjMatrix;
Vec3 m_Origin;
World space position
IRenderMesh* m_pDeferredRenderMesh;
Arbitrary render mesh.
ITexture* m_pDiffuseCubemap;
Very small cubemap texture to make a lookup for diffuse.
IOpticsElementBase* m_pLensOpticsElement;
ILightAnimWrapper* m_pLightAnim;
ITexture* m_pLightAttenMap;
User can specify custom light attenuation gradient
IDynTextureSource* m_pLightDynTexSource;
can be used to project dynamic textures
ITexture* m_pLightImage;
CRenderObject * m_pObject[MAX_RECURSION_LEVELS];
Object for light coronas and light flares.
struct ILightSource* m_pOwner;
Shadow map fields
ITexture* m_pReflectionImage;
Vec3 m_ProbeExtents;
Matrix44 m_ProjMatrix;
ShadowMapFrustum** m_pShadowMapFrustums;
ISoftOcclusionQuery* m_pSoftOccQuery;
ITexture* m_pSpecularCubemap;
Cubemap texture to make a lookup for local specular.
const char* m_sDeferredGeom;
Optional deferred geom file
SShaderItem m_Shader;
uint8 m_ShadowChanMask : 4;
uint8 m_ShadowMaskIndex : 4;
int16 m_sHeight;
const char* m_sName;
Optional name of the light source.
float m_SpecMult;
int16 m_sWidth;
int16 m_sX;
Scissor parameters (2d extent).
int16 m_sY;
AABB m_vFadeAABB;
Compress if possible with final implementation
void AcquireResources();
void DropResources();
float GetAnimSpeed() const;
IRenderMesh * GetDeferredRenderMesh() const;
ITexture* GetDiffuseCubemap() const;
float GetFalloffMax() const;
IOpticsElementBase* GetLensOpticsElement() const;
ITexture* GetLightTexture() const;
void GetMemoryUsage(ICrySizer * pSizer) const;
const Vec3 & GetPosition() const;
ITexture* GetSpecularCubemap() const;
void SetAnimSpeed(float fAnimSpeed);
void SetFalloffMax(float fMax);
void SetLensOpticsElement(IOpticsElementBase* pOptics);
Use this instead of m_Color.
void SetLightColor(const ColorF & cColor);
void SetPosition(const Vec3& vPos);
SRenderLight();