Improved CIELAB Color Quantization with the HyAB Distance Formula

2025-07-10

This article explores an improved CIELAB color quantization method using a novel distance formula called HyAB, replacing the traditional Euclidean distance. HyAB uses absolute difference for lightness and Euclidean distance for chromaticity, showing better alignment with human perception in experiments. The author applies it to the k-means algorithm, further optimizing results by replacing the mean calculation of the L component with the median. While HyAB can improve image quality in some cases, the author notes that overall system design and post-processing techniques like dithering have a greater impact on the final outcome.

Read more
Development

Real-time Lighting and Normal Mapping on the N64: A Stunning Reverse Engineering Feat

2025-05-17

This article details an impressive technique for achieving real-time lighting and normal mapping on the Nintendo 64. By cleverly leveraging palette textures and CPU-side shading, the author circumvents the N64's hardware limitations to achieve surprisingly impressive visuals. The technique involves compressing diffuse and normal information into a shared palette, and updating the palette at runtime via the CPU to simulate lighting effects. While the method has some limitations, such as lack of point light support and shadows, its innovative nature is remarkable, opening new possibilities for graphics rendering on the N64 platform.

Read more
Development

Quake's Precomputed Visibility: Demystifying the PVS Algorithm

2025-01-10

This is the first installment in the "Demystifying the PVS" series, exploring how Quake's engine optimized rendering performance using precomputed visibility sets (PVS). In the mid-90s, limitations of software rendering made reducing overdraw crucial. Quake used a portal system and PVS to address this. Portals divide the world into cells; the engine renders only cells visible to the camera and others visible through portals. The PVS algorithm precomputes a list of visible cells for each cell during map compilation, avoiding complex visibility tests at runtime and significantly improving rendering efficiency. This article delves into the PVS algorithm's implementation details, including portal definitions, the role of the BSP tree, and the algorithm's three steps: base visibility, full visibility, and result resolution.

Read more