Table of Contents

Class PBRMaterial

Namespace
LibGFX.Graphics.Materials
Assembly
LibGFX.dll
public class PBRMaterial : IMaterial, IGraphicsResource, IIdentifier, ISerialization
Inheritance
PBRMaterial
Implements
Inherited Members

Properties

Albedo

public Vector3 Albedo { get; set; }

Property Value

Vector3

AlbedoTexture

public Texture AlbedoTexture { get; set; }

Property Value

Texture

ID

Gets or sets the unique identifier for the entity.

public Guid ID { get; }

Property Value

Guid

IsInitialized

Gets a value indicating whether the object has been initialized and is ready for use.

public bool IsInitialized { get; }

Property Value

bool

IsTransparent

public bool IsTransparent { get; }

Property Value

bool

Metallic

public float Metallic { get; set; }

Property Value

float

MetallicTexture

public Texture MetallicTexture { get; set; }

Property Value

Texture

Name

Gets or sets the name associated with the object.

public string Name { get; set; }

Property Value

string

NormalTexture

public Texture NormalTexture { get; set; }

Property Value

Texture

Occlusion

public float Occlusion { get; set; }

Property Value

float

OcclusionTexture

public Texture OcclusionTexture { get; set; }

Property Value

Texture

Roughness

public float Roughness { get; set; }

Property Value

float

RoughnessTexture

public Texture RoughnessTexture { get; set; }

Property Value

Texture

Methods

Deserialize(JObject, SerializationContext, Func<JObject, bool>)

Populates the current object with values from the specified JSON object using the provided serialization context.

public void Deserialize(JObject obj, SerializationContext serializationContext, Func<JObject, bool> callback = null)

Parameters

obj JObject
serializationContext SerializationContext

The context that provides information and services for the deserialization process. Cannot be null.

callback Func<JObject, bool>

Exceptions

NotImplementedException

The method is not implemented.

Disable(IRenderDevice)

Disables the Material after rendering operations are complete.

public void Disable(IRenderDevice renderDevice)

Parameters

renderDevice IRenderDevice

Dispose(IRenderDevice)

Releases all resources used by the current instance and performs cleanup using the specified render device.

public void Dispose(IRenderDevice renderDevice)

Parameters

renderDevice IRenderDevice

FreeCPUResources()

Releases any CPU resources that are currently allocated by the component.

public void FreeCPUResources()

Remarks

Call this method when the component no longer needs to perform CPU-intensive operations to allow the system to reclaim resources. After calling this method, the component may not be able to perform certain operations until resources are reallocated.

Init(IRenderDevice)

Initializes the current instance using the specified render device.

public void Init(IRenderDevice renderDevice)

Parameters

renderDevice IRenderDevice

LoadFromFile(string)

public static PBRMaterial LoadFromFile(string file)

Parameters

file string

Returns

PBRMaterial

LoadMaterial(Material, string)

Loads a material from the specified Assimp material definition and associated directory.

public void LoadMaterial(Material asmat, string directory)

Parameters

asmat Material

The Assimp material to convert to an internal material representation. Cannot be null.

directory string

The directory path used to resolve any external resources referenced by the material. Cannot be null or empty.

Exceptions

NotImplementedException

The method is not implemented.

Serialize(JsonWriter, SerializationContext, Action<JsonWriter>)

Serializes the current object to a JSON representation using the specified serialization context.

public void Serialize(JsonWriter writer, SerializationContext serializationContext, Action<JsonWriter> callback = null)

Parameters

writer JsonWriter
serializationContext SerializationContext

The context that provides information and settings required for the serialization process.

callback Action<JsonWriter>

Exceptions

NotImplementedException

The method is not implemented.

Use(IRenderDevice)

Configures the current instance to use the specified render device for rendering operations.

public void Use(IRenderDevice renderDevice)

Parameters

renderDevice IRenderDevice

The render device to be used. Cannot be null.