Gfx GX Fn GXInitLightSpot - wowjinxy/libPorpoise GitHub Wiki
GXInitLightSpot
- Category:
Lighting
- Matrix Status:
Implemented
- Matrix Notes: Verified SDK-parity spotlight coefficient generation for all
GX_SP_* modes, including invalid-cutoff fallback to GX_SP_OFF.
- 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/GXInitLightSpot.html and SDK source in reference/gx/GXLight.c.
- SDK behavior:
- If
cutoff <= 0 or cutoff > 90, force spot_func = GX_SP_OFF.
- Computes angular attenuation coefficients (
a0..a2) per selected GX_SP_* distribution formula.
- Writes only angular coefficients in the light object.
- Runtime behavior in
src/gx/pc_gx.c:
- Mirrors cutoff validation and
GX_SP_OFF fallback.
- Uses equivalent formulas for
GX_SP_FLAT/COS/COS2/SHARP/RING1/RING2/OFF.
- Writes
a0/a1/a2 only.
- Result:
- Function semantics match SDK for spotlight attenuation setup.