QcMaterialAtlas Class
The material maps of the texture atlas (decision E-908): a normal atlas and a specular atlas in the labPBR encoding (QcMaterialSynthesizer), with the colour atlas's layout, so the block shader reads them at the same atlas coordinates. More...
| Header: | #include <clientcore/materials/QcMaterialAtlas.h> |
Public Functions
| qint64 | bytes() const |
| const QList<QImage> & | normalLevels() const |
| quint64 | serial() const |
| const QList<QImage> & | specularLevels() const |
| QImage | tile(const QList<QImage> &levels, const QRectF &uv) const |
| int | tileSize() const |
Static Public Members
| QcMaterialAtlas | build(const QcTextureAtlas &colour, const QcContentRegistry &content, const QcTexturePackStack &packs) |
| QStringList | clashes(const QSet<QString> &names, const QcTexturePackStack &packs) |
| const int | maxTileSize |
Detailed Description
Tiles are at most maxTileSize pixels (a 256x pack gets 128x maps). Each texture's maps come from where its colour came from: a pack's PNG brings its <name>_n.png and <name>_s.png (flat without them), a procedural texture (the game's, a mod's, a pack's spec, a procedural pack) gets maps painted from its colour (QcMaterialRules), everything else flat maps. Immutable once built and handed from the worker that builds it to the renderer, which lets it go once the maps are on the GPU; never kept with the colour atlas (decision E-912).
Member Function Documentation
[static] QcMaterialAtlas QcMaterialAtlas::build(const QcTextureAtlas &colour, const QcContentRegistry &content, const QcTexturePackStack &packs)
Returns the maps for every tile of colour (built from content and packs).
qint64 QcMaterialAtlas::bytes() const
Returns the bytes of all levels of both atlases.
[static] QStringList QcMaterialAtlas::clashes(const QSet<QString> &names, const QcTexturePackStack &packs)
Returns the images of packs taken as material maps whose names are also among the content's texture names (foo_n.png is the normal map of foo, never the texture foo_n; English, for the log).
const QList<QImage> &QcMaterialAtlas::normalLevels() const
Returns the levels of the normal atlas: level 0 first, down to tiles of 8 pixels like the colour atlas (QcAtlasLayout::levelCount): normals averaged and normalised again, smoothness lowered where the averaged normals spread (Toksvig), emission averaged as light.
quint64 QcMaterialAtlas::serial() const
Returns the number of this set among the sets of maps built in this process (1 for the first): the renderer remembers a refused set by it, not by its address, which a later set may reuse.
const QList<QImage> &QcMaterialAtlas::specularLevels() const
Returns the levels of the specular atlas, like normalLevels().
QImage QcMaterialAtlas::tile(const QList<QImage> &levels, const QRectF &uv) const
Returns the tile at uv (QcTextureAtlas::uv) of level 0 of levels, for tests and tools.
int QcMaterialAtlas::tileSize() const
Returns the tile size of level 0 in pixels.
Member Variable Documentation
const int QcMaterialAtlas::maxTileSize
Largest tile size of the maps in pixels.