Class Material
Class representing a 3D material and managing its properties.
Inherited Members
Namespace: Genesis.Graphics
Assembly: Genesis.dll
Syntax
public class Material
Constructors
Material()
Constructor for the Material class. Initializes properties and the dictionary for user-defined properties.
Declaration
public Material()
Material(string, Color)
Constructor for the Material class. Initializes properties and the dictionary for user-defined properties.
Declaration
public Material(string name, Color DiffuseColor)
Parameters
Type | Name | Description |
---|---|---|
string | name | |
Color | DiffuseColor |
Properties
DiffuseColor
The diffuse color of the material.
Declaration
public Color DiffuseColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
DiffuseTexture
The path to the diffuse texture of the material.
Declaration
public string DiffuseTexture { get; set; }
Property Value
Type | Description |
---|---|
string |
Name
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
NormalTexture
The path to the normal texture of the material.
Declaration
public string NormalTexture { get; set; }
Property Value
Type | Description |
---|---|
string |
Opacity
Gets or sets the opacity
Declaration
public float Opacity { get; set; }
Property Value
Type | Description |
---|---|
float |
Propeterys
A collection of user-defined properties.
Declaration
public Dictionary<string, object> Propeterys { get; set; }
Property Value
Type | Description |
---|---|
Dictionary<string, object> |
Methods
LoadMaterial(string)
Loads a material from a JSON file.
Declaration
public static Material LoadMaterial(string filename)
Parameters
Type | Name | Description |
---|---|---|
string | filename | The path to the JSON file containing the material data. |
Returns
Type | Description |
---|---|
Material | The loaded material object. |
SaveMaterial(string)
Saves the material object to a JSON file.
Declaration
public void SaveMaterial(string filename)
Parameters
Type | Name | Description |
---|---|---|
string | filename | The path to save the material JSON file. |
Serialize()
Serializes the material object into a JSON string.
Declaration
public string Serialize()
Returns
Type | Description |
---|---|
string | Serialized JSON string of the material. |