AddHorizonOccluder
function · terrain · primitive
- Address
0x681b50· 456 bytes, up to0x681d17- Signature
void __fastcall (const float *vertices, const uint8_t *rows, uint32_t count, const float *position, uint32_t unused)- Meaning
- Raises the horizon columns under an occluder's projected edges to their lower y/z
- Confidence
- verified, proof one
- Finding
- terrain/cull#horizon-buffer
- Test
terrain::horizon_insert,terrain::horizon_non_finite_probes
Finding: Horizon buffer in terrain: cull
At each frame the buffer is filled with −1,000,000. A chunk chosen as an occluder adds two of its vertex rows: each vertex, plus the chunk position, goes through the view matrix to (x, y, z) and becomes x/z and y/z; for each edge whose two ends both have z of at least 2.7777777, every column from round(64·x/z − 0.5) + 160 to the other end's, clamped to 0 to 319, is raised to the lower of the two ends' y/z.
The derivation is in the doc.
Callers 1
- CMapChunk::AddHorizonRows terrain
Callees 1
- TransformPoint cmath
Calls and jumps by a bare address, from tables/calls.tsv.