Asset streaming

Classes

struct UmbraMeshInfo
A structure describing a mesh asset.
struct UmbraMaterialInfo
A structure describing a material asset.
struct UmbraTextureInfo
A structure describing a texture asset.
struct UmbraAssetLoad
Opaque asset load object.
struct UmbraAssetUnload
Opaque asset unload object.

Enums

enum UmbraAssetType { UmbraAssetType_Material, UmbraAssetType_Texture, UmbraAssetType_Mesh }
An enumeration of asset types.
enum UmbraAssetLoadResult { UmbraAssetLoadResult_Failure, UmbraAssetLoadResult_OutOfMemory, UmbraAssetLoadResult_Aborted, UmbraAssetLoadResult_Success }
An enumeration of results an asset load object can end up as.

Typedefs

typedef struct UmbraTextureMetaData UmbraTextureMetaData
Opaque texture meta data object.

Functions

uint32_t UmbraVertexAttributeGetElementByteSize(UmbraVertexAttribute vertexAttribute)
Returns the element size, in bytes, of the vertex attribute.
UmbraAssetLoad* UmbraRuntimeNextAssetLoad(UmbraRuntime* runtime)
Returns the next asset load object in the asset load queue.
UmbraAssetType UmbraAssetLoadGetType(const UmbraAssetLoad* assetLoad)
Returns the type of the asset load object.
void UmbraAssetLoadPrepare(UmbraAssetLoad* assetLoad, UmbraUserPointer ptr)
Prepares the asset load object by providing it with an unique identifier.
UmbraBool UmbraAssetLoadAbortRequested(const UmbraAssetLoad* assetLoad)
Returns whether or not the asset load has been aborted by the runtime object.
void UmbraAssetLoadFinish(UmbraAssetLoad* assetLoad, UmbraAssetLoadResult result)
Finishes the asset load.
void UmbraMeshLoadFinishExternal(UmbraAssetLoad* assetLoad, UmbraAssetLoadResult result, const UmbraElementBuffer vertexBuffers[UmbraVertexAttributeCount], const UmbraElementBuffer* indexBuffer)
Finishes a serialized mesh load.
void UmbraMeshLoadGetInfo(const UmbraAssetLoad* assetLoad, UmbraMeshInfo* meshInfo)
Returns the information used to decode the mesh.
UmbraBool UmbraMeshLoadGetData(const UmbraAssetLoad* assetLoad, const UmbraElementBuffer vertexBuffers[UmbraVertexAttributeCount], const UmbraElementBuffer* indexBuffer)
Decodes the mesh into the destination vertex and index buffers.
UmbraBool UmbraMeshStreamSetBuffers(const UmbraAssetLoad* assetLoad, const UmbraElementBuffer vertexBuffers[UmbraVertexAttributeCount], const UmbraElementBuffer* indexBuffer)
Sets and verifies the destination buffers used to run the streaming mesh decoder.
UmbraBool UmbraMeshStreamDone(const UmbraAssetLoad* assetLoad)
Returns if the streaming mesh decoder is done.
UmbraBool UmbraMeshStreamNext(const UmbraAssetLoad* assetLoad, uint32_t* numVertices, uint32_t* numIndices)
Decodes the next mesh part of the stream to the previously set destination buffers.
uint32_t UmbraMeshLoadGetSerializedSize(const UmbraAssetLoad* assetLoad)
Returns serialized size the asset load.
UmbraBool UmbraMeshLoadSerialize(const UmbraAssetLoad* assetLoad, UmbraByteBuffer buffer)
Serializes the mesh load into a buffer.
uint32_t UmbraTextureGetMipmapLevelByteSize(const UmbraTextureInfo* textureInfo, int level)
Calculates the size of the mipmap level of the texture.
uint32_t UmbraTextureGetMipmapLevelOffset(const UmbraTextureInfo* textureInfo, int level)
Calculates the offset of the mipmap level of the texture.
void UmbraTextureLoadGetInfo(const UmbraAssetLoad* assetLoad, UmbraTextureInfo* textureInfo)
Returns the information used to decode the texture.
UmbraBool UmbraTextureLoadGetData(const UmbraAssetLoad* assetLoad, const UmbraByteBuffer* buffer)
Decodes the texture into the destination buffer.
uint32_t UmbraTextureLoadGetSerializedSize(const UmbraAssetLoad* assetLoad)
Returns serialized size the texture asset load.
UmbraBool UmbraTextureLoadSerialize(const UmbraAssetLoad* assetLoad, UmbraByteBuffer buffer)
Serializes the texture asset load into a buffer.
UmbraBool UmbraTextureMetaDataLoadGetData(const UmbraAssetLoad* assetLoad, const UmbraByteBuffer* buffer)
Decodes the texture meta data into the destination buffer.
int UmbraTextureMetaDataGetClassificationCount(const UmbraTextureMetaData* textureMetaData, int index)
WIP.
int UmbraTextureMetaDataGetClassification(const UmbraTextureMetaData* textureMetaData, int index, int numClassifications)
WIP.
float UmbraTextureMetaDataGetClassificationAmount(const UmbraTextureMetaData* textureMetaData, int index, int numClassifications)
WIP.
void UmbraMaterialLoadGetInfo(const UmbraAssetLoad* assetLoad, UmbraMaterialInfo* materialInfo)
Returns the material information.
UmbraAssetUnload* UmbraRuntimeNextAssetUnload(UmbraRuntime* runtime)
Returns the next asset unload object from the asset unload queue.
UmbraAssetType UmbraAssetUnloadGetType(const UmbraAssetUnload* assetUnload)
Returns the type of the asset unload object.
UmbraUserPointer UmbraAssetUnloadGetUserPointer(const UmbraAssetUnload* assetUnload)
Returns the user pointer.
void UmbraAssetUnloadFinish(UmbraAssetUnload* assetUnload)
Finishes the asset unload object.
UmbraDouble3 UmbraGeodeticToEcef(UmbraDouble3 geodetic)
Converts a geodetic coordinate to an ECEF coordinate.
UmbraDouble3 UmbraEcefToGeodetic(UmbraDouble3 ecef)
Converts an ECEF coordinate to a geodetic coordinate.

