QcMaterialSynthesizer Namespace
Paints the material maps of one texture from its colour picture (decision E-908). More...
| Header: | #include <clientcore/materials/QcMaterialSynthesizer.h> |
Classes
Variables
| const QRgb | flatNormal |
Functions
| QcMaterialSynthesizer::Maps | flat(int size) |
| QImage | packEmission(const QImage &specular) |
| QcMaterialSynthesizer::Maps | paint(const QImage &colour, const QcMaterialParams ¶ms, const QcMaterialSynthesizer::Colours &colours) |
| QColor | specularTexel(const QcMaterialParams ¶ms, float emission) |
Detailed Description
The maps use the labPBR encoding the texture packs use (docs/Texturpakete.md):
- normal map: red and green the tangent-space normal's x (right) and y (up in the picture) mapped from -1..1 to 0..255, blue the material's ambient occlusion (255: none), alpha the height;
- specular map: red the perceptual smoothness, green F0 * 255 (0..229) or a metal code (230..237, 255), blue the porosity (0..64), alpha the emission. Unlike labPBR (0..254, 255 none) the atlas keeps the emission as 0 none .. 255 full, so filtering and mip levels can average it; packEmission() converts a pack's map.
The relief follows the brightness of the colour (darker is lower: mortar, cracks, grain), its neighbours wrap around the tile's edges, so a map tiles as its texture does. Deterministic: the same picture and material give the same maps on every platform (no fused multiply-add).
Classes
class Colours
The colours of the definition that tell an inclusion (the ore) from its ground (the stone). More...
class Maps
The normal and specular maps of one tile, or one mip level of both material atlases (QcMaterialMips::halve). More...
Variable Documentation
const QRgb QcMaterialSynthesizer::flatNormal
The texel of a flat normal map: no tilt, no occlusion, full height.
Function Documentation
QcMaterialSynthesizer::Maps QcMaterialSynthesizer::flat(int size)
Returns the flat maps (QcMaterialParams::flat) of a size x size tile: textures without maps.
QImage QcMaterialSynthesizer::packEmission(const QImage &specular)
Returns the pack's labPBR specular map specular in the atlas's encoding: emission 255 (none) becomes 0.
QcMaterialSynthesizer::Maps QcMaterialSynthesizer::paint(const QImage &colour, const QcMaterialParams ¶ms, const QcMaterialSynthesizer::Colours &colours)
Returns the normal and specular maps of the RGBA picture colour (any square size) with params, telling inclusions by colours; transparent texels get a flat normal.
QColor QcMaterialSynthesizer::specularTexel(const QcMaterialParams ¶ms, float emission)
Returns the specular texel of params with emission, for tests and the flat maps.