Pyrogenesis  trunk
Public Member Functions | Public Attributes | List of all members
WaterManager Class Reference

Class WaterManager: Maintain rendering-related water settings and textures Anything that affects gameplay should go in CcmpWaterManager.cpp and passed to this (possibly as copy). More...

#include <WaterManager.h>

Collaboration diagram for WaterManager:
Collaboration graph
[legend]

Public Member Functions

 WaterManager ()
 
 ~WaterManager ()
 
int LoadWaterTextures ()
 LoadWaterTextures: Load water textures from within the progressive load framework. More...
 
void Resize ()
 Resize: Updates the fancy water textures so that water will render correctly with fancy water. More...
 
void ReloadWaterNormalTextures ()
 ReloadWaterNormalTextures: Reload the normal textures so that changing water type in Atlas will actually do the right thing. More...
 
void UnloadWaterTextures ()
 UnloadWaterTextures: Free any loaded water textures and reset the internal state so that another call to LoadWaterTextures will begin progressive loading. More...
 
void RecomputeWindStrength ()
 RecomputeWindStrength: calculates the intensity of waves. More...
 
void RecomputeDistanceHeightmap ()
 RecomputeDistanceHeightmap: recalculates (or calculates) the distance heightmap. More...
 
void RecomputeBlurredNormalMap ()
 RecomputeBlurredNormalMap: calculates the blurred normal map of the terrain. More...
 
void CreateWaveMeshes ()
 CreateWaveMeshes: Creates the waves objects (and meshes). More...
 
void SetMapSize (size_t size)
 Updates the map size. More...
 
void UpdateQuality ()
 Updates the settings to the one from the renderer, and sets m_NeedsReloading. More...
 
