Categories
Godot

Retro Pixel Compositor: C64 Palette + Ligne Claire Outlines

Today we built a unified retro pixel compositor shader for NinjaMultiRpg, combining C64 palette remapping, Bayer dithering, and ligne claire outlines into a single compute shader pass. The result is a gorgeous pixel art aesthetic that runs entirely on the GPU.

C64 dithering in action
First working dithering – the gradients on the cliffs look fantastic

The Challenge

We had two separate effects that needed to work together: C64 palette remapping with ordered dithering, and ligne claire outlines using depth and normal edge detection. Running them separately caused issues – the order of operations mattered, and the dithering was creating false edges.

The Solution

By combining everything into one compute shader, we got guaranteed order of operations, single-pass efficiency, and the ability to skip dithering on edge pixels for crisp outlines.

Features

  • 16-color C64 palette remapping – authentic retro colors
  • Ordered Bayer dithering – classic checkerboard gradients
  • Depth + normal edge detection – clean outlines without texture
  • Shadow rim outlines – blue glow in dark areas, faking rim lighting
  • Grazing angle compensation – no more edge spam on cliff faces
  • Pre-palette saturation/exposure – push colors toward vibrant palette entries
Final result with blue shadow outlines
Final result – knights with blue shadow rim outlines against the C64 palette

The Shadow Rim Trick

Instead of adding more lights to make characters visible in shadows, we made the outlines glow blue in dark areas. It fakes rim lighting without any extra rendering cost – the outline color simply changes based on scene luminance.

Key insight: check luminance before palette remapping, not after! Otherwise a lit area that maps to a dark palette color gets the wrong outline.

All running real-time in Godot 4.4. Next up: knight remodeling for distinct team colors and swappable helmets!