5 #ifndef MERCATOR_FILL_GRASS_SHADER_H
6 #define MERCATOR_FILL_GRASS_SHADER_H
8 #include <Mercator/Shader.h>
9 #include <Mercator/Surface.h>
118 #endif // MERCATOR_FILL_GRASS_SHADER_H
const Segment & getSegment() const
Accessor for the terrain height segment this buffer is associated with.
Definition: Buffer.h:55
float getMin() const
Accessor for the minimum height value in this Segment.
Definition: Segment.h:181
const float lowThreshold() const
Accessor for level above which the shader renders.
Definition: GrassShader.h:104
const int getSize() const
Accessor for array size of this segment.
Definition: Segment.h:81
GrassShader(float lowThreshold=default_lowThreshold, float highThreshold=default_highThreshold, float cutoff=default_cutoff, float intercept=default_intercept)
Constructor.
Definition: GrassShader.cpp:30
unsigned int getChannels() const
Accessor for the number of data values per height point.
Definition: Buffer.h:65
static const float default_intercept
Default slope steeper than which no grass grows.
Definition: GrassShader.h:85
Class storing heightfield and other data for a single fixed size square area of terrain defined by fo...
Definition: Segment.h:36
Data store for terrain surface data.
Definition: Surface.h:22
float m_cutoff
The slope below which grass is opaque.
Definition: GrassShader.h:57
static const float default_cutoff
Default slope below which grass is opaque.
Definition: GrassShader.h:83
static const float default_highThreshold
Default level below which the shader renders.
Definition: GrassShader.h:81
ColorT slopeToAlpha(float height, float slope) const
Determine the alpha value for grass for a given slope.
Definition: GrassShader.cpp:67
static const std::string key_lowThreshold
Key string used when specifying the low threshold parameter.
Definition: GrassShader.h:70
const float cutoff() const
Accessor for slope below which grass is opaque.
Definition: GrassShader.h:108
const float intercept() const
Accessor for slope steeper than which no grass grows.
Definition: GrassShader.h:110
static const float default_lowThreshold
Default level above which the shader renders.
Definition: GrassShader.h:79
static const std::string key_cutoff
Key string used when specifying the cutoff parameter.
Definition: GrassShader.h:74
DataType * getData()
Accessor for a pointer to buffer containing data values.
Definition: Buffer.h:70
float m_intercept
The slope steeper than which no grass grows.
Definition: GrassShader.h:59
virtual void shade(Surface &) const
Populate a Surface with data.
Definition: GrassShader.cpp:90
float m_lowThreshold
The level above which the shader renders.
Definition: GrassShader.h:53
Base class for Shader objects which create surface data for use when rendering terrain.
Definition: Shader.h:29
static const std::string key_intercept
Key string used when specifying the intercept parameter.
Definition: GrassShader.h:76
Shader for adding grass to the terrain.
Definition: GrassShader.h:50
static const std::string key_highThreshold
Key string used when specifying the high threshold parameter.
Definition: GrassShader.h:72
const float highThreshold() const
Accessor for level below which the shader renders.
Definition: GrassShader.h:106
float get(int x, int y) const
Get the height at a relative integer position in the Segment.
Definition: Segment.h:165
virtual bool checkIntersect(const Segment &) const
Check whether this Shader has any effect on the given Segment.
Definition: GrassShader.cpp:80
const int getResolution() const
Accessor for resolution of this segment.
Definition: Segment.h:76
std::map< std::string, float > Parameters
STL map of parameter values for a shader constructor.
Definition: Shader.h:63
const float * getPoints() const
Accessor for buffer containing height points.
Definition: Segment.h:145
float getMax() const
Accessor for the maximum height value in this Segment.
Definition: Segment.h:179
float m_highThreshold
The level below which the shader renders.
Definition: GrassShader.h:55