Ogre::TerrainMaterialGeneratorA Class Reference
Components » Terrain

A TerrainMaterialGenerator which can cope with normal mapped, specular mapped terrain. More...

`#include <OgreTerrainMaterialGeneratorA.h>`

Inheritance diagram for Ogre::TerrainMaterialGeneratorA:
[legend]

## Classes

class | SM2Profile
| Shader model 2 profile target. More...

## Public Types

typedef vector< Profile * >::type | ProfileList
| List of profiles - NB should be ordered in descending complexity. More...

## Public Member Functions

| TerrainMaterialGeneratorA ()
virtual | ~TerrainMaterialGeneratorA ()
Texture * | _getCompositeMapRTT ()
void | _markChanged ()
| Internal method - indicates that a change has been made that would require material regeneration. More...
virtual void | _renderCompositeMap (size_t size, const Rect &rect, const MaterialPtr &mat, const TexturePtr &destCompositeMap)
| Helper method to render a composite map. More...
virtual bool | canGenerateUsingDeclaration (const TerrainLayerDeclaration &decl)
| Whether this generator can generate a material for a given declaration. More...
virtual MaterialPtr | generate (const Terrain *terrain)
| Generate a material for the given terrain using the active profile. More...
virtual MaterialPtr | generateForCompositeMap (const Terrain *terrain)
| Generate a material for the given composite map of the terrain using the active profile. More...
Profile * | getActiveProfile () const
| Get the active profile. More...
unsigned long long int | getChangeCount () const
| Returns the number of times the generator has undergone a change which would require materials to be regenerated. More...
virtual unsigned int | getDebugLevel () const
| Get the debug level of the material. More...
virtual const TerrainLayerDeclaration & | getLayerDeclaration () const
| Get the layer declaration that this material generator operates with. More...
virtual uint8 | getMaxLayers (const Terrain *terrain) const
| Get the maximum number of layers supported with the given terrain. More...
virtual const ProfileList & | getProfiles () const
| Get the list of profiles that this generator supports. More...
virtual bool | isVertexCompressionSupported () const
| Return whether this material generator supports using a compressed vertex format. More...
void | operator delete (void *ptr)
void | operator delete (void *ptr, void *)
void | operator delete (void *ptr, const char *, int, const char *)
void | operator delete[] (void *ptr)
void | operator delete[] (void *ptr, const char *, int, const char *)
void * | operator new (size_t sz, const char *file, int line, const char *func)
| operator new, with debug line info More...
void * | operator new (size_t sz)
void * | operator new (size_t sz, void *ptr)
| placement operator new More...
void * | operator new[] (size_t sz, const char *file, int line, const char *func)
| array operator new, with debug line info More...
void * | operator new[] (size_t sz)
virtual void | requestOptions (Terrain *terrain)
| Triggers the generator to request the options that it needs. More...
virtual void | setActiveProfile (const String &name)
| Set the active profile by name. More...
virtual void | setActiveProfile (Profile *p)
| Set the active Profile. More...
virtual void | setDebugLevel (unsigned int dbg)
| Set the debug level of the material. More...
virtual void | setLightmapEnabled (bool enabled)
| Whether to support a light map over the terrain in the shader, if it's present (default true). More...
virtual void | updateCompositeMap (const Terrain *terrain, const Rect &rect)
| Update the composite map for a terrain. More...
virtual void | updateParams (const MaterialPtr &mat, const Terrain *terrain)
| Update parameters for the given terrain using the active profile. More...
virtual void | updateParamsForCompositeMap (const MaterialPtr &mat, const Terrain *terrain)
| Update parameters for the given terrain composite map using the active profile. More...

## Protected Attributes

Profile * | mActiveProfile
unsigned long long int | mChangeCounter
Camera * | mCompositeMapCam
Light * | mCompositeMapLight
ManualObject * | mCompositeMapPlane
Texture * | mCompositeMapRTT
SceneManager * | mCompositeMapSM
unsigned int | mDebugLevel
TerrainLayerDeclaration | mLayerDecl
ProfileList | mProfiles

## Detailed Description

A TerrainMaterialGenerator which can cope with normal mapped, specular mapped terrain.

Note
  Requires the Cg plugin to render correctly

Definition at line 53 of file OgreTerrainMaterialGeneratorA.h.

## Member Typedef Documentation

## ProfileList

typedef vector<Profile*>::type Ogre::TerrainMaterialGenerator::ProfileList

inherited

List of profiles - NB should be ordered in descending complexity.

Definition at line 212 of file OgreTerrainMaterialGenerator.h.

## Constructor & Destructor Documentation

## TerrainMaterialGeneratorA()

Ogre::TerrainMaterialGeneratorA::TerrainMaterialGeneratorA | ( |  | ) |

## ~TerrainMaterialGeneratorA()

virtual Ogre::TerrainMaterialGeneratorA::~TerrainMaterialGeneratorA | ( |  | ) |

virtual

## Member Function Documentation

## _getCompositeMapRTT()

