Pyrogenesis
trunk
|
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.
CLightEnv::CLightEnv | ( | ) |
|
private |
Compute the diffuse sun lighting factor on terrain, for rendering with shader lighting.
normal | normal vector (must have length 1) |
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) |
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) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void CLightEnv::SetElevation | ( | float | f | ) |
|
inline |
void CLightEnv::SetRotation | ( | float | f | ) |
|
friend |
|
friend |
|
friend |
float CLightEnv::m_Bloom |
float CLightEnv::m_Brightness |
float CLightEnv::m_Contrast |
|
private |
Height of sun above the horizon, in radians.
For example, an elevation of M_PI/2 means the sun is straight up.
RGBColor CLightEnv::m_FogColor |
float CLightEnv::m_FogFactor |
float CLightEnv::m_FogMax |
|
private |
A string that shaders use to determine what lighting model to implement.
Current recognised values are "old" and "standard".
|
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).
float CLightEnv::m_Saturation |
RGBColor CLightEnv::m_SunColor |
|
private |
Vector corresponding to m_Elevation and m_Rotation.
Updated by CalculateSunDirection.
RGBColor CLightEnv::m_TerrainAmbientColor |
RGBColor CLightEnv::m_UnitsAmbientColor |