![]() |
OGRE 1.12.10
Object-Oriented Graphics Rendering Engine
|
Class that provides functionality to generate materials for use with a terrain. More...
#include <OgreTerrainMaterialGenerator.h>
Classes | |
| class | Profile |
| Inner class which should also be subclassed to provide profile-specific material generation. More... | |
Public Types | |
| typedef std::vector< Profile * > | ProfileList |
| List of profiles - NB should be ordered in descending complexity. | |
Public Member Functions | |
| TerrainMaterialGenerator () | |
| virtual | ~TerrainMaterialGenerator () |
| Texture * | _getCompositeMapRTT () |
| void | _markChanged () |
| Internal method - indicates that a change has been made that would require material regeneration. | |
| virtual void | _renderCompositeMap (size_t size, const Rect &rect, const MaterialPtr &mat, const TexturePtr &destCompositeMap) |
| Helper method to render a composite map. | |
| virtual bool | canGenerateUsingDeclaration (const TerrainLayerDeclaration &decl) |
| Whether this generator can generate a material for a given declaration. | |
| virtual MaterialPtr | generate (const Terrain *terrain) |
| Generate a material for the given terrain using the active profile. | |
| virtual MaterialPtr | generateForCompositeMap (const Terrain *terrain) |
| Generate a material for the given composite map of the terrain using the active profile. | |
| 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. | |
| virtual unsigned int | getDebugLevel () const |
| Get the debug level of the material. | |
| virtual 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 const ProfileList & | getProfiles () const |
| Get the list of profiles that this generator supports. | |
| 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. | |
| virtual void | setActiveProfile (const String &name) |
| Set the active profile by name. | |
| virtual void | setActiveProfile (Profile *p) |
| Set the active Profile. | |
| virtual 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). | |
| virtual 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.
| typedef std::vector<Profile*> Ogre::TerrainMaterialGenerator::ProfileList |
List of profiles - NB should be ordered in descending complexity.
| Ogre::TerrainMaterialGenerator::TerrainMaterialGenerator | ( | ) |
|
virtual |
|
inlinevirtual |
Get the list of profiles that this generator supports.
|
inlinevirtual |
|
inlinevirtual |
Set the active Profile.
References _markChanged().
|
inline |
Get the active profile.
Referenced by generate(), generateForCompositeMap(), getMaxLayers(), isVertexCompressionSupported(), requestOptions(), setLightmapEnabled(), updateCompositeMap(), updateParams(), and updateParamsForCompositeMap().
|
inline |
Internal method - indicates that a change has been made that would require material regeneration.
Referenced by setActiveProfile(), and setDebugLevel().
|
inline |
Returns the number of times the generator has undergone a change which would require materials to be regenerated.
|
inlinevirtual |
Get the layer declaration that this material generator operates with.
|
inlinevirtual |
Whether this generator can generate a material for a given declaration.
By default this only returns true if the declaration is equal to the standard one returned from getLayerDeclaration, but if a subclass wants to be flexible to generate materials for other declarations too, it can specify here.
|
inlinevirtual |
Return whether this material generator supports using a compressed vertex format.
This is only possible when using shaders.
References getActiveProfile().
|
inlinevirtual |
Triggers the generator to request the options that it needs.
References getActiveProfile(), and Ogre::TerrainMaterialGenerator::Profile::requestOptions().
|
inlinevirtual |
Generate a material for the given terrain using the active profile.
References Ogre::TerrainMaterialGenerator::Profile::generate(), and getActiveProfile().
|
inlinevirtual |
Generate a material for the given composite map of the terrain using the active profile.
References Ogre::TerrainMaterialGenerator::Profile::generateForCompositeMap(), and getActiveProfile().
|
inlinevirtual |
Whether to support a light map over the terrain in the shader, if it's present (default true).
References getActiveProfile(), and Ogre::TerrainMaterialGenerator::Profile::setLightmapEnabled().
|
inlinevirtual |
Get the maximum number of layers supported with the given terrain.
References getActiveProfile(), and Ogre::TerrainMaterialGenerator::Profile::getMaxLayers().
|
inlinevirtual |
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.
References getActiveProfile(), and Ogre::TerrainMaterialGenerator::Profile::updateCompositeMap().
|
inlinevirtual |
Update parameters for the given terrain using the active profile.
References getActiveProfile(), and Ogre::TerrainMaterialGenerator::Profile::updateParams().
|
inlinevirtual |
Update parameters for the given terrain composite map using the active profile.
References getActiveProfile(), and Ogre::TerrainMaterialGenerator::Profile::updateParamsForCompositeMap().
|
inlinevirtual |
Set the debug level of the material.
References _markChanged().
|
inlinevirtual |
Get the debug level of the material.
|
virtual |
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 |