RC RANDOM CHAOS

Faking Additive Blending on the N64 by Detouring Through a 32-bit Buffer

· via Hacker News

Original source

Additive Blending on the Nintendo 64

Hacker News →

The PlayStation handled effects like explosions and plasma beams convincingly because its GPU supported additive blending with automatic clamping at 255. The Nintendo 64’s Reality Display Processor technically supported additive blending through its configurable Color Combiner, but it failed to clamp results, so any overflow wrapped around and produced visibly broken colors. That quirk is a big reason N64 effects often look duller than their PSX counterparts.

Phoboslab worked around the limitation by rendering into a 32-bit RGBA8888 buffer while keeping sprite assets in a 5-bit-per-channel range. The Color Combiner is tricked into drawing everything at 1/8th intensity by abusing the fog alpha value, giving enough headroom for additive sums to accumulate without overflow. A final pass clamps and packs the 32-bit image back into the 16-bit framebuffer the N64 actually displays.

Doing that conversion on the CPU takes a prohibitive 70ms per frame, but offloading it to the RSP vector coprocessor using HailToDodongo’s RSPL language brings it down to about 3.1ms. The tradeoff is roughly double the framebuffer bandwidth against the N64’s notoriously slow RDRAM, which could be mitigated by routing only sprites that actually need additive blending through the 32-bit path. A demo is on GitHub.

Read the full article

Continue reading at Hacker News →

This is an AI-generated summary. Read the original for the full story.