Texture* Ogre::TerrainMaterialGenerator::_getCompositeMapRTT | ( |  | ) |

inherited

Definition at line 395 of file OgreTerrainMaterialGenerator.h.

## _markChanged()

void Ogre::TerrainMaterialGenerator::_markChanged | ( |  | ) |

inherited

Internal method - indicates that a change has been made that would require material regeneration.

Definition at line 255 of file OgreTerrainMaterialGenerator.h.

## _renderCompositeMap()

virtual void Ogre::TerrainMaterialGenerator::_renderCompositeMap | ( | size_t | size,
|  | const Rect & | rect,
|  | const MaterialPtr & | mat,
|  | const TexturePtr & | destCompositeMap
| ) |  |

virtual inherited

Helper method to render a composite map.

Parameters

  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

## canGenerateUsingDeclaration()

virtual bool Ogre::TerrainMaterialGenerator::canGenerateUsingDeclaration | ( | const TerrainLayerDeclaration & | decl | ) |

virtual inherited

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.

Definition at line 271 of file OgreTerrainMaterialGenerator.h.

## generate()

virtual MaterialPtr Ogre::TerrainMaterialGenerator::generate | ( | const Terrain * | terrain | ) |

virtual inherited

Generate a material for the given terrain using the active profile.

Definition at line 295 of file OgreTerrainMaterialGenerator.h.

References Ogre::TerrainMaterialGenerator::Profile::generate().

## generateForCompositeMap()

virtual MaterialPtr Ogre::TerrainMaterialGenerator::generateForCompositeMap | ( | const Terrain * | terrain | ) |

virtual inherited

Generate a material for the given composite map of the terrain using the active profile.

Definition at line 305 of file OgreTerrainMaterialGenerator.h.

References Ogre::TerrainMaterialGenerator::Profile::generateForCompositeMap().

## getActiveProfile()

Profile* Ogre::TerrainMaterialGenerator::getActiveProfile | ( |  | ) | const

inherited

Get the active profile.

Definition at line 245 of file OgreTerrainMaterialGenerator.h.

## getChangeCount()

unsigned long long int Ogre::TerrainMaterialGenerator::getChangeCount | ( |  | ) | const

inherited

Returns the number of times the generator has undergone a change which would require materials to be regenerated.

Definition at line 260 of file OgreTerrainMaterialGenerator.h.

## getDebugLevel()

virtual unsigned int Ogre::TerrainMaterialGenerator::getDebugLevel | ( |  | ) | const

virtual inherited

Get the debug level of the material.

Definition at line 384 of file OgreTerrainMaterialGenerator.h.

## getLayerDeclaration()

virtual const TerrainLayerDeclaration& Ogre::TerrainMaterialGenerator::getLayerDeclaration | ( |  | ) | const

virtual inherited

Get the layer declaration that this material generator operates with.

Definition at line 264 of file OgreTerrainMaterialGenerator.h.

## getMaxLayers()

virtual uint8 Ogre::TerrainMaterialGenerator::getMaxLayers | ( | const Terrain * | terrain | ) | const

virtual inherited

Get the maximum number of layers supported with the given terrain.

Note
  When you change the options on the terrain, this value can change.

Definition at line 325 of file OgreTerrainMaterialGenerator.h.

References Ogre::TerrainMaterialGenerator::Profile::getMaxLayers().

## getProfiles()

virtual const ProfileList& Ogre::TerrainMaterialGenerator::getProfiles | ( |  | ) | const

virtual inherited

Get the list of profiles that this generator supports.

Definition at line 216 of file OgreTerrainMaterialGenerator.h.

## isVertexCompressionSupported()

virtual bool Ogre::TerrainMaterialGenerator::isVertexCompressionSupported | ( |  | ) | const

virtual inherited

Return whether this material generator supports using a compressed vertex format.

This is only possible when using shaders.

Definition at line 279 of file OgreTerrainMaterialGenerator.h.

## operator delete() [1/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr | ) |

inherited

Definition at line 96 of file OgreMemoryAllocatedObject.h.

## operator delete() [2/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | void * |
| ) |  |

inherited

Definition at line 102 of file OgreMemoryAllocatedObject.h.

## operator delete() [3/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |
| ) |  |

inherited

Definition at line 108 of file OgreMemoryAllocatedObject.h.

## operator delete[]() [1/2]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr | ) |

inherited

Definition at line 113 of file OgreMemoryAllocatedObject.h.

## operator delete[]() [2/2]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |
| ) |  |

inherited

Definition at line 119 of file OgreMemoryAllocatedObject.h.

## operator new() [1/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func
| ) |  |

inherited

operator new, with debug line info

Definition at line 68 of file OgreMemoryAllocatedObject.h.

## operator new() [2/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz | ) |

inherited

Definition at line 73 of file OgreMemoryAllocatedObject.h.

## operator new() [3/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | void * | ptr
| ) |  |

inherited

placement operator new

Definition at line 79 of file OgreMemoryAllocatedObject.h.

## operator new[]() [1/2]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func
| ) |  |

inherited

array operator new, with debug line info

