17 #ifndef TERRAINSHADER_H
18 #define TERRAINSHADER_H
21 #include "TerrainMaterialDef.h"
22 #include "renderer/InstancedShader.h"
74 typedef std::shared_ptr<TerrainShader> TerrainShaderPtr;
156 static void addShaderCodeDefines(
const TerrainShaderKey& shaderKey, std::string& code);
157 static void initializeShaderMap();
160 static bool sShaderMapInitialized;
169 static const char* TERRAIN_SHADER_UNIFORMS[];
170 static const char* VERTEX_SHADER_PATH;
171 static const char* FRAGMENT_SHADER_PATH;
174 #endif // TERRAINSHADER_H
TerrainShader(const ShaderPtr &sharedShader)
Construct a TerrainShader based on the given shared Shader.
Header declaring and including types common to renderer classes such as Vector2. Also includes GL hea...
void setBaseTexture(const TexturePtr &value)
Sets the base Texture.
Shader which has instanced values for uniforms and other GL state.
Definition: InstancedShader.h:46
bool operator<(const TerrainShaderKey &other) const
Less than operator for use with QMap.
TerrainMaterialDef::BlendMode blendMode
How the blend texture should be composited on to the base texture.
Definition: TerrainShader.h:49
InstancedShader which does a multi-texture blend between up to three Textures, to render terrain mesh...
Definition: TerrainShader.h:93
float Matrix4[16]
4x4 float matrix, whose layout is compatible with GL.
Definition: RendererCommon.h:46
bool hasEdge
Whether or not this shader renders edges.
Definition: TerrainShader.h:37
bool hasBevel
Whether or not this shader renders a bevel section.
Definition: TerrainShader.h:44
virtual void updateState() override
Implementation of InstancedShader::updateState().
const ShaderPtr & getSharedShader() const
Returns the Shader that is shared among instances.
Definition: InstancedShader.h:59
Selector key which picks the specific terrain shader variant to use.
Definition: TerrainShader.h:30
std::shared_ptr< Texture > TexturePtr
Shared pointer typedef for Texture.
Definition: PointerDeclarations.h:173
BlendMode
Blend modes used to mix the bevel texture with the base texture.
Definition: TerrainMaterialDef.h:47
std::shared_ptr< Shader > ShaderPtr
Shared pointer typedef for Shader.
Definition: PointerDeclarations.h:143
const TexturePtr & getBlendTexture() const
Returns the blend Texture.
Definition: TerrainShader.h:125
void setBlendTexture(const TexturePtr &value)
Sets the blend Texture.
TerrainShaderKey()
Construct an empty TerrainShaderKey with default values.
const TexturePtr & getBaseTexture() const
Returns the base Texture.
Definition: TerrainShader.h:104
void setMaskTexture(const TexturePtr &value)
Sets the mask Texture.
const TexturePtr & getMaskTexture() const
Returns the mask Texture.
Definition: TerrainShader.h:114
void setTransform(const Matrix4 &matrix)
Sets the transform to apply to vertices rendered with this Shader.