Enum details

enum UmbraAssetType

An enumeration of asset types.

Enumerators
UmbraAssetType_Material

A material asset.

UmbraAssetType_Texture

A texture asset.

UmbraAssetType_Mesh

A mesh asset.

enum UmbraAssetLoadResult

An enumeration of results an asset load object can end up as.

Enumerators
UmbraAssetLoadResult_Failure

An asset load failed for an unspecified reason.

UmbraAssetLoadResult_OutOfMemory

An asset load failed due to running out of memory.

UmbraAssetLoadResult_Aborted

An asset load was aborted by the runtime object.

UmbraAssetLoadResult_Success

An asset load was successful.

Function details

uint32_t UmbraVertexAttributeGetElementByteSize(UmbraVertexAttribute vertexAttribute)

Returns the element size, in bytes, of the vertex attribute.

Parameters
vertexAttribute in The vertex attribute whose size to query.
Returns The element size, in bytes, of the vertex attribute.

UmbraAssetLoad* UmbraRuntimeNextAssetLoad(UmbraRuntime* runtime)

Returns the next asset load object in the asset load queue.

Parameters
runtime in The runtime object to get the next asset load from.
Returns The pointer to the opaque asset load object, or NULL if the asset load queue is empty.

UmbraAssetType UmbraAssetLoadGetType(const UmbraAssetLoad* assetLoad)

Returns the type of the asset load object.

Parameters
assetLoad in The asset load object whose type to query.
Returns The type of the asset load object.

void UmbraAssetLoadPrepare(UmbraAssetLoad* assetLoad, UmbraUserPointer ptr)

Prepares the asset load object by providing it with an unique identifier.

Parameters
assetLoad in The asset load object whose state to be prepared.
ptr in The user pointer which can be used to identify the asset.

UmbraBool UmbraAssetLoadAbortRequested(const UmbraAssetLoad* assetLoad)

Returns whether or not the asset load has been aborted by the runtime object.

