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
파일 보기 프로젝트 열기: WolfgangSt/axiom 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
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