Gfx GX Fn GXInitLightDistAttn - wowjinxy/libPorpoise GitHub Wiki
GXInitLightDistAttn
- Category:
Lighting
- Matrix Status:
Implemented
- Matrix Notes: Verified SDK-parity
GX_DA_* distance-attenuation formulas and guard/fallback behavior for invalid reference inputs.
- Matrix Link: Gfx-GX-API-Matrix
Official SDK (Reference)
- Manual root:
reference/rvlsdk/man/en_US/gx
- Primary SDK source area:
demos/PikminDemo/src/gx (GC-style Dolphin GX source)
- Notes:
libPorpoise Implementation
- Runtime implementation area:
src/gx
- Public API surface:
include/dolphin/gx
- Notes:
SDK vs Porpoise Diff
- Signature parity:
- Behavioral parity:
-
Known divergence:
Validation Checklist
Working Notes
- Docs checked against
reference/man/gfx/gx/Lighting/GXInitLightDistAttn.html and SDK source in reference/gx/GXLight.c.
- SDK behavior:
- Invalid inputs force
dist_func = GX_DA_OFF:
ref_dist < 0
ref_br <= 0 || ref_br >= 1
- Computes and writes
k0/k1/k2 by selected distribution:
GX_DA_GENTLE, GX_DA_MEDIUM, GX_DA_STEEP, GX_DA_OFF.
- Runtime behavior in
src/gx/pc_gx.c:
- Mirrors the same guard conditions and per-mode formulas.
- Writes only distance attenuation terms (
k0..k2) into the light object.
- Result:
- Function semantics match SDK for distance attenuation setup.