OGRE 14.3
Object-Oriented Graphics Rendering Engine
|
Class that provides functionality to generate materials for use with a terrain. More...
#include <OgreTerrainMaterialGenerator.h>
Classes | |
struct | Profile |
Public Member Functions | |
TerrainMaterialGenerator () | |
virtual | ~TerrainMaterialGenerator () |
Texture * | _getCompositeMapRTT () |
void | _markChanged () |
Internal method - indicates that a change has been made that would require material regeneration. | |
void | _renderCompositeMap (size_t size, const Rect &rect, const MaterialPtr &mat, const TexturePtr &destCompositeMap) |
Helper method to render a composite map. | |
virtual MaterialPtr | generate (const Terrain *terrain)=0 |
Generate a material for the given terrain using the active profile. | |
virtual MaterialPtr | generateForCompositeMap (const Terrain *terrain)=0 |
Generate a material for the given composite map of the terrain using the active profile. | |
virtual Profile * | getActiveProfile () const |
Get the active profile. | |
unsigned long long int | getChangeCount () const |
Returns the number of times the generator has undergone a change which would require materials to be regenerated. | |
unsigned int | getDebugLevel () const |
Get the debug level of the material. | |
const TerrainLayerDeclaration & | getLayerDeclaration () const |
Get the layer declaration that this material generator operates with. | |
virtual uint8 | getMaxLayers (const Terrain *terrain) const |
Get the maximum number of layers supported with the given terrain. | |
virtual bool | isVertexCompressionSupported () const |
Return whether this material generator supports using a compressed vertex format. | |
virtual void | requestOptions (Terrain *terrain) |
Triggers the generator to request the options that it needs. | |
void | setDebugLevel (unsigned int dbg) |
Set the debug level of the material. | |
virtual void | setLightmapEnabled (bool enabled) |
Whether to support a light map over the terrain in the shader, if it's present (default true). | |
void | updateCompositeMap (const Terrain *terrain, const Rect &rect) |
Update the composite map for a terrain. | |
virtual void | updateParams (const MaterialPtr &mat, const Terrain *terrain) |
Update parameters for the given terrain using the active profile. | |
virtual void | updateParamsForCompositeMap (const MaterialPtr &mat, const Terrain *terrain) |
Update parameters for the given terrain composite map using the active profile. | |
Class that provides functionality to generate materials for use with a terrain.
Terrains are composed of one or more layers of texture information, and require that a material is generated to render them. There are various approaches to rendering the terrain, which may vary due to:
Subclasses of this class are responsible for responding to these factors and to generate a terrain material.
Ogre::TerrainMaterialGenerator::TerrainMaterialGenerator | ( | ) |
|
virtual |
Get the active profile.
Reimplemented in Ogre::TerrainMaterialGeneratorA.
|
inline |
Internal method - indicates that a change has been made that would require material regeneration.
Returns the number of times the generator has undergone a change which would require materials to be regenerated.
|
inline |
Get the layer declaration that this material generator operates with.
Return whether this material generator supports using a compressed vertex format.
This is only possible when using shaders.
Reimplemented in Ogre::TerrainMaterialGeneratorA.
Triggers the generator to request the options that it needs.
Reimplemented in Ogre::TerrainMaterialGeneratorA.
|
pure virtual |
Generate a material for the given terrain using the active profile.
Implemented in Ogre::TerrainMaterialGeneratorA.
|
pure virtual |
Generate a material for the given composite map of the terrain using the active profile.
Implemented in Ogre::TerrainMaterialGeneratorA.
Whether to support a light map over the terrain in the shader, if it's present (default true).
Reimplemented in Ogre::TerrainMaterialGeneratorA.
|
inlinevirtual |
Get the maximum number of layers supported with the given terrain.
Reimplemented in Ogre::TerrainMaterialGeneratorA.
void Ogre::TerrainMaterialGenerator::updateCompositeMap | ( | const Terrain * | terrain, |
const Rect & | rect | ||
) |
Update the composite map for a terrain.
The composite map for a terrain must match what the terrain should look like at distance. This method will only be called in the render thread so the generator is free to render into a texture to support this, so long as the results are blitted into the Terrain's own composite map afterwards.
|
inlinevirtual |
Update parameters for the given terrain using the active profile.
Reimplemented in Ogre::TerrainMaterialGeneratorA.
|
inlinevirtual |
Update parameters for the given terrain composite map using the active profile.
Reimplemented in Ogre::TerrainMaterialGeneratorA.
Set the debug level of the material.
Sets the level of debug display for this material. What this debug level means is entirely depdendent on the generator, the only constant is that 0 means 'no debug' and non-zero means 'some level of debugging', with any graduations in non-zero values being generator-specific.
Get the debug level of the material.
void Ogre::TerrainMaterialGenerator::_renderCompositeMap | ( | size_t | size, |
const Rect & | rect, | ||
const MaterialPtr & | mat, | ||
const TexturePtr & | destCompositeMap | ||
) |
Helper method to render a composite map.
size | The requested composite map size |
rect | The region of the composite map to update, in image space |
mat | The material to use to render the map |
destCompositeMap | A TexturePtr for the composite map to be written into |
|
inline |