Table of Contents

Class MaterialInstance

Namespace
Stride.Rendering
Assembly
Stride.Rendering.dll

A Material instance.

[DataContract("MaterialInstance")]
public class MaterialInstance : IEquatable<MaterialInstance>
Inheritance
MaterialInstance
Implements

Constructors

MaterialInstance()

Initializes a new instance of the MaterialInstance class.

public MaterialInstance()

MaterialInstance(Material)

Initializes a new instance of the MaterialInstance class.

public MaterialInstance(Material material)

Parameters

material Material

The material.

Properties

IsShadowCaster

Gets or sets if this instance is casting shadows.

[DataMember(20)]
[Display("Cast Shadows?", null)]
public bool IsShadowCaster { get; set; }

Property Value

bool

A boolean indicating whether this instance is casting shadows. Default is true.

Material

Gets or sets the material.

[DataMember(10)]
public Material Material { get; set; }

Property Value

Material

The material.

Methods

Equals(MaterialInstance)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(MaterialInstance other)

Parameters

other MaterialInstance

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Determines whether the specified object is equal to the current object.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

Operators

operator ==(MaterialInstance, MaterialInstance)

public static bool operator ==(MaterialInstance left, MaterialInstance right)

Parameters

left MaterialInstance
right MaterialInstance

Returns

bool

implicit operator MaterialInstance(Material)

Performs an explicit conversion from Material to MaterialInstance.

public static implicit operator MaterialInstance(Material material)

Parameters

material Material

The material.

Returns

MaterialInstance

The result of the conversion.

operator !=(MaterialInstance, MaterialInstance)

public static bool operator !=(MaterialInstance left, MaterialInstance right)

Parameters

left MaterialInstance
right MaterialInstance

Returns

bool