BuildSceneFog
function · lighting · primitive
- Address
0x6cee30· 871 bytes, up to0x6cf196- Meaning
- Builds the scene fog and the interior-blended fog from the light table
- Confidence
- verified, proof one
- Finding
- lighting/fog#scene-fog
- Test
lighting::dn_blend_difftest,lighting::dn_blue_premul_difftest,lighting::dn_case2_premul_difftest,lighting::dn_fog_color_lerp_difftest,lighting::dn_phase_alpha_delta_difftest,lighting::dn_phase_fade_arg_difftest,lighting::dn_repack_scale_difftest
Finding: Scene fog in lighting: fog and the world light
The scene fog is end = min(scalar band 0, far clip), start = scalar band 1 × end, and colour band 7,
at state +0x78, +0x74 and +0x70. A NaN band end takes the far clip. Scalar band 0 is already
multiplied by f32(1/36) (tables#fog-distances-at-load); the start is a fraction of the end and can be
negative.
The derivation is in the doc.
Callers 1
- CWorld::UpdateSkyAndFog terrain
Callees 9
- FastPow2 fastmath
- 0x667290 storm
- CWorld::GetPlayerFog terrain
- GetCameraLiquid terrain
- LerpColor terrain
- ApplyFogColourModifier lighting
- ScaleFogColourModifier lighting
- InitFogRecords lighting
- ClearFogModifierBit lighting
Calls and jumps by a bare address, from tables/calls.tsv.