Class Material
Graphics Material class.
Inherited Members
Namespace: Evergine.Framework.Graphics
Assembly: Evergine.Framework.dll
Syntax
public class Material : BaseMaterial, ILoadable, IDisposable, IDependencyObject
Constructors
Material(Effect)
Initializes a new instance of the Material class.
Declaration
public Material(Effect effect)
Parameters
Type | Name | Description |
---|---|---|
Effect | effect | Effect instance. |
Material(Effect, bool, bool)
Initializes a new instance of the Material class.
Declaration
public Material(Effect effect, bool isTexturesDependencyLinkEnabled, bool isSamplersDependencyLinkEnabled)
Parameters
Type | Name | Description |
---|---|---|
Effect | effect | Effect instance. |
bool | isTexturesDependencyLinkEnabled | if set to |
bool | isSamplersDependencyLinkEnabled | if set to |
Properties
AllowInstancing
Gets or sets a value indicating whether this material allows instancing.
Declaration
public bool AllowInstancing { get; set; }
Property Value
Type | Description |
---|---|
bool |
Dependencies
Gets the dependency list.
Declaration
public Lazy<List<IDependencyLink>> Dependencies { get; }
Property Value
Type | Description |
---|---|
Lazy<List<IDependency |
Id
Gets or sets the asset Id.
Declaration
public Guid Id { get; set; }
Property Value
Type | Description |
---|---|
Guid | The asset path. |
LayerDescription
Gets or sets the associated layer description.
Declaration
public RenderLayerDescription LayerDescription { get; set; }
Property Value
Type | Description |
---|---|
Render |
LoadedFromAssetsService
Gets a value indicating whether this material is loaded with the Asset Service.
Declaration
public bool LoadedFromAssetsService { get; }
Property Value
Type | Description |
---|---|
bool |
OrderBias
Gets or sets the order bias of the material. This value is used to modify the rendering order of the meshes.
Declaration
[RenderPropertyAsInput(-512, 511, AsSlider = true, DesiredChange = 1, DesiredLargeChange = 5)]
public int OrderBias { get; set; }
Property Value
Type | Description |
---|---|
int |
ReaderVersion
Gets the reader version.
Declaration
public Version ReaderVersion { get; }
Property Value
Type | Description |
---|---|
Version | The reader version. |
Methods
Clone()
Creates a copy of this Material and returns it.
Declaration
public Material Clone()
Returns
Type | Description |
---|---|
Material | This material cloned. |
Destroy()
Destroy all resources of this instance.
Declaration
protected override void Destroy()
Overrides
InitilizeEffect(Effect)
Initialize material with effect resources.
Declaration
protected override void InitilizeEffect(Effect effect)
Parameters
Type | Name | Description |
---|---|---|
Effect | effect | Effect instance. |
Overrides
Invalidate(ILoadable)
Invalidates this instance and raise the Invalidated event with the new ILoadable instance.
Declaration
public void Invalidate(ILoadable newInstance)
Parameters
ReleaseUnusedMemory()
Release unused memory.
Declaration
public void ReleaseUnusedMemory()
SetSampler(SamplerState, int)
Set sampler to the specified slot.
Declaration
public override void SetSampler(SamplerState sampler, int slot)
Parameters
Type | Name | Description |
---|---|---|
Sampler |
sampler | The sampler. |
int | slot | The sampler slot. |
Overrides
SetTexture(Texture, int)
Sets a texture to the specified slot.
Declaration
public override void SetTexture(Texture texture, int slot)
Parameters
Overrides
Events
Invalidated
Occurs when this instance has been invalidated and all references must be reloaded.
Declaration
public event EventHandler<ILoadable> Invalidated
Event Type
Type | Description |
---|---|
Event |