C# Класс Axiom.Components.Terrain.TerrainMaterialGenerator

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:
  • Hardware support (static)
  • Texture instances assigned to a particular terrain (dynamic in an editor)
  • User selection (e.g. changing to a cheaper option in order to increase performance, or in order to test how the material might look on other hardware (dynamic)
Subclasses of this class are responsible for responding to these factors and to generate a terrain material. @par In order to cope with both hardware support and user selection, the generator must expose a number of named 'profiles'. These profiles should function on a known range of hardware, and be graded by quality. At runtime, the user should be able to select the profile they wish to use (provided hardware support is available).
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
mActiveProfile Profile
mChangeCounter int
mCompositeMapCam Axiom.Core.Camera
mCompositeMapLight Axiom.Core.Light
mCompositeMapPlane ManualObject
mCompositeMapRTT Axiom.Core.Texture
mCompositeMapSM Axiom.Core.SceneManager
mDebugLevel uint
mLayerDecl TerrainLayerDeclaration
mProfiles List

Открытые методы

Метод Описание
CanGenerateUsingDeclaration ( TerrainLayerDeclaration decl ) : bool

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.

Dispose ( ) : void
Generate ( Axiom.Components.Terrain.Terrain terrain ) : Material

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

GenerateForCompositeMap ( Axiom.Components.Terrain.Terrain terrain ) : Material

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

GetMaxLayers ( Axiom.Components.Terrain.Terrain terrain ) : byte

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

MarkChanged ( ) : void

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

RenderCompositeMap ( int size, Rectangle rect, Material mat, Axiom.Core.Texture destCompositeMap ) : void

Helper method to render a composite map.

RequestOption ( Axiom.Components.Terrain.Terrain terrain ) : void

Triggers the generator to request the options that it needs.

SetActiveProfile ( string name ) : void

Set the active profile by name.

UpdateCompositeMap ( Axiom.Components.Terrain.Terrain terrain, Rectangle rect ) : void

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.

UpdateParams ( Material mat, Axiom.Components.Terrain.Terrain terrain ) : void

Update parameters for the given terrain using the active profile.

UpdateParamsForCompositeMap ( Material mat, Axiom.Components.Terrain.Terrain terrain ) : void

Update parameters for the given terrain using the active profile.

Описание методов

CanGenerateUsingDeclaration() публичный метод

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.
public CanGenerateUsingDeclaration ( TerrainLayerDeclaration decl ) : bool
decl TerrainLayerDeclaration
Результат bool

Dispose() публичный метод

public Dispose ( ) : void
Результат void

Generate() публичный метод

Generate a material for the given terrain using the active profile.
public Generate ( Axiom.Components.Terrain.Terrain terrain ) : Material
terrain Axiom.Components.Terrain.Terrain
Результат Axiom.Graphics.Material

GenerateForCompositeMap() публичный метод

Generate a material for the given composite map of the terrain using the active profile.
public GenerateForCompositeMap ( Axiom.Components.Terrain.Terrain terrain ) : Material
terrain Axiom.Components.Terrain.Terrain
Результат Axiom.Graphics.Material

GetMaxLayers() публичный метод

Get the maximum number of layers supported with the given terrain.
public GetMaxLayers ( Axiom.Components.Terrain.Terrain terrain ) : byte
terrain Axiom.Components.Terrain.Terrain
Результат byte

MarkChanged() публичный метод

Internal method - indicates that a change has been made that would require material regeneration
public MarkChanged ( ) : void
Результат void

RenderCompositeMap() публичный метод

Helper method to render a composite map.
public RenderCompositeMap ( int size, Rectangle rect, Material mat, Axiom.Core.Texture destCompositeMap ) : void
size int The requested composite map size
rect Axiom.Core.Rectangle The region of the composite map to update, in image space
mat Axiom.Graphics.Material The material to use to render the map
destCompositeMap Axiom.Core.Texture
Результат void

RequestOption() публичный метод

Triggers the generator to request the options that it needs.
public RequestOption ( Axiom.Components.Terrain.Terrain terrain ) : void
terrain Axiom.Components.Terrain.Terrain
Результат void

SetActiveProfile() публичный метод

Set the active profile by name.
public SetActiveProfile ( string name ) : void
name string name of the profile
Результат void

UpdateCompositeMap() публичный метод

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.
public UpdateCompositeMap ( Axiom.Components.Terrain.Terrain terrain, Rectangle rect ) : void
terrain Axiom.Components.Terrain.Terrain
rect Axiom.Core.Rectangle
Результат void

UpdateParams() публичный метод

Update parameters for the given terrain using the active profile.
public UpdateParams ( Material mat, Axiom.Components.Terrain.Terrain terrain ) : void
mat Axiom.Graphics.Material
terrain Axiom.Components.Terrain.Terrain
Результат void

UpdateParamsForCompositeMap() публичный метод

Update parameters for the given terrain using the active profile.
public UpdateParamsForCompositeMap ( Material mat, Axiom.Components.Terrain.Terrain terrain ) : void
mat Axiom.Graphics.Material
terrain Axiom.Components.Terrain.Terrain
Результат void

Описание свойств

mActiveProfile защищенное свойство

the currently active profile
protected Profile mActiveProfile
Результат Profile

mChangeCounter защищенное свойство

protected int mChangeCounter
Результат int

mCompositeMapCam защищенное свойство

protected Camera,Axiom.Core mCompositeMapCam
Результат Axiom.Core.Camera

mCompositeMapLight защищенное свойство

protected Light,Axiom.Core mCompositeMapLight
Результат Axiom.Core.Light

mCompositeMapPlane защищенное свойство

protected ManualObject mCompositeMapPlane
Результат ManualObject

mCompositeMapRTT защищенное свойство

deliberately holding this by raw pointer to avoid shutdown issues
protected Texture,Axiom.Core mCompositeMapRTT
Результат Axiom.Core.Texture

mCompositeMapSM защищенное свойство

protected SceneManager,Axiom.Core mCompositeMapSM
Результат Axiom.Core.SceneManager

mDebugLevel защищенное свойство

protected uint mDebugLevel
Результат uint

mLayerDecl защищенное свойство

protected TerrainLayerDeclaration,Axiom.Components.Terrain mLayerDecl
Результат TerrainLayerDeclaration

mProfiles защищенное свойство

List of profiles - NB should be ordered in descending complexity
protected List mProfiles
Результат List