Class MaterialBase
Base class for Material and MaterialInstance.
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public abstract class MaterialBase : BinaryAsset
Constructors
MaterialBase()
Properties
Info
Gets the material info, structure which describes material surface.
Declaration
[Unmanaged]
public MaterialInfo Info { get; }
Property Value
MaterialInfo
|
IsDecal
Gets a value indicating whether this material is decal (cannot be used with a normal meshes).
Declaration
public bool IsDecal { get; }
Property Value
System.Boolean
|
IsGUI
Gets a value indicating whether this material is a GUI shader (cannot be used with a normal meshes).
Declaration
public bool IsGUI { get; }
Property Value
System.Boolean
|
IsParticle
Gets a value indicating whether this material is a particle shader (cannot be used with a normal meshes).
Declaration
public bool IsParticle { get; }
Property Value
System.Boolean
|
IsPostFx
Gets a value indicating whether this material is post fx (cannot be used with a normal meshes).
Declaration
public bool IsPostFx { get; }
Property Value
System.Boolean
|
IsSurface
Gets a value indicating whether this material is a surface shader (can be used with a normal meshes).
Declaration
public bool IsSurface { get; }
Property Value
System.Boolean
|
IsTerrain
Gets a value indicating whether this material is a terrain shader (cannot be used with a normal meshes).
Declaration
public bool IsTerrain { get; }
Property Value
System.Boolean
|
Parameters
Gets the material parameters collection.
Declaration
[Unmanaged]
public MaterialParameter[] Parameters { get; }
Property Value
MaterialParameter[]
|
Methods
CreateVirtualInstance()
Creates the virtual material instance of this material which allows to override any material parameters.
Declaration
[Unmanaged]
public MaterialInstance CreateVirtualInstance()
Returns
MaterialInstance
The created virtual material instance asset. |
GetParameter(String)
Gets the material parameter.
Declaration
[Unmanaged]
public MaterialParameter GetParameter(string name)
Parameters
System.String
name
|
Returns
MaterialParameter
|
GetParameterValue(String)
Gets the material parameter value.
Declaration
[Unmanaged]
public object GetParameterValue(string name)
Parameters
System.String
name
|
Returns
System.Object
The parameter value. |
SetParameterValue(String, Object, Boolean)
Sets the material parameter value (and sets IsOverride to true).
Declaration
[Unmanaged]
public void SetParameterValue(string name, object value, bool warnIfMissing = true)
Parameters
System.String
name
The parameter name. |
System.Object
value
The value to set. |
System.Boolean
warnIfMissing
True if warn if parameter is missing, otherwise will do nothing. |