SampleCloudCover
function · lighting · primitive
- Address
0x6cfa90· 109 bytes, up to0x6cfafc- Meaning
- Returns the cloud cover byte at a point over 255, or 0 before the texture exists
- Confidence
- verified, proof one
- Finding
- lighting/clouds#cover-projection
- Test
lighting::dn_sky_tex_sample_difftest
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.
Callers 2
- GetGlareCloudCover lighting
- GetGlareCoverEdge lighting
Callees 2
- __ftol crt
- ProjectToCloudTexture lighting
Calls and jumps by a bare address, from tables/calls.tsv.