Mercator
|
Shader to give the appearance of deep murky water. More...
#include <DepthShader.h>
Public Member Functions | |
DepthShader (float waterLevel=default_waterLevel, float murkyDepth=default_murkyDepth) | |
Constructor. | |
DepthShader (const Parameters ¶ms) | |
Constructor. | |
const float | waterLevel () const |
Accessor for the level of the surface of the water. | |
const float | murkyDepth () const |
Accessor for the depth at which the bottom becomes completely obscured. | |
virtual bool | checkIntersect (const Segment &) const |
Check whether this Shader has any effect on the given Segment. | |
virtual void | shade (Surface &) const |
Populate a Surface with data. | |
Static Public Attributes | |
static const std::string | key_waterLevel |
Key string used when specifying the water level parameter. | |
static const std::string | key_murkyDepth |
Key string used when specifying the murky depth parameter. | |
static const float | default_waterLevel = 0.f |
Default level of the surface of the water. | |
static const float | default_murkyDepth = -64.f |
Default depth at which the bottom becomes completely obscured. | |
Private Attributes | |
float | m_waterLevel |
The level of the surface of the water. | |
float | m_murkyDepth |
The depth at which the bottom becomes completely obscured. |
Shader to give the appearance of deep murky water.
Areas of terrain covered by water should be darker as less distinct as they get deeper. This shader adds a uniform alpha blended surface below water level which becomes more opaque as it gets deeper concealing the underlying appearance of the terrain from a viewer at the surface.
Mercator::DepthShader::DepthShader | ( | float | waterLevel = default_waterLevel , |
float | murkyDepth = default_murkyDepth |
||
) | [explicit] |
Constructor.
waterLevel | level of the surface of the water. |
murkyDepth | depth at which the bottom becomes completely obscured. |
Mercator::DepthShader::DepthShader | ( | const Parameters & | params | ) | [explicit] |
Constructor.
params | a map of parameters for the shader. |
References key_murkyDepth, key_waterLevel, m_murkyDepth, and m_waterLevel.
bool Mercator::DepthShader::checkIntersect | ( | const Segment & | ) | const [virtual] |
Check whether this Shader has any effect on the given Segment.
Implements Mercator::Shader.
References Mercator::Segment::getMin(), and m_waterLevel.