C# 클래스 Axiom.Graphics.Material

Class encapsulating the rendering properties of an object.
상속: Axiom.Core.Resource, IComparable
파일 보기 프로젝트 열기: WolfgangSt/axiom 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
UserLodValues LodValueList
autoNumber int
bestTechniquesByScheme Dictionary>
defaultSettings Material

공개 메소드들

메소드 설명
ApplyDefaults ( ) : void

ApplyTextureAliases ( string>.Dictionary aliasList ) : bool
ApplyTextureAliases ( string>.Dictionary aliasList, bool apply ) : bool

Applies texture names to Texture Unit State with matching texture name aliases. All techniques, passes, and Texture Unit States within the material are checked. If matching texture aliases are found then true is returned.

Clone ( string newName ) : Material

Creates a copy of this Material with the specified name (must be unique).

Clone ( string newName, bool changeGroup, string newGroup ) : Material
CompareTo ( object obj ) : int

Used for comparing 2 Material objects.

This comparison will be used in RenderQueue group sorting of Materials materials. If this object is transparent and the object being compared is not, this is greater that obj. If this object is not transparent and the object being compared is, obj is greater than this.

Compile ( ) : void

'Compiles' this Material.

Compiling a material involves determining which Techniques are supported on the card on which the engine is currently running, and for fixed-function Passes within those Techniques, splitting the passes down where they contain more TextureUnitState instances than the current card has texture units.

This process is automatically done when the Material is loaded, but may be repeated if you make some procedural changes.By default, the engine will automatically split texture unit operations into multiple passes when the target hardware does not have enough texture units.

Compile ( bool autoManageTextureUnits ) : void
CopyTo ( Material target ) : void

Copies the details from the supplied material.

CopyTo ( Material target, bool copyUniqueInfo ) : void
CreateTechnique ( ) : Technique

Creates a new Technique for this Material.

A Technique is a single way of rendering geometry in order to achieve the effect you are intending in a material. There are many reason why you would want more than one - the main one being to handle variable graphics card abilities; you might have one technique which is impressive but only runs on 4th-generation graphics cards, for example. In this case you will want to create at least one fallback Technique. The engine will work out which Techniques a card can support and pick the best one.

If multiple Techniques are available, the order in which they are created is important - the engine will consider lower-indexed Techniques to be preferable to higher-indexed Techniques, ie when asked for the 'best' technique it will return the first one in the technique list which is supported by the hardware.

GetBestTechnique ( ) : Technique

Gets the best supported technique.

This method returns the lowest-index supported Technique in this material (since lower-indexed Techniques are considered to be better than higher-indexed ones).

The best supported technique is only available after this material has been compiled, which typically happens on loading the material. Therefore, if this method returns null, try calling Material.Load.

GetBestTechnique ( int lodIndex ) : Technique
GetBestTechnique ( int lodIndex, IRenderable renderable ) : Technique
GetHashCode ( ) : int

Overridden to give Materials a meaningful hash code.

GetLodIndex ( Real distance ) : int

Gets the LOD index to use at the given distance.

The value passed in is the 'transformed' value. If you are dealing with an original source value (e.g. distance), use to turn this into a lookup value.

GetTechnique ( int index ) : Technique

Gets the technique at the specified index.

Material ( ResourceManager parent, string name, System.UInt64 handle, string group ) : System
Material ( ResourceManager parent, string name, System.UInt64 handle, string group, bool isManual, IManualResourceLoader loader ) : System
RemoveAllTechniques ( ) : void

Removes all techniques from this material.

RemoveTechnique ( Technique t ) : void

Removes the specified Technique from this material.

SetFog ( bool overrideScene ) : void
SetFog ( bool overrideScene, FogMode mode, ColorEx color, System.Single expDensity, System.Single linearStart, System.Single linearEnd ) : void

Sets the fogging mode applied to each pass.

