Gfx GX Fn GXInitLightShininess - wowjinxy/libPorpoise GitHub Wiki

GXInitLightShininess

  • Category: Lighting
  • Matrix Status: Implemented
  • Matrix Notes: Official macro API; added SDK-compatible macro mapping to GXInitLightAttn.
  • Matrix Link: Gfx-GX-API-Matrix

Official SDK (Reference)

  • Manual page: reference/man/gfx/gx/Lighting/GXInitLightShininess.html
  • Official form: macro, not a standalone function:
    • #define GXInitLightShininess(lobj, shininess) GXInitLightAttn(lobj, 0.0F, 0.0F, 1.0F, (shininess)/2.0F, 0.0F, 1.0F-(shininess)/2.0F)
  • Behavior:
    • Sets specular shininess by mapping to light attenuation coefficients (k0, k1, k2).
    • Requires channel attenuation mode configured appropriately for specular use (GX_AF_SPEC) via GXSetChanCtrl.

libPorpoise Implementation

  • Public API surface: include/dolphin/gx/GXLighting.h
  • Implementation style:
    • Implemented as SDK-style macro in header (no runtime symbol), forwarding directly to GXInitLightAttn.
    • Runtime behavior is therefore exactly the GXInitLightAttn path already used by all backends.

SDK vs Porpoise Diff

  • Signature parity:
    • SDK: Macro API in header.
    • Porpoise: Macro API in header.
  • Behavioral parity:
    • SDK: Computes attenuation tuple from shininess and calls GXInitLightAttn.
    • Porpoise: Same attenuation tuple and same forwarding behavior.
  • Known divergence:
    • None identified for this function-level API.

Validation Checklist

  • GX demo coverage checked
  • Pikmin usage path checked
  • Matrix status updated if needed
  • Notes updated with concrete file/function references

Working Notes

  • Verified against manual macro definition in reference/man/gfx/gx/Lighting/GXInitLightShininess.html.
  • Verified libPorpoise macro in include/dolphin/gx/GXLighting.h.