Class MaterialConstructor
Construction object to store properties of materials to create them later
Inheritance
Namespace: i5.Toolkit.Core.ProceduralGeometry
Assembly: cs.temp.dll.dll
Syntax
public class MaterialConstructor
Constructors
MaterialConstructor()
Initializes the material constructor with default values
Declaration
public MaterialConstructor()
MaterialConstructor(string)
Initializes the material constructor with a given shader
Declaration
public MaterialConstructor(string shaderName)
Parameters
Type | Name | Description |
---|---|---|
string | shaderName | The name of the shader |
Properties
Color
The main color of the material
Declaration
public Color Color { get; set; }
Property Value
Type | Description |
---|---|
Color |
Name
The name of the material
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
ShaderName
The name of the shader that the material should use
Declaration
public string ShaderName { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
ConstructMaterial()
Constructs a material from the specified data in this constructor
Declaration
public Material ConstructMaterial()
Returns
Type | Description |
---|---|
Material | Returns the constructed material |
FetchDependencies()
Fetches any dependencies of the material, e.g. textures Call this method before constructing the material
Declaration
public Task<bool> FetchDependencies()
Returns
Type | Description |
---|---|
Task<><bool> | True if all dependencies could be fetched |
SetFloat(string, float)
Sets a float property in the material
Declaration
public void SetFloat(string name, float value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the float property in the shader |
float | value | The value of the float property |
SetTexture(string, ITextureConstructor)
Sets a texture request for the material
Declaration
public void SetTexture(string name, ITextureConstructor value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the texture property in the shader |
ITextureConstructor | value | The texture constructor which fetches the texture |