This property has been moved to the Pass class, which is accessible via the Technique. For simplicity, this method allows you to set these properties for every current Technique, and for every current Pass within those Techniques. If you need more precision, retrieve the Technique and Pass instances and set the property there.

SetLodLevels ( LodValueList lodDistanceList ) : void

Sets the distance at which level-of-detail (LOD) levels come into effect.

You should only use this if you have assigned LOD indexes to the Technique instances attached to this Material. If you have done so, you should call this method to determine the distance at which the low levels of detail kick in. The decision about what distance is actually used is a combination of this and the LOD bias applied to both the current Camera and the current Entity.

SetSceneBlending ( SceneBlendFactor src, SceneBlendFactor dest ) : void

Allows very fine control of blending every Pass with the existing contents of the scene.

This property has been moved to the Pass class, which is accessible via the Technique. For simplicity, this method allows you to set these properties for every current Technique, and for every current Pass within those Techniques. If you need more precision, retrieve the Technique and Pass instances and set the property there.

SetSceneBlending ( SceneBlendType blendType ) : void

Sets the kind of blending every pass has with the existing contents of the scene.

This property has been moved to the Pass class, which is accessible via the Technique. For simplicity, this method allows you to set these properties for every current Technique, and for every current Pass within those Techniques. If you need more precision, retrieve the Technique and Pass instances and set the property there.

ToString ( ) : string

Overridden.

Touch ( ) : void

Overridden to ensure a recompile occurs if needed before use.

보호된 메소드들

메소드 설명
calculateSize ( ) : int

Calculate the size of a material; this will only be called after 'load'

dispose ( bool disposeManagedResources ) : void

Overridden to ensure a release of techniques.

load ( ) : void

Overridden from Resource.

By default, Materials are not loaded, and adding additional textures etc do not cause those textures to be loaded. When the Load method is called, all textures are loaded (if they are not already), GPU programs are created if applicable, and Controllers are instantiated. Once a material has been loaded, all changes made to it are immediately loaded too

unload ( ) : void

Unloads the material, frees resources etc. Resource

비공개 메소드들

메소드 설명
ClearBestTechniqueList ( ) : void
InsertSupportedTechnique ( Technique technique ) : void
NotifyNeedsRecompile ( ) : void

Tells the material that it needs recompilation.

메소드 상세

ApplyDefaults() 공개 메소드

public ApplyDefaults ( ) : void
리턴 void

ApplyTextureAliases() 공개 메소드

public ApplyTextureAliases ( string>.Dictionary aliasList ) : bool
aliasList string>.Dictionary
리턴 bool

ApplyTextureAliases() 공개 메소드

Applies texture names to Texture Unit State with matching texture name aliases. All techniques, passes, and Texture Unit States within the material are checked. If matching texture aliases are found then true is returned.
public ApplyTextureAliases ( string>.Dictionary aliasList, bool apply ) : bool
aliasList string>.Dictionary is a map container of texture alias, texture name pairs
apply bool set true to apply the texture aliases else just test to see if texture alias matches are found.
리턴 bool

Clone() 공개 메소드

Creates a copy of this Material with the specified name (must be unique).
public Clone ( string newName ) : Material
newName string The name that the cloned material will be known as.
리턴 Material

Clone() 공개 메소드

public Clone ( string newName, bool changeGroup, string newGroup ) : Material
newName string
changeGroup bool
newGroup string
리턴 Material

CompareTo() 공개 메소드

Used for comparing 2 Material objects.
This comparison will be used in RenderQueue group sorting of Materials materials. If this object is transparent and the object being compared is not, this is greater that obj. If this object is not transparent and the object being compared is, obj is greater than this.
public CompareTo ( object obj ) : int
obj object
리턴 int

Compile() 공개 메소드

'Compiles' this Material.
Compiling a material involves determining which Techniques are supported on the card on which the engine is currently running, and for fixed-function Passes within those Techniques, splitting the passes down where they contain more TextureUnitState instances than the current card has texture units.

