|
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. More... | |
| DepthShader (const Parameters ¶ms) | |
| Constructor. More... | |
| 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. More... | |
| virtual void | shade (Surface &) const |
| Populate a Surface with data. | |
Public Member Functions inherited from Mercator::Shader | |
| virtual | ~Shader () |
| Destructor does nothing interesting. | |
| bool | getColor () const |
| Accessor for color flag. | |
| bool | getAlpha () const |
| Accessor for alpha flag. | |
| Surface * | newSurface (const Segment &) const |
| Create a new Surface which matches the requirements of this shader. More... | |
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. | |
Additional Inherited Members | |
Public Types inherited from Mercator::Shader | |
| typedef std::map< std::string, float > | Parameters |
| STL map of parameter values for a shader constructor. | |
Protected Member Functions inherited from Mercator::Shader | |
| Shader (bool color=false, bool alpha=true) | |
| Protected constructor for classes which inherit from this one. More... | |
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.
|
explicit |
Constructor.
| waterLevel | level of the surface of the water. |
| murkyDepth | depth at which the bottom becomes completely obscured. |
|
explicit |
Constructor.
| params | a map of parameters for the shader. |
References key_murkyDepth, key_waterLevel, m_murkyDepth, and m_waterLevel.
|
virtual |
Check whether this Shader has any effect on the given Segment.
Implements Mercator::Shader.
References Mercator::Segment::getMin(), and m_waterLevel.
1.8.15