Visual3D Game EngineAPI Documentation for XNA, C#, VB, and .NET
Class encapsulating the rendering properties of an object.

Namespace: Visual3D.Graphics3D
Assembly: Visual3D.Engine (in Visual3D.Engine.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

      
 C#  Visual Basic 
[SerializableAttribute]
public class OgreRenderMaterial : RenderMaterial
<SerializableAttribute> _
Public Class OgreRenderMaterial _
	Inherits RenderMaterial

Members

                  
 All Members  Constructors   Fields   Properties   Methods   Events  
 Public

 Protected
 Instance

 Static 
 Declared

 Inherited
 XNA Framework Only 

 .NET Compact Framework Only 

 MemberDescription
OgreRenderMaterial()()()()
Constructor. Creates an auto generated name for the material.
OgreRenderMaterial(String)
Contructor, taking the name of the material.
Ambient
AmbientColor
Gets/sets ambient color of material.
ApplyDefaults()()()()
AssetID (Inherited from Registered.)
AssetInfo (Inherited from Registered.)
AssetOwner
Gets or sets the owner to which this asset belongs and is a member of.
(Inherited from Asset.)
AttachedToOwner(IComponentOwner) (Inherited from EntityComponent.)
BaseAsset (Inherited from Registered.)
BeginPass(Int32, RenderContext) (Overrides RenderMaterial..::..BeginPass(Int32, RenderContext).)
Clone()()()()
Returns exact copy of material
(Inherited from RenderMaterial.)
Clone(String)
Creates a copy of this Material with the specified name (must be unique).
Compile()()()()
'Compiles' this Material.
Compile(Boolean)
'Compiles' this Material.
ComponentOwner
Owner of this component (contained in it's ".Components" container).
(Inherited from EntityComponent.)
Components
Components that are attached to this Entity.
(Inherited from ComponentBase.)
ComponentsForGlobalSceneFolders (Inherited from ComponentBase.)
Content
Context
Defines the Owner of this component as well as the role (i.e. 'slot') that this component fulfills.
(Inherited from ComponentBase.)
CopyTo(OgreRenderMaterial)
Copies the details of this material into another, preserving the target's handle and name (unlike operator=) but copying everything else.
CopyTo(OgreRenderMaterial, Boolean)
Copies the details of this material into another, preserving the target's handle and name (unlike operator=) but copying everything else.
CreateCopy()()()()
CreateIdentity()()()() (Inherited from Registered.)
CreateIdentityList()()()() (Inherited from Registered.)
CreateInstance(Boolean)
Creates an instance or non-inheriting duplicate of this asset.
(Inherited from Asset.)
CreateService<(Of <<'(TService>)>>)()()()() (Inherited from ComponentBase.)
CreateTechnique()()()()
Creates a new Technique for this Material.
CullingMode
DepthCheck
DepthWrite
DetachedFromOwner(IComponentOwner) (Inherited from EntityComponent.)
Diffuse
DiffuseColor
Gets/sets diffuse color of material.
Dispose()()()() (Inherited from ComponentBase.)
Disposed (Inherited from ComponentBase.)
EmissiveColor
Gets/sets emissive color of material.
EndPass(Int32, RenderContext)
Optionally cleans up render context after rendering given pass of material. Default implementation does nothing.
(Inherited from RenderMaterial.)
ErrorMessage
Returns error message in case if IsValid gets false. Materials are responsible for update this property during OnPrepareForUse.
(Inherited from RenderMaterial.)
FogDisabled
BaseSkyRendermaterial overrides this, based on EnableFogOnSky.
(Inherited from RenderMaterial.)
GetBestTechnique()()()()
GetBestTechnique(Int32)
GetHashCode()()()()
Overridden to give MaterialsOld a meaningful hash code.
(Overrides Object..::..GetHashCode()()()().)
GetNumberOfPasses(RenderContext) (Overrides RenderMaterial..::..GetNumberOfPasses(RenderContext).)
GetService<(Of <<'(TService>)>>)()()()() (Inherited from ComponentBase.)
GetService<(Of <<'(TService>)>>)(TService%) (Inherited from ComponentBase.)
GetTechnique(Int32)
Gets the technique at the specified index.
Handle (Inherited from Registered.)
HasComponents (Inherited from ComponentBase.)
HasHandle (Inherited from Registered.)
HasName (Inherited from EntityComponent.)
HasPrototype
Gets if a prototype has been specified to inherit instance data from.
(Inherited from Asset.)
HasScope (Inherited from Registered.)
HasUniqueName
Gets if a UniqueName is specified to identify this asset with respect to its owner's other members.
(Inherited from Registered.)
ID (Inherited from Registered.)
IDChanged (Inherited from Registered.)
Initialize()()()()
Initializes the asset so that it might be prepared for use. By default, PrepareForUse() is called from this method as well.
(Inherited from Asset.)
IsDeserialized
Indicates if Instance was created by Deserialization.
(Inherited from ComponentBase.)
IsDisposed
Indicates if resource has been disposed.
(Inherited from Asset.)
IsDisposing
Indicates if resource is in process of Disposing but not fully disposed.
(Inherited from Asset.)
IsInitialized
Gets if this entity is currently in an initialized (and non-disposed) state.
(Inherited from Asset.)
IsPrototype (Inherited from Asset.)
IsReadyForUse
Gets/sets if asset is ready to be used. Can be set to 'true' in class constructor in order to skip Preparation logic.
(Inherited from Asset.)
IsSaved
Indicates if the component is to be Saved when the owning context is saved (e.g. for components in your scene, this controls whether or not they are saved to the scene file when the scene is saved). Typically objects are 'Saved', unless they are transient to be programmatically created each time.
(Inherited from ComponentBase.)
IsSavedOnCreatingInstance (Inherited from Asset.)
IsValid
Returns true if material is valid. Unless material become ready for use, this property will return false. Actual value will be returned after first PrepareForUse call. Materials are responsible for update IsValid flag during OnPrepareForUse. See also ErrorMessage property for detailed error info.
(Inherited from RenderMaterial.)
Lighting
MaxLodLevels
Name (Inherited from EntityComponent.)
NamedParametersPS
Gets/sets dictionary of custom pixel shader parameters associated with material by name.
NamedParametersVS
Gets/sets dictionary of custom vertex shader parameters associated with material by name.
NameID (Inherited from EntityComponent.)
NumAnimationWeights
Gets/sets the number of animation weights for skinned models.
NumLodLevels
Gets the number of levels-of-detail this material has.
NumTechniques
Gets the number of techniques within this Material.
OnMemberwiseClone()()()() (Inherited from ComponentBase.)
OwnerActivated(IComponentOwner) (Inherited from EntityComponent.)
OwnerDeactivated(IComponentOwner) (Inherited from EntityComponent.)
OwnerOf<(Of <<'(TOwner>)>>)()()()() (Inherited from Registered.)
PrepareForUse()()()()
Attempts to prepare asset for use. To be sure, check "IsReadyForUse" after calling this method to ensure it's really ready for use before using it.
(Inherited from Asset.)
Prototype
Gets or sets the prototype, if specified, from which this asset inherits instance data.
(Inherited from Asset.)
QualifiedMaterialName
RemoveAllTechniques()()()()
Removes all techniques from this material.
RemoveTechnique(OgreRenderTechnique)
Removes the specified Technique from this material.
Scope (Inherited from Registered.)
SetBestTechnique(Int32, OgreRenderTechnique)
SetDynamicAttributes(RuntimeAttributeDictionary) (Inherited from RenderMaterial.)
SetFixedAttributes(RuntimeAttributeDictionary) (Inherited from RenderMaterial.)
SetSceneBlending(SceneBlendType)
SetSceneBlending(Blend, Blend)
SourceFile
Gets/Sets the source file for this program.
(Inherited from Asset.)
SpecularColor
Gets/sets specular color of material.
StorageModule (Inherited from Registered.)
Techniques
Gets lisf of techniques for this material (for easy access, rather than NumTechniques and GetTechnique).
TextureFiltering
ToString()()()()
Overridden.
(Overrides ComponentBase..::..ToString()()()().)
TransparencyMode
Gets/sets transparency mode used for pass grouping/sorting. Corresponds to the value of TransparencyMode property of the first pass in the first technique.
(Overrides RenderMaterial..::..TransparencyMode.)
UniqueName (Inherited from Registered.)

Remarks

The Material class encapsulates ALL aspects of the visual appearance, of an object. It also includes other flags which might not be traditionally thought of as material properties such as culling modes and depth buffer settings, but these affect the appearance of the rendered object and are convenient to attach to the material since it keeps all the settings in one place. This is different to XNA which treats a material as just the color components (diffuse, specular) and not texture maps etc. This Material can be thought of as equivalent to a 'Shader'.

A Material can be rendered in multiple different ways depending on the hardware available. You may configure a Material to use high-complexity fragment shaders, but these won't work on every card; therefore a Technique is an approach to creating the visual effect you are looking for. You are advised to create fallback techniques with lower hardware requirements if you decide to use advanced features. In addition, you also might want lower-detail techniques for distant geometry.

Each technique can be made up of multiple passes. A fixed-function pass may combine multiple texture layers using multi-texturing, but they can break that into multiple passes automatically if the active card cannot handle that many simultaneous textures. Programmable passes, however, cannot be split down automatically, so if the active graphics card cannot handle the technique which contains these passes, the engine will try to find another technique which the card can do. If, at the end of the day, the card cannot handle any of the techniques which are listed for the material, the engine will render the geometry plain white, which should alert you to the problem.

The engine comes configured with a number of default settings for a newly created material. These can be changed if you wish by retrieving the default material settings through SceneManager.DefaultMaterialSettings. Any changes you make to the Material returned from this method will apply to any materials created from this point onward.

Inheritance Hierarchy

System..::..Object
  Visual3D.EntityModel..::..ComponentBase
    Visual3D.EntityModel..::..EntityComponent
      Visual3D..::..Registered
        Visual3D..::..Asset
          Visual3D.Graphics3D.MaterialRendering..::..RenderMaterial
            Visual3D.Graphics3D..::..OgreRenderMaterial

See Also