OGRE  1.7
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Ogre::TerrainMaterialGeneratorA Class Reference

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

#include <OgreTerrainMaterialGeneratorA.h>

+ Inheritance diagram for Ogre::TerrainMaterialGeneratorA:
+ Collaboration diagram for Ogre::TerrainMaterialGeneratorA:

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 ()
 
 ~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...
 
ProfilegetActiveProfile () 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 ProfileListgetProfiles () const
 Get the list of profiles that this generator supports. 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 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

ProfilemActiveProfile
 
unsigned long long int mChangeCounter
 
CameramCompositeMapCam
 
LightmCompositeMapLight
 
ManualObjectmCompositeMapPlane
 
TexturemCompositeMapRTT
 
SceneManagermCompositeMapSM
 
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

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

Definition at line 203 of file OgreTerrainMaterialGenerator.h.

Constructor & Destructor Documentation

Ogre::TerrainMaterialGeneratorA::TerrainMaterialGeneratorA ( )
Ogre::TerrainMaterialGeneratorA::~TerrainMaterialGeneratorA ( )

Member Function Documentation

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

Definition at line 370 of file OgreTerrainMaterialGenerator.h.

void Ogre::TerrainMaterialGenerator::_markChanged ( )
inlineinherited

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

Definition at line 246 of file OgreTerrainMaterialGenerator.h.

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

Helper method to render a composite map.

Parameters
sizeThe requested composite map size
rectThe region of the composite map to update, in image space
matThe material to use to render the map
outBoxThe box region of the texture which has been updated, and should be copied into your final texture
virtual bool Ogre::TerrainMaterialGenerator::canGenerateUsingDeclaration ( const TerrainLayerDeclaration decl)
inlinevirtualinherited

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 262 of file OgreTerrainMaterialGenerator.h.

virtual MaterialPtr Ogre::TerrainMaterialGenerator::generate ( const Terrain terrain)
inlinevirtualinherited

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

Definition at line 278 of file OgreTerrainMaterialGenerator.h.

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

virtual MaterialPtr Ogre::TerrainMaterialGenerator::generateForCompositeMap ( const Terrain terrain)
inlinevirtualinherited

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

Definition at line 288 of file OgreTerrainMaterialGenerator.h.

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

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

Get the active profile.

Definition at line 236 of file OgreTerrainMaterialGenerator.h.

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

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

Definition at line 251 of file OgreTerrainMaterialGenerator.h.

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

Get the debug level of the material.

Definition at line 358 of file OgreTerrainMaterialGenerator.h.

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

Get the layer declaration that this material generator operates with.

Definition at line 255 of file OgreTerrainMaterialGenerator.h.

virtual uint8 Ogre::TerrainMaterialGenerator::getMaxLayers ( const Terrain terrain) const
inlinevirtualinherited

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 299 of file OgreTerrainMaterialGenerator.h.

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

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

Get the list of profiles that this generator supports.

Definition at line 207 of file OgreTerrainMaterialGenerator.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr)
inlineinherited

Definition at line 95 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
void *   
)
inlineinherited

Definition at line 101 of file OgreMemoryAllocatedObject.h.

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

Definition at line 107 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr)
inlineinherited

Definition at line 112 of file OgreMemoryAllocatedObject.h.

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

Definition at line 118 of file OgreMemoryAllocatedObject.h.

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

operator new, with debug line info

Definition at line 67 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz)
inlineinherited

Definition at line 72 of file OgreMemoryAllocatedObject.h.

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

placement operator new

Definition at line 78 of file OgreMemoryAllocatedObject.h.

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

array operator new, with debug line info

Definition at line 85 of file OgreMemoryAllocatedObject.h.

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

Definition at line 90 of file OgreMemoryAllocatedObject.h.

virtual void Ogre::TerrainMaterialGenerator::requestOptions ( Terrain terrain)
inlinevirtualinherited

Triggers the generator to request the options that it needs.

Definition at line 269 of file OgreTerrainMaterialGenerator.h.

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

virtual void Ogre::TerrainMaterialGenerator::setActiveProfile ( const String name)
inlinevirtualinherited

Set the active profile by name.

Definition at line 210 of file OgreTerrainMaterialGenerator.h.

virtual void Ogre::TerrainMaterialGenerator::setActiveProfile ( Profile p)
inlinevirtualinherited

Set the active Profile.

Definition at line 227 of file OgreTerrainMaterialGenerator.h.

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

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 349 of file OgreTerrainMaterialGenerator.h.

virtual void Ogre::TerrainMaterialGenerator::updateCompositeMap ( const Terrain terrain,
const Rect rect 
)
inlinevirtualinherited

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 314 of file OgreTerrainMaterialGenerator.h.

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

virtual void Ogre::TerrainMaterialGenerator::updateParams ( const MaterialPtr mat,
const Terrain terrain 
)
inlinevirtualinherited

Update parameters for the given terrain using the active profile.

Definition at line 326 of file OgreTerrainMaterialGenerator.h.

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

virtual void Ogre::TerrainMaterialGenerator::updateParamsForCompositeMap ( const MaterialPtr mat,
const Terrain terrain 
)
inlinevirtualinherited

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

Definition at line 334 of file OgreTerrainMaterialGenerator.h.

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

Member Data Documentation

Profile* Ogre::TerrainMaterialGenerator::mActiveProfile
mutableprotectedinherited

Definition at line 374 of file OgreTerrainMaterialGenerator.h.

unsigned long long int Ogre::TerrainMaterialGenerator::mChangeCounter
protectedinherited

Definition at line 375 of file OgreTerrainMaterialGenerator.h.

Camera* Ogre::TerrainMaterialGenerator::mCompositeMapCam
protectedinherited

Definition at line 379 of file OgreTerrainMaterialGenerator.h.

Light* Ogre::TerrainMaterialGenerator::mCompositeMapLight
protectedinherited

Definition at line 382 of file OgreTerrainMaterialGenerator.h.

ManualObject* Ogre::TerrainMaterialGenerator::mCompositeMapPlane
protectedinherited

Definition at line 381 of file OgreTerrainMaterialGenerator.h.

Texture* Ogre::TerrainMaterialGenerator::mCompositeMapRTT
protectedinherited

Definition at line 380 of file OgreTerrainMaterialGenerator.h.

SceneManager* Ogre::TerrainMaterialGenerator::mCompositeMapSM
protectedinherited

Definition at line 378 of file OgreTerrainMaterialGenerator.h.

unsigned int Ogre::TerrainMaterialGenerator::mDebugLevel
protectedinherited

Definition at line 377 of file OgreTerrainMaterialGenerator.h.

TerrainLayerDeclaration Ogre::TerrainMaterialGenerator::mLayerDecl
protectedinherited

Definition at line 376 of file OgreTerrainMaterialGenerator.h.

ProfileList Ogre::TerrainMaterialGenerator::mProfiles
protectedinherited

Definition at line 373 of file OgreTerrainMaterialGenerator.h.


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