Class GLBRuntime
Loads GLB files at runtime.
Namespace: Evergine.Runtimes.GLB
Assembly: Evergine.Runtimes.GLB.dll
Syntax
public class GLBRuntime : ModelRuntime
Constructors
GLBRuntime(GraphicsContext, AssetsDirectory, AssetsService)
Initializes a new instance of the GLBRuntime class.
Declaration
public GLBRuntime(GraphicsContext graphicsContext, AssetsDirectory assetsDirectory, AssetsService assetsService)
Parameters
Type | Name | Description |
---|---|---|
GraphicsContext | graphicsContext | Graphics Context instance. |
AssetsDirectory | assetsDirectory | Assets Directory instance. |
AssetsService | assetsService | Assets Service instance. |
Fields
Instance
Gets the a default instance of the class resolving the required services using the default Evergine container.
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. |