Parameters
assetLoad in The asset load object whose status to query.
Returns true if the asset load has been aborted, false otherwise.

void UmbraAssetLoadFinish(UmbraAssetLoad* assetLoad, UmbraAssetLoadResult result)

Finishes the asset load.

Parameters
assetLoad in The asset load to finish.
result in The result of the asset load, to indicate success or failure of the load.

void UmbraMeshLoadFinishExternal(UmbraAssetLoad* assetLoad, UmbraAssetLoadResult result, const UmbraElementBuffer vertexBuffers[UmbraVertexAttributeCount], const UmbraElementBuffer* indexBuffer)

Finishes a serialized mesh load.

Parameters
assetLoad in The asset load to finish.
result in The result of the asset load, to indicate success or failure of the load.
vertexBuffers in The decoded vertex buffers.
indexBuffer in The decoded index buffer.

void UmbraMeshLoadGetInfo(const UmbraAssetLoad* assetLoad, UmbraMeshInfo* meshInfo)

Returns the information used to decode the mesh.

Parameters
assetLoad in The asset load whose mesh information to query.
meshInfo out Where to store UmbraMeshInfo.

UmbraBool UmbraMeshLoadGetData(const UmbraAssetLoad* assetLoad, const UmbraElementBuffer vertexBuffers[UmbraVertexAttributeCount], const UmbraElementBuffer* indexBuffer)

Decodes the mesh into the destination vertex and index buffers.

Parameters
assetLoad in The asset load whose mesh to decode.
vertexBuffers out Where to decode the vertex attributes of the mesh.
indexBuffer out Where to decode the index buffer of the mesh.
Returns true if the mesh was successfully decoded into vertex and index buffers, false otherwise.

UmbraBool UmbraMeshStreamSetBuffers(const UmbraAssetLoad* assetLoad, const UmbraElementBuffer vertexBuffers[UmbraVertexAttributeCount], const UmbraElementBuffer* indexBuffer)

Sets and verifies the destination buffers used to run the streaming mesh decoder.

Parameters
assetLoad in The asset load whose mesh to decode.
vertexBuffers out Where to decode the vertex attributes of the mesh.
indexBuffer out Where to decode the index buffer of the mesh.
Returns true if the destination buffers were set up correctly, false otherwise.

UmbraBool UmbraMeshStreamDone(const UmbraAssetLoad* assetLoad)

Returns if the streaming mesh decoder is done.

Parameters
assetLoad in The asset load whose completion to query.
Returns true if the decoder is done, false otherwise.

UmbraBool UmbraMeshStreamNext(const UmbraAssetLoad* assetLoad, uint32_t* numVertices, uint32_t* numIndices)

Decodes the next mesh part of the stream to the previously set destination buffers.

Parameters
assetLoad in The asset load whose mesh part to decode.
numVertices out Where to store the number of decoded vertices.
numIndices out Where to store the number of decoded indices.
Returns true if the mesh part was decoded successfully, false otherwise.

uint32_t UmbraMeshLoadGetSerializedSize(const UmbraAssetLoad* assetLoad)

Returns serialized size the asset load.

Parameters
assetLoad in The asset load whose serialized size to query.
Returns Required buffer size in bytes.

UmbraBool UmbraMeshLoadSerialize(const UmbraAssetLoad* assetLoad, UmbraByteBuffer buffer)

Serializes the mesh load into a buffer.

Parameters
assetLoad in The mesh load to serialize.
buffer out The destination buffer for the serialized mesh load.
Returns true if the mesh was serialized successfully, false otherwise.

uint32_t UmbraTextureGetMipmapLevelByteSize(const UmbraTextureInfo* textureInfo, int level)

Calculates the size of the mipmap level of the texture.

Parameters
textureInfo in The texture whose mipmap level size to query.
level in The level of the mip chain, must be 0, or less than UmbraTextureInfo::numMipLevels.
Returns The size, in bytes of the specified mipmap level.

uint32_t UmbraTextureGetMipmapLevelOffset(const UmbraTextureInfo* textureInfo, int level)

Calculates the offset of the mipmap level of the texture.

