Class MaterialConstructor
Construction object to store properties of materials to create them later
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<Boolean> | True if all dependencies could be fetched |
SetFloat(String, Single)
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 |
| Single | 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 |