This process is automatically done when the Material is loaded, but may be repeated if you make some procedural changes. By default, the engine will automatically split texture unit operations into multiple passes when the target hardware does not have enough texture units.

public Compile ( ) : void
리턴 void

Compile() 공개 메소드

public Compile ( bool autoManageTextureUnits ) : void
autoManageTextureUnits bool /// If true, when a fixed function pass has too many TextureUnitState /// entries than the card has texture units, the Pass in question will be split into /// more than one Pass in order to emulate the Pass. If you set this to false and /// this situation arises, an Exception will be thrown. ///
리턴 void

CopyTo() 공개 메소드

Copies the details from the supplied material.
public CopyTo ( Material target ) : void
target Material Material which will receive this material's settings.
리턴 void

CopyTo() 공개 메소드

public CopyTo ( Material target, bool copyUniqueInfo ) : void
target Material
copyUniqueInfo bool preserves the target's handle, group, name, and loading properties (unlike operator=) but copying everything else.
리턴 void

CreateTechnique() 공개 메소드

Creates a new Technique for this Material.
A Technique is a single way of rendering geometry in order to achieve the effect you are intending in a material. There are many reason why you would want more than one - the main one being to handle variable graphics card abilities; you might have one technique which is impressive but only runs on 4th-generation graphics cards, for example. In this case you will want to create at least one fallback Technique. The engine will work out which Techniques a card can support and pick the best one.

If multiple Techniques are available, the order in which they are created is important - the engine will consider lower-indexed Techniques to be preferable to higher-indexed Techniques, ie when asked for the 'best' technique it will return the first one in the technique list which is supported by the hardware.

public CreateTechnique ( ) : Technique
리턴 Technique

GetBestTechnique() 공개 메소드

Gets the best supported technique.
This method returns the lowest-index supported Technique in this material (since lower-indexed Techniques are considered to be better than higher-indexed ones).

The best supported technique is only available after this material has been compiled, which typically happens on loading the material. Therefore, if this method returns null, try calling Material.Load.

public GetBestTechnique ( ) : Technique
리턴 Technique

GetBestTechnique() 공개 메소드

public GetBestTechnique ( int lodIndex ) : Technique
lodIndex int
리턴 Technique

GetBestTechnique() 공개 메소드

public GetBestTechnique ( int lodIndex, IRenderable renderable ) : Technique
lodIndex int
renderable IRenderable
리턴 Technique

GetHashCode() 공개 메소드

Overridden to give Materials a meaningful hash code.
public GetHashCode ( ) : int
리턴 int

GetLodIndex() 공개 메소드

Gets the LOD index to use at the given distance.
The value passed in is the 'transformed' value. If you are dealing with an original source value (e.g. distance), use to turn this into a lookup value.
public GetLodIndex ( Real distance ) : int
distance Real
리턴 int

GetTechnique() 공개 메소드

Gets the technique at the specified index.
public GetTechnique ( int index ) : Technique
index int Index of the technique to return.
리턴 Technique

Material() 공개 메소드

public Material ( ResourceManager parent, string name, System.UInt64 handle, string group ) : System
parent Axiom.Core.ResourceManager
name string
handle System.UInt64
group string
리턴 System

Material() 공개 메소드

public Material ( ResourceManager parent, string name, System.UInt64 handle, string group, bool isManual, IManualResourceLoader loader ) : System
parent Axiom.Core.ResourceManager
name string
handle System.UInt64
group string
isManual bool
loader IManualResourceLoader
리턴 System

RemoveAllTechniques() 공개 메소드

Removes all techniques from this material.
public RemoveAllTechniques ( ) : void
리턴 void

RemoveTechnique() 공개 메소드

Removes the specified Technique from this material.
public RemoveTechnique ( Technique t ) : void
t Technique A reference to the technique to remove
리턴 void

SetFog() 공개 메소드

public SetFog ( bool overrideScene ) : void
overrideScene bool
리턴 void

