Mercator::DepthShader Class Reference

Shader to give the appearance of deep murky water. More...

#include <DepthShader.h>

Inheritance diagram for Mercator::DepthShader:

Mercator::Shader

List of all members.

Public Member Functions

 DepthShader (float waterLevel=default_waterLevel, float murkyDepth=default_murkyDepth)
 Constructor.
 DepthShader (const Parameters &params)
 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.


Detailed Description

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.


Constructor & Destructor Documentation

Mercator::DepthShader::DepthShader ( float  waterLevel = default_waterLevel,
float  murkyDepth = default_murkyDepth 
) [explicit]

Constructor.

Parameters:
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.

Parameters:
params a map of parameters for the shader.

References key_murkyDepth, key_waterLevel, m_murkyDepth, and m_waterLevel.


Member Function Documentation

bool Mercator::DepthShader::checkIntersect ( const Segment  )  const [virtual]

Check whether this Shader has any effect on the given Segment.

Returns:
true if the given Segment height range is within the range that this Shader uses. e.g. A high altitude snow shader will have no effect on low level terrain.

Implements Mercator::Shader.

References Mercator::Segment::getMin(), and m_waterLevel.


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

Generated for Mercator by  doxygen 1.5.6