benilla-re systems structs docs

HsvToRgb

function · unassigned

Address
0x7bbd60 · 316 bytes, up to 0x7bbe9b
Signature
void __fastcall (const NTempest::C3Vector *hsv, NTempest::C3Vector *rgb)
Meaning
Converts hue, saturation and value back to three channels in [0, 1]
Confidence
verified, proof one
Finding
lighting/daynight#underwater-tint
Test
cmath::hsv_to_rgb_difftest, ui::colorselect_hsv_roundtrip_chain

Finding: Underwater tint in lighting: day-night

Underwater in water or ocean, the table's fog colour, ambient and diffuse are tinted after the fog derive: f = 1 in water, and in ocean, when the whole liquid word is 1, f = 1 + clamp(z, −30, 0)/30 with z the camera eye's height (NaN as −30). Fog colour and ambient have their HSV value scaled by (f + 1)·0.5 and diffuse by f·0.25 + 0.75. The fog colour written here is replaced later the same frame by the fog update.

The derivation is in the doc.

Callers 8

Callees 0

None by a direct call or jump.

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