benilla-re systems structs docs

ProjectToCloudTexture

function · lighting · primitive

Address
0x6cf870 · 330 bytes, up to 0x6cf9b9
Meaning
Maps a point's direction from the eye to cloud texture coordinates
Confidence
verified, proof one
Finding
lighting/clouds#cover-projection
Test
lighting::sky_cloud_uv_scroll_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

Callees 1

Calls and jumps by a bare address, from tables/calls.tsv.