Barnes-Hut Lighting

Builds (itch.io)

Trailer (YouTube)

Code (GitHub)

A solo project meant to apply research in real-time rendering technology, I built upon the Eis-Engine code base created in my undergraduate degree, and expanded on in the Minotaur’s Maze project to build a more performant lighting system, with a built-in level of detail feature.

Product Description
The “playable” application itself is the exact same as in the Minotaur’s Maze project, featuring a procedurally generated maze with torches dotting the environment. The improvement was the conversion from a voxel-based “on or not” lighting system that filtered light sources in a very limited fashion to a global illumination system using Barnes-Hut light cuts, at the cost of a performance drop of about half the frequency compared to the previous system.

Submitted/”Published”
April 2026

  • The early system was optimised for performance rather than visual accuracy. Every torch was sorted into 4×4 voxels, without consideration for elevation for practical reasons. The data structure was fixed, meaning dynamic lights were not supported.

    When illuminating an object, it would only consider light from directly surrounding voxels, and only the n=5 closest light sources, leading to broken lights in many places.

  • A solution to many of these issues was, for the inspected papers, a dynamic spatial data structure that would automatically filter for level of detail.

    A Barnes-Hut data structure subdivides the space into clusters that increase in density around areas of interest, while condensing areas more in the background or out of view overall.

    Light sources were organised into a tree structure by spatial proximity to form these light clusters for the light cuts to use. For time reasons, no performant way was found to add or move light sources dynamically, so the data structure is rebuilt every frame, leading to much room for improvement.

  • In a landmark paper published at ACM SIGGRAPH in 2005, researchers published this method, which takes a tree structure and traverses the structure from the top-down to spare on performance.

    If a node is judged accurate enough by an approximation metric, the sub-tree is ignored and condensed cluster values are used for rendering. If more accuracy is needed, the child clusters are explored, until reaching individual light sources in or very close to areas of interest.

    This leads to an implicit level of detail filtering, that can further be tuned to fit the filtering method used in the baseline to define areas of interest more clearly.

  • This project was inspired by the paper “Stochastic Barnes-Hut Approximation for Fast Summation on the GPU“ (Madan et.al., 2025) published at ACM SIGGRAPH.

    The light cuts system was applied from the paper “Lightcuts: a scalable approach to illumination“ (Walter et.al., 2005), also published at ACM SIGGRAPH.

Screenshots and features

[available in repository]

Environments rendered using B-H Light Cuts |

| The environment rendered using the old light system.

Software & Skills involved:

Low-level Engine development

Eis-Engine v3.0

C++ Programming

Git Version Control