Class Material
Graphics material class.
Inherited Members
Namespace: Evergine.Framework.Graphics
Assembly: Evergine.Framework.dll
Syntax
public class Material : BaseMaterial, ILoadable, 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 instantiation.
Declaration
public bool AllowInstancing { get; set; }
Property Value
Type | Description |
---|---|
bool |
Dependencies
Gets the list of dependencies.
Declaration
public Lazy<List<IDependencyLink>> Dependencies { get; }
Property Value
Type | Description |
---|---|
Lazy<List<IDependencyLink>> |
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 description of the associated layer.
Declaration
public RenderLayerDescription LayerDescription { get; set; }
Property Value
Type | Description |
---|---|
RenderLayerDescription |
LoadedFromAssetsService
Gets a value indicating whether this material is loaded by 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 mesh.
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 | A clone of this material. |
Destroy()
Destroys all resources of this instance.
Declaration
protected override void Destroy()
Overrides
InitilizeEffect(Effect)
Initializes 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 raises the Invalidated event with the new ILoadable instance.
Declaration
public void Invalidate(ILoadable newInstance)
Parameters
Type | Name | Description |
---|---|---|
ILoadable | newInstance | The new ILoadable instance. |
ReleaseUnusedMemory()
Releases unused memory.
Declaration
public void ReleaseUnusedMemory()
SetSampler(SamplerState, int)
Sets the sampler to the specified slot.
Declaration
public override void SetSampler(SamplerState sampler, int slot)
Parameters
Type | Name | Description |
---|---|---|
SamplerState | 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
Type | Name | Description |
---|---|---|
Texture | texture | The texture. |
int | slot | The texture's slot. |
Overrides
Events
Invalidated
Occurs when this instance is invalidated and all references must be reloaded.
Declaration
public event EventHandler<ILoadable> Invalidated
Event Type
Type | Description |
---|---|
EventHandler<ILoadable> |