Encodes the three contributing cells of a terrain vertex. 更多...
#include <HexMapMesh.h>
静态 Public 成员函数 | |
| static float | encodeIndices (std::int32_t a, std::int32_t b, std::int32_t c) noexcept |
| First texture coordinate, carrying the three terrain indices. | |
| static float | encodeWeights (float weightB, float weightC) noexcept |
| Second texture coordinate, carrying the secondary/tertiary weights. | |
详细描述
Encodes the three contributing cells of a terrain vertex.
The vertex stream only carries two texture coordinates, so the terrain shader's inputs are packed into them:
u = terrainA + terrainB * 8 + terrainC * 64 v = weightB + weightC * 16
Terrain indices are in [0, 4] and weights in [0, 1], so both values stay well inside float32's exact-integer range and the shader recovers the inputs with mod/fract. This is a deliberate compatibility bridge for the current two-coordinate vertex layout and must not become the terrain data format.
在文件 HexMapMesh.h 第 29 行定义.
成员函数说明
◆ encodeIndices()
|
inlinestaticnoexcept |
First texture coordinate, carrying the three terrain indices.
在文件 HexMapMesh.h 第 31 行定义.
◆ encodeWeights()
|
inlinestaticnoexcept |
Second texture coordinate, carrying the secondary/tertiary weights.
在文件 HexMapMesh.h 第 35 行定义.
该结构体的文档由以下文件生成:
- src/modules/hexmap/HexMapMesh.h