Parameters
textureInfo in The texture whose mipmap level offset to query.
level in The level of the mip chain, must be 0, or less than UmbraTextureInfo::numMipLevels.
Returns The offset, in bytes of the specified mipmap level.

void UmbraTextureLoadGetInfo(const UmbraAssetLoad* assetLoad, UmbraTextureInfo* textureInfo)

Returns the information used to decode the texture.

Parameters
assetLoad in The asset load whose texture information to query.
textureInfo out Where to store UmbraTextureInfo.

UmbraBool UmbraTextureLoadGetData(const UmbraAssetLoad* assetLoad, const UmbraByteBuffer* buffer)

Decodes the texture into the destination buffer.

Parameters
assetLoad in The asset load whose texture to decode.
buffer out Where to decode the texture.
Returns true if the texture was decoded successfully, false otherwise.

uint32_t UmbraTextureLoadGetSerializedSize(const UmbraAssetLoad* assetLoad)

Returns serialized size the texture asset load.

Parameters
assetLoad in The texture asset load whose serialized size to query.
Returns Required buffer size in bytes.

UmbraBool UmbraTextureLoadSerialize(const UmbraAssetLoad* assetLoad, UmbraByteBuffer buffer)

Serializes the texture asset load into a buffer.

Parameters
assetLoad in The texture asset load to serialize.
buffer out The destination buffer for the serialized texture load.
Returns true if the texture was serialized successfully, false otherwise.

UmbraBool UmbraTextureMetaDataLoadGetData(const UmbraAssetLoad* assetLoad, const UmbraByteBuffer* buffer)

Decodes the texture meta data into the destination buffer.

Parameters
assetLoad in The asset load whose texture meta data to decode.
buffer out Where to decode the texture meta data.
Returns true if the texture meta data was decoded successfully, false otherwise.

int UmbraTextureMetaDataGetClassificationCount(const UmbraTextureMetaData* textureMetaData, int index)

WIP.

Parameters
textureMetaData in
index in

int UmbraTextureMetaDataGetClassification(const UmbraTextureMetaData* textureMetaData, int index, int numClassifications)

WIP.

Parameters
textureMetaData in
index in
numClassifications in

float UmbraTextureMetaDataGetClassificationAmount(const UmbraTextureMetaData* textureMetaData, int index, int numClassifications)

WIP.

Parameters
textureMetaData in
index in
numClassifications in

void UmbraMaterialLoadGetInfo(const UmbraAssetLoad* assetLoad, UmbraMaterialInfo* materialInfo)

Returns the material information.

Parameters
assetLoad in The asset load whose material information to query.
materialInfo out Where to store UmbraMaterialInfo.

UmbraAssetUnload* UmbraRuntimeNextAssetUnload(UmbraRuntime* runtime)

Returns the next asset unload object from the asset unload queue.

Parameters
runtime in The runtime object to get the next asset unload from.
Returns The pointer to the opaque asset unload object, or NULL if the asset unload queue is empty.

UmbraAssetType UmbraAssetUnloadGetType(const UmbraAssetUnload* assetUnload)

Returns the type of the asset unload object.

Parameters
assetUnload in The asset unload object whose type to query.
Returns The type of the asset unload object.

UmbraUserPointer UmbraAssetUnloadGetUserPointer(const UmbraAssetUnload* assetUnload)

Returns the user pointer.

Parameters
assetUnload in The asset unload object whose user pointer to query.
Returns The user pointer of the asset.

void UmbraAssetUnloadFinish(UmbraAssetUnload* assetUnload)

Finishes the asset unload object.

Parameters
assetUnload in The asset unload object to finish.

UmbraDouble3 UmbraGeodeticToEcef(UmbraDouble3 geodetic)

Converts a geodetic coordinate to an ECEF coordinate.

Parameters
geodetic in Longitude, latitude and elevation.
Returns The ECEF coordinate.

UmbraDouble3 UmbraEcefToGeodetic(UmbraDouble3 ecef)

Converts an ECEF coordinate to a geodetic coordinate.

Parameters
ecef in X, y and z coordinates in ECEF space.
Returns The geodetic coordinate as longitude, latitude and elevation.