bool WillRenderFancyWater ()
 Returns true if fancy water shaders will be used (i.e. More...
 
void RenderWaves (const CFrustum &frustrum)
 

Public Attributes

CTexturePtr m_WaterTexture [60]
 
CTexturePtr m_NormalMap [60]
 
float * m_WindStrength
 
float * m_DistanceHeightmap
 
CVector3Dm_BlurredNormalMap
 
std::vector< WaveObject * > m_ShoreWaves
 
CVertexBuffer::VBChunkm_ShoreWaves_VBIndices
 
size_t m_MapSize
 
ssize_t m_TexSize
 
CTexturePtr m_WaveTex
 
CTexturePtr m_FoamTex
 
GLuint m_depthTT
 
GLuint m_FancyTextureNormal
 
GLuint m_FancyTextureOther
 
GLuint m_FancyTextureDepth
 
GLuint m_ReflFboDepthTexture
 
GLuint m_RefrFboDepthTexture
 
u32 m_updatei0
 
u32 m_updatej0
 
u32 m_updatei1
 
u32 m_updatej1
 
int m_WaterCurrentTex
 
bool m_RenderWater
 
bool m_WaterUgly
 
bool m_WaterRealDepth
 
bool m_WaterFancyEffects
 
bool m_WaterRefraction
 
bool m_WaterReflection
 
bool m_WaterShadows
 
bool m_NeedsReloading
 
bool m_NeedInfoUpdate
 
float m_WaterHeight
 
double m_WaterTexTimer
 
float m_RepeatPeriod
 
GLuint m_ReflectionTexture
 
GLuint m_RefractionTexture
 
size_t m_RefTextureSize
 
GLuint m_RefractionFbo
 
GLuint m_ReflectionFbo
 
GLuint m_FancyEffectsFBO
 
CMatrix3D m_ReflectionMatrix
 
CMatrix3D m_RefractionMatrix
 
std::wstring m_WaterType
 
CColor m_WaterColor
 
CColor m_WaterTint
 
float m_Waviness
 
float m_Murkiness
 
float m_WindAngle
 

Detailed Description

Class WaterManager: Maintain rendering-related water settings and textures Anything that affects gameplay should go in CcmpWaterManager.cpp and passed to this (possibly as copy).

Constructor & Destructor Documentation

WaterManager::WaterManager ( )
WaterManager::~WaterManager ( )

Member Function Documentation

void WaterManager::CreateWaveMeshes ( )

CreateWaveMeshes: Creates the waves objects (and meshes).

int WaterManager::LoadWaterTextures ( )

LoadWaterTextures: Load water textures from within the progressive load framework.

Returns
0 if loading has completed, a value from 1 to 100 (in percent of completion) if more textures need to be loaded and a negative error value on failure.
void WaterManager::RecomputeBlurredNormalMap ( )

RecomputeBlurredNormalMap: calculates the blurred normal map of the terrain.

Slow.

void WaterManager::RecomputeDistanceHeightmap ( )

RecomputeDistanceHeightmap: recalculates (or calculates) the distance heightmap.

void WaterManager::RecomputeWindStrength ( )

RecomputeWindStrength: calculates the intensity of waves.

void WaterManager::ReloadWaterNormalTextures ( )

ReloadWaterNormalTextures: Reload the normal textures so that changing water type in Atlas will actually do the right thing.

void WaterManager::RenderWaves ( const CFrustum frustrum)
void WaterManager::Resize ( )

Resize: Updates the fancy water textures so that water will render correctly with fancy water.

void WaterManager::SetMapSize ( size_t  size)

Updates the map size.

Will trigger a complete recalculation of fancy water information the next turn.

void WaterManager::UnloadWaterTextures ( )

UnloadWaterTextures: Free any loaded water textures and reset the internal state so that another call to LoadWaterTextures will begin progressive loading.

void WaterManager::UpdateQuality ( )

Updates the settings to the one from the renderer, and sets m_NeedsReloading.

bool WaterManager::WillRenderFancyWater ( )

Returns true if fancy water shaders will be used (i.e.

the hardware is capable and it hasn't been configured off)

Member Data Documentation

CVector3D* WaterManager::m_BlurredNormalMap
GLuint WaterManager::m_depthTT
float* WaterManager::m_DistanceHeightmap
GLuint WaterManager::m_FancyEffectsFBO
GLuint WaterManager::m_FancyTextureDepth
GLuint WaterManager::m_FancyTextureNormal
GLuint WaterManager::m_FancyTextureOther
CTexturePtr WaterManager::m_FoamTex
size_t WaterManager::m_MapSize
float WaterManager::m_Murkiness
bool WaterManager::m_NeedInfoUpdate
bool WaterManager::m_NeedsReloading
CTexturePtr WaterManager::m_NormalMap[60]
GLuint WaterManager::m_ReflectionFbo
CMatrix3D WaterManager::m_ReflectionMatrix
GLuint WaterManager::m_ReflectionTexture
GLuint WaterManager::m_ReflFboDepthTexture
GLuint WaterManager::m_RefractionFbo
CMatrix3D WaterManager::m_RefractionMatrix
GLuint WaterManager::m_RefractionTexture
GLuint WaterManager::m_RefrFboDepthTexture
size_t WaterManager::m_RefTextureSize
bool WaterManager::m_RenderWater
float WaterManager::m_RepeatPeriod
std::vector< WaveObject* > WaterManager::m_ShoreWaves
CVertexBuffer::VBChunk* WaterManager::m_ShoreWaves_VBIndices
ssize_t WaterManager::m_TexSize
u32 WaterManager::m_updatei0
u32 WaterManager::m_updatei1
u32 WaterManager::m_updatej0
u32 WaterManager::m_updatej1
CColor WaterManager::m_WaterColor
int WaterManager::m_WaterCurrentTex
bool WaterManager::m_WaterFancyEffects
float WaterManager::m_WaterHeight
bool WaterManager::m_WaterRealDepth
bool WaterManager::m_WaterReflection
bool WaterManager::m_WaterRefraction
bool WaterManager::m_WaterShadows
double WaterManager::m_WaterTexTimer
CTexturePtr WaterManager::m_WaterTexture[60]
CColor WaterManager::m_WaterTint
std::wstring WaterManager::m_WaterType
bool WaterManager::m_WaterUgly
CTexturePtr WaterManager::m_WaveTex
float WaterManager::m_Waviness
float WaterManager::m_WindAngle
float* WaterManager::m_WindStrength

The documentation for this class was generated from the following files: