Umbra::MetaData struct

Provides access to per-texel metadata.

When metadata is included, a texture with the type TEXTURE_TYPE_META_INDEX is included in materials. Each texel of this texture contains an index that can be used to query the associated MetaData instance for a list of classifications that are present in the area of the texel. Classifications are provided as inputs to the optimization process by the user; Umbra does not use or modify this data beyond packing it into a suitable format. Classifications that represent too small a share of the area of a texel will be dropped by the optimization; the classification data bundled with otherwise detailed areas is more detailed as well.

At high levels of optimization one output texel may correspond to an area containing multiple classifications. In such cases a list of classifications, along with their approximate relative frequencies, is provided.

Public functions

auto getClassificationCount(int idx) const -> int
Number of classifications for a given index.
auto getClassification(int idx, int n) const -> int
Get the nth classification present at an index.
auto getClassificationAmount(int idx, int n) const -> float
Get approximate relative frequency of the nth classification at an index, in the range [0,1].

Function details

int Umbra::MetaData::getClassificationCount(int idx) const

Number of classifications for a given index.

Multiple classifications may be present when the data has been heavily optimized. No classifications will be present if none were provided.

int Umbra::MetaData::getClassification(int idx, int n) const

Get the nth classification present at an index.

This classification is user-provided as part of the input data