RgbToHsv
function · unassigned
- Address
0x7bbc80· 183 bytes, up to0x7bbd36- Signature
void __fastcall (const NTempest::C3Vector *rgb, NTempest::C3Vector *hsv)- Meaning
- Converts a colour's three channels in [0, 1] to hue, saturation and value
- Confidence
- verified, proof one
- Finding
- lighting/daynight#underwater-tint
- Test
cmath::rgb_to_hsv_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 5
- FillLiquidSwatch terrain
- SplitLightColor terrain
- ScaleColourValue lighting
- BuildLightColours lighting
- ColorSelect::SetColorRGB ui
Callees 2
- DominantAxis cmath
- MinorAxis cmath
Calls and jumps by a bare address, from tables/calls.tsv.