mercator
0.4.0
A terrain generation library for the Worldforge system.
|
Shader agregating surface data. More...
#include <TileShader.h>
Public Types | |
typedef std::map< int, std::unique_ptr< Shader > > | Shaderstore |
STL map to store sparse array of Shader pointers. More... | |
typedef std::map< std::string, float > | Parameters |
STL map of parameter values for a shader constructor. More... | |
Public Member Functions | |
void | addShader (std::unique_ptr< Shader > t, int id) |
Add a shader to those agregated by the tile shader. More... | |
bool | checkIntersect (const Segment &) const override |
Check whether this Shader has any effect on the given Segment. More... | |
void | shade (Surface &) const override |
Populate a Surface with data. More... | |
bool | getColor () const |
Accessor for color flag. More... | |
bool | getAlpha () const |
Accessor for alpha flag. More... | |
std::unique_ptr< Surface > | newSurface (const Segment &) const |
Create a new Surface which matches the requirements of this shader. More... | |
Shader agregating surface data.
Some applications require the terrain surface data be stored in a single buffer so specific locations can be queried to determine the type. Typically this is used on a server, where lots of surface data optimised for rendering is not required, but fast cheap queries about the surface at a specific point are required.
Definition at line 21 of file TileShader.h.
|
inherited |
typedef std::map<int, std::unique_ptr<Shader> > Mercator::TileShader::Shaderstore |
STL map to store sparse array of Shader pointers.
Definition at line 24 of file TileShader.h.
|
inline |
Add a shader to those agregated by the tile shader.
Definition at line 34 of file TileShader.h.
|
overridevirtual |
Check whether this Shader has any effect on the given Segment.
Implements Mercator::Shader.
Definition at line 18 of file TileShader.cpp.
|
inlineinherited |
|
inlineinherited |
Create a new Surface which matches the requirements of this shader.
Called by terrain when creating a new Segment to add the necessary Surface objects to that Segment.
Definition at line 27 of file Shader.cpp.
Referenced by Mercator::Terrain::addShader().
|
overridevirtual |
Populate a Surface with data.
Implements Mercator::Shader.
Definition at line 23 of file TileShader.cpp.
References Mercator::Buffer< DataType >::getData(), Mercator::Surface::getSegment(), and Mercator::Buffer< DataType >::getSize().