DrawDisc
function · lighting · primitive
- Address
0x7e5b90· 726 bytes, up to0x7e5e65- Meaning
- Draws a sun or moon disc
- Confidence
- verified, proof one
- Finding
- lighting/celestial#disc-draw
- Test
lighting::d7_vec3_sub_5b90_difftest
Finding: Disc draw in lighting: sun, moons and stars
A disc draws as a camera-facing quad of half-size 0.5 times its size, flat colour +0xc, using
the quad's local z as height: with t = disc z − eye z, a disc whose top and bottom corners are
both below the eye is skipped, and one crossing it is clipped there. The quad is split again where
it crosses 0.4 units above the eye, and every vertex lower than 0.4 + 0.001 takes alpha
bits(f32(clamp(2.5·h, 0, 1)·255 + 512)) >> 14, h its height t + z; higher vertices keep the
colour's alpha. The disc uses the device's blend 2, with lighting, fog and depth writes off.
The derivation is in the doc.
Callers 1
- DrawSky lighting
Callees 20
- __ehvec_dtor crt
- GetTextureDeviceObject gx
- SetVector3 spline
- GxRsSet gx
- GxRsSetObject gx
- GxRsPush gx
- GxRsPop gx
- GxBuildVertices gx
- SetDrawIndices gx
- GxPrimRenderOne gx
- SetDeviceView gx
- GetDeviceView gx
- 0x58b200 gx
- 0x58b220 gx
- GxXformSetIdentity gx
- BuildDiscQuad lighting
- UpdateDisc lighting
- GetLightState lighting
- MultiplyMatrix4 cmath
- BuildGlareBasis lighting
Calls and jumps by a bare address, from tables/calls.tsv.