Definition at line 86 of file OgreMemoryAllocatedObject.h.

## operator new[]() [2/2]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz | ) |

inherited

Definition at line 91 of file OgreMemoryAllocatedObject.h.

## requestOptions()

virtual void Ogre::TerrainMaterialGenerator::requestOptions | ( | Terrain * | terrain | ) |

virtual inherited

Triggers the generator to request the options that it needs.

Definition at line 286 of file OgreTerrainMaterialGenerator.h.

References Ogre::TerrainMaterialGenerator::Profile::requestOptions().

## setActiveProfile() [1/2]

virtual void Ogre::TerrainMaterialGenerator::setActiveProfile | ( | const String & | name | ) |

virtual inherited

Set the active profile by name.

Definition at line 219 of file OgreTerrainMaterialGenerator.h.

## setActiveProfile() [2/2]

virtual void Ogre::TerrainMaterialGenerator::setActiveProfile | ( | Profile * | p | ) |

virtual inherited

Set the active Profile.

Definition at line 236 of file OgreTerrainMaterialGenerator.h.

## setDebugLevel()

virtual void Ogre::TerrainMaterialGenerator::setDebugLevel | ( | unsigned int | dbg | ) |

virtual inherited

Set the debug level of the material.

Remarks
  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.

Definition at line 375 of file OgreTerrainMaterialGenerator.h.

## setLightmapEnabled()

virtual void Ogre::TerrainMaterialGenerator::setLightmapEnabled | ( | bool | enabled | ) |

virtual inherited

Whether to support a light map over the terrain in the shader, if it's present (default true).

Definition at line 316 of file OgreTerrainMaterialGenerator.h.

References Ogre::TerrainMaterialGenerator::Profile::setLightmapEnabled().

## updateCompositeMap()

virtual void Ogre::TerrainMaterialGenerator::updateCompositeMap | ( | const Terrain * | terrain,
|  | const Rect & | rect
| ) |  |

virtual inherited

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.

Definition at line 340 of file OgreTerrainMaterialGenerator.h.

References Ogre::TerrainMaterialGenerator::Profile::updateCompositeMap().

## updateParams()

virtual void Ogre::TerrainMaterialGenerator::updateParams | ( | const MaterialPtr & | mat,
|  | const Terrain * | terrain
| ) |  |

virtual inherited

Update parameters for the given terrain using the active profile.

Definition at line 352 of file OgreTerrainMaterialGenerator.h.

References Ogre::TerrainMaterialGenerator::Profile::updateParams().

## updateParamsForCompositeMap()

virtual void Ogre::TerrainMaterialGenerator::updateParamsForCompositeMap | ( | const MaterialPtr & | mat,
|  | const Terrain * | terrain
| ) |  |

virtual inherited

Update parameters for the given terrain composite map using the active profile.

Definition at line 360 of file OgreTerrainMaterialGenerator.h.

References Ogre::TerrainMaterialGenerator::Profile::updateParamsForCompositeMap().

## Member Data Documentation

## mActiveProfile

Profile* Ogre::TerrainMaterialGenerator::mActiveProfile

mutable protected inherited

Definition at line 399 of file OgreTerrainMaterialGenerator.h.

## mChangeCounter

unsigned long long int Ogre::TerrainMaterialGenerator::mChangeCounter

protected inherited

Definition at line 400 of file OgreTerrainMaterialGenerator.h.

## mCompositeMapCam

Camera* Ogre::TerrainMaterialGenerator::mCompositeMapCam

protected inherited

Definition at line 404 of file OgreTerrainMaterialGenerator.h.

## mCompositeMapLight

Light* Ogre::TerrainMaterialGenerator::mCompositeMapLight

protected inherited

Definition at line 407 of file OgreTerrainMaterialGenerator.h.

## mCompositeMapPlane

ManualObject* Ogre::TerrainMaterialGenerator::mCompositeMapPlane

protected inherited

Definition at line 406 of file OgreTerrainMaterialGenerator.h.

## mCompositeMapRTT

Texture* Ogre::TerrainMaterialGenerator::mCompositeMapRTT

protected inherited

Definition at line 405 of file OgreTerrainMaterialGenerator.h.

## mCompositeMapSM

SceneManager* Ogre::TerrainMaterialGenerator::mCompositeMapSM

protected inherited

Definition at line 403 of file OgreTerrainMaterialGenerator.h.

## mDebugLevel

unsigned int Ogre::TerrainMaterialGenerator::mDebugLevel

protected inherited

Definition at line 402 of file OgreTerrainMaterialGenerator.h.

## mLayerDecl

TerrainLayerDeclaration Ogre::TerrainMaterialGenerator::mLayerDecl

protected inherited

Definition at line 401 of file OgreTerrainMaterialGenerator.h.

## mProfiles

ProfileList Ogre::TerrainMaterialGenerator::mProfiles

protected inherited

Definition at line 398 of file OgreTerrainMaterialGenerator.h.

The documentation for this class was generated from the following file:

- OgreTerrainMaterialGeneratorA.h

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.