SetFog() 공개 메소드

Sets the fogging mode applied to each pass.
This property has been moved to the Pass class, which is accessible via the Technique. For simplicity, this method allows you to set these properties for every current Technique, and for every current Pass within those Techniques. If you need more precision, retrieve the Technique and Pass instances and set the property there.
public SetFog ( bool overrideScene, FogMode mode, ColorEx color, System.Single expDensity, System.Single linearStart, System.Single linearEnd ) : void
overrideScene bool
mode FogMode
color ColorEx
expDensity System.Single
linearStart System.Single
linearEnd System.Single
리턴 void

SetLodLevels() 공개 메소드

Sets the distance at which level-of-detail (LOD) levels come into effect.
You should only use this if you have assigned LOD indexes to the Technique instances attached to this Material. If you have done so, you should call this method to determine the distance at which the low levels of detail kick in. The decision about what distance is actually used is a combination of this and the LOD bias applied to both the current Camera and the current Entity.
public SetLodLevels ( LodValueList lodDistanceList ) : void
lodDistanceList LodValueList /// A list of floats which indicate the distance at which to /// switch to lower details. They are listed in LOD index order, starting at index /// 1 (ie the first level down from the highest level 0, which automatically applies /// from a distance of 0). ///
리턴 void

SetSceneBlending() 공개 메소드

Allows very fine control of blending every Pass with the existing contents of the scene.
This property has been moved to the Pass class, which is accessible via the Technique. For simplicity, this method allows you to set these properties for every current Technique, and for every current Pass within those Techniques. If you need more precision, retrieve the Technique and Pass instances and set the property there.
public SetSceneBlending ( SceneBlendFactor src, SceneBlendFactor dest ) : void
src SceneBlendFactor
dest SceneBlendFactor
리턴 void

SetSceneBlending() 공개 메소드

Sets the kind of blending every pass has with the existing contents of the scene.
This property has been moved to the Pass class, which is accessible via the Technique. For simplicity, this method allows you to set these properties for every current Technique, and for every current Pass within those Techniques. If you need more precision, retrieve the Technique and Pass instances and set the property there.
public SetSceneBlending ( SceneBlendType blendType ) : void
blendType SceneBlendType
리턴 void

ToString() 공개 메소드

Overridden.
public ToString ( ) : string
리턴 string

Touch() 공개 메소드

Overridden to ensure a recompile occurs if needed before use.
public Touch ( ) : void
리턴 void

calculateSize() 보호된 메소드

Calculate the size of a material; this will only be called after 'load'
protected calculateSize ( ) : int
리턴 int

dispose() 보호된 메소드

Overridden to ensure a release of techniques.
protected dispose ( bool disposeManagedResources ) : void
disposeManagedResources bool
리턴 void

load() 보호된 메소드

Overridden from Resource.
By default, Materials are not loaded, and adding additional textures etc do not cause those textures to be loaded. When the Load method is called, all textures are loaded (if they are not already), GPU programs are created if applicable, and Controllers are instantiated. Once a material has been loaded, all changes made to it are immediately loaded too
protected load ( ) : void
리턴 void

unload() 보호된 메소드

Unloads the material, frees resources etc. Resource
protected unload ( ) : void
리턴 void

프로퍼티 상세

UserLodValues 보호되어 있는 프로퍼티

List of LOD distances specified for this material.
protected LodValueList UserLodValues
리턴 LodValueList

autoNumber 보호되어 있는 정적으로 프로퍼티

Auto incrementing number for creating unique names.
protected static int autoNumber
리턴 int

bestTechniquesByScheme 보호되어 있는 프로퍼티

protected Dictionary> bestTechniquesByScheme
리턴 Dictionary>

defaultSettings 보호되어 있는 정적으로 프로퍼티

A reference to a precreated Material that contains all the default settings.
protected static Material,Axiom.Graphics defaultSettings
리턴 Material