benilla-re systems structs docs

s_cloudHorizonEpsilon

global · lighting

Address
0x811600 · 8 bytes, up to 0x811607
Type
const double
Meaning
Holds 1e-5, the horizontal length below which a cloud point maps to the centre
Confidence
verified, proof one
Finding
lighting/clouds#cover-projection

Finding: Cover projection in lighting: clouds

A point maps to the cloud texture by its direction from the eye with the vertical raised by cos 45°: r = min(acos(dz'/|d'|), 0.25π)/(0.25π)·0.5, and with h the horizontal length, u = (dx/h·r + 0.5)·cols and v = (dy/h·r + 0.5)·cols, or 0.5·cols each when h ≤ 1e-5. The cover sampler reads byte (trunc v << shift) + trunc u and divides by 255, or returns 0 before the texture exists.

The derivation is in the doc.