Class GLBRuntime
Loads GLB files at runtime.
Namespace: Evergine.Runtimes.GLB
Assembly: Evergine.Runtimes.GLB.dll
Syntax
public class GLBRuntime : ModelRuntime
Fields
Instance
Single instance (Singleton).
Declaration
public static readonly GLBRuntime Instance
Field Value
Type | Description |
---|---|
GLBRuntime |
Properties
Extentsion
Gets the 3D format extension.
Declaration
public override string Extentsion { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
Methods
Read(Stream, Func<MaterialData, Task<Material>>)
Reads a GLB file from the stream and returns a model asset.
Declaration
public override Task<Model> Read(Stream stream, Func<MaterialData, Task<Material>> materialAssigner = null)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream to read from. The stream must be seekable. |
Func<MaterialData, Task<Material>> | materialAssigner | The material assigner. |
Returns
Type | Description |
---|---|
Task<Model> | The loaded model asset. |
Overrides
Read(string, Func<MaterialData, Task<Material>>)
Reads a GLB file and returns a model asset.
Declaration
public Task<Model> Read(string filePath, Func<MaterialData, Task<Material>> materialAssigner = null)
Parameters
Type | Name | Description |
---|---|---|
string | filePath | The GLB file path. |
Func<MaterialData, Task<Material>> | materialAssigner | The material assigner. |
Returns
Type | Description |
---|---|
Task<Model> | The model asset. |
ReadTexture(int)
Allows loading a texture from the glTF texture ID.
Declaration
public Task<(Texture texture, SamplerState sampler)> ReadTexture(int textureId)
Parameters
Type | Name | Description |
---|---|---|
int | textureId | The texture ID. |
Returns
Type | Description |
---|---|
Task<(Texture Texture, SamplerState Sampler)> | The loaded texture. |