Additive Blending on the Nintendo 64

· math · Source ↗

TLDR

  • The N64 RDP lacks color clamping for additive blending, causing wraparound; a workaround using a 32-bit render buffer at 1/8th intensity plus RSP conversion solves it.

Key Takeaways

  • PSX natively clamps additive blend results (src + dst) to max channel value; N64 RDP wraps around instead, producing wrong colors.
  • Workaround: render to a 32-bit RGBA8888 buffer at 1/8th intensity via FOG_ALPHA in the color combiner, preventing overflow headroom exhaustion.
  • RSP microcode (written in RSPL, a C-like language) converts the 32-bit buffer to 16-bit with proper clamping in ~3.1ms for a 320x240 frame vs ~70ms on CPU.
  • Cost: 32-bit render target nearly doubles RDP memory bandwidth versus the standard 16-bit framebuffer due to N64’s RDRAM throughput limits.
  • Optimization path: restrict 32-bit additive pass to only affected sprites, potentially at lower resolution, then composite with main 16-bit scene on RSP.

Hacker News Comment Review

  • No substantive HN discussion yet.

Original | Discuss on HN