Pyrogenesis
13997
|
Class CLightEnv: description of a lighting environment - contains all the necessary parameters for representation of the lighting within a scenario. More...
#include <LightEnv.h>
Public Member Functions | |
CLightEnv () | |
float | GetElevation () const |
float | GetRotation () const |
const CVector3D & | GetSunDir () const |
const std::string & | GetLightingModel () const |
void | SetElevation (float f) |
void | SetRotation (float f) |
void | SetLightingModel (const std::string &model) |
RGBColor | EvaluateUnitScaled (const CVector3D &normal) const |
Calculate brightness of a point of a unit with the given normal vector, for rendering with CPU lighting. More... | |
SColor4ub | EvaluateTerrainDiffuseScaled (const CVector3D &normal) const |
Compute the diffuse sun lighting color on terrain, for rendering with CPU lighting. More... | |
SColor4ub | EvaluateTerrainDiffuseFactor (const CVector3D &normal) const |
Compute the diffuse sun lighting factor on terrain, for rendering with shader lighting. More... | |
bool | operator== (const CLightEnv &o) const |
bool | operator!= (const CLightEnv &o) const |
Public Attributes | |
RGBColor | m_SunColor |
RGBColor | m_TerrainAmbientColor |
RGBColor | m_UnitsAmbientColor |
RGBColor | m_FogColor |
float | m_FogFactor |
float | m_FogMax |
float | m_Brightness |
float | m_Contrast |
float | m_Saturation |
float | m_Bloom |
Private Member Functions | |
void | CalculateSunDirection () |
Private Attributes | |
float | m_Elevation |
Height of sun above the horizon, in radians. More... | |
float | m_Rotation |
Direction of sun on the compass, in radians. More... | |
CVector3D | m_SunDir |
Vector corresponding to m_Elevation and m_Rotation. More... | |
std::string | m_LightingModel |
A string that shaders use to determine what lighting model to implement. More... | |
Friends | |
class | CMapWriter |
class | CMapReader |
class | CXMLReader |
Class CLightEnv: description of a lighting environment - contains all the necessary parameters for representation of the lighting within a scenario.
Definition at line 36 of file LightEnv.h.
CLightEnv::CLightEnv | ( | ) |
Definition at line 29 of file LightEnv.cpp.
|
private |
Definition at line 56 of file LightEnv.cpp.
Compute the diffuse sun lighting factor on terrain, for rendering with shader lighting.
normal | normal vector (must have length 1) |
Definition at line 128 of file LightEnv.h.
Compute the diffuse sun lighting color on terrain, for rendering with CPU lighting.
To cope with sun overbrightness, the color is scaled by 0.5.
normal | normal vector (must have length 1) |
Definition at line 117 of file LightEnv.h.
Calculate brightness of a point of a unit with the given normal vector, for rendering with CPU lighting.
The resulting color contains both ambient and diffuse light. To cope with sun overbrightness, the color is scaled by 0.5.
normal | normal vector (must have length 1) |
Definition at line 100 of file LightEnv.h.
|
inline |
Definition at line 82 of file LightEnv.h.
|
inline |
Definition at line 85 of file LightEnv.h.
|
inline |
Definition at line 83 of file LightEnv.h.
|
inline |
Definition at line 84 of file LightEnv.h.
|
inline |
Definition at line 153 of file LightEnv.h.
|
inline |
Definition at line 136 of file LightEnv.h.
void CLightEnv::SetElevation | ( | float | f | ) |
Definition at line 44 of file LightEnv.cpp.
|
inline |
Definition at line 90 of file LightEnv.h.
void CLightEnv::SetRotation | ( | float | f | ) |
Definition at line 50 of file LightEnv.cpp.
|
friend |
Definition at line 39 of file LightEnv.h.
|
friend |
Definition at line 38 of file LightEnv.h.
|
friend |
Definition at line 40 of file LightEnv.h.
float CLightEnv::m_Bloom |
Definition at line 77 of file LightEnv.h.
float CLightEnv::m_Brightness |
Definition at line 77 of file LightEnv.h.
float CLightEnv::m_Contrast |
Definition at line 77 of file LightEnv.h.
|
private |
Height of sun above the horizon, in radians.
For example, an elevation of M_PI/2 means the sun is straight up.
Definition at line 46 of file LightEnv.h.
RGBColor CLightEnv::m_FogColor |
Definition at line 72 of file LightEnv.h.
float CLightEnv::m_FogFactor |
Definition at line 74 of file LightEnv.h.
float CLightEnv::m_FogMax |
Definition at line 75 of file LightEnv.h.
|
private |
A string that shaders use to determine what lighting model to implement.
Current recognised values are "old" and "standard".
Definition at line 66 of file LightEnv.h.
|
private |
Direction of sun on the compass, in radians.
For example, a rotation of zero means the sun is in the direction (0,0,-1) and a rotation of M_PI/2 means the sun is in the direction (1,0,0) (not taking elevation into account).
Definition at line 54 of file LightEnv.h.
float CLightEnv::m_Saturation |
Definition at line 77 of file LightEnv.h.
RGBColor CLightEnv::m_SunColor |
Definition at line 69 of file LightEnv.h.
|
private |
Vector corresponding to m_Elevation and m_Rotation.
Updated by CalculateSunDirection.
Definition at line 60 of file LightEnv.h.
RGBColor CLightEnv::m_TerrainAmbientColor |
Definition at line 70 of file LightEnv.h.
RGBColor CLightEnv::m_UnitsAmbientColor |
Definition at line 71 of file LightEnv.h.