Cover photo

Dying of the Lights

Dying of the Lights envisions a futurescape where ancient civilizations have built megalithic structures to harness the power of the stars. These civilizations have long since passed away, but the ruins of these structures remain forever locked in a state of uncompletion.

The project explores the relationship of structure and color to create otherworldly scenes. The code generates systems of swirling particles, with relationships first being defined by an underlying data structure tying both their physical and color space together before being deconstructed during the render. The final chaotic explosions hint at their original construction, encouraging the viewer to create their own stories about the Dying of the Lights.

Underlying Structures

DOTL uses a simple data structure primitive - a recursive quadtree (there are many tutorials and guides for it). split() is called recursively, with the split axis and length randomly determined.

Underlying data structure
Underlying data structure

Parent-child hierarchy

Quadtrees have an interesting hierarchy to the nodes. These hierarchies allow traits to be inherited from parent to child. For example, in DOTL, certain sections of the quadtree are filtered out based on their aspect ratios, which (1) limits the particle sizes and (2) generates a city-like structure with clusters of objects being formed.

Some early renders which removed sections of the tree produces a very interesting aesthetic
Some early renders which removed sections of the tree produces a very interesting aesthetic

Traits can not just be inherited but also evolved as the tree is generated. Color is one such trait in DOTL. Evolution of the color trait is tied to their relationship in the quadtree. Every time the recursive split() is called, a new color is generated by applying a shift from the parent color. The shift itself is controlled by a perlin noise field dependent on the size of the node. Larger splits = larger shifts.

Thus, child nodes which are more closely related along the quadtree end up with more similar colors. This allows for larger sections of color to be formed and clustered in certain regions of the tree.

An early iteration of the quad tree which paints blobs of color rather than draw rectangles
An early iteration of the quad tree which paints blobs of color rather than draw rectangles

Final Constructions

The structure <> color relationship is further exposed by applying a set of rotations to the system as the tree is rendered. Particles closer in hierarchy form layers of colored geometric objects, with the end result a seemingly chaotic explosion of colors. The rotations are randomly determined, introducing variance in the final megalithic structure of each piece.

Early iterations of a Dying Light explosion
Early iterations of a Dying Light explosion

The final piece is held together by a central light source which (in most cases) provides the bulk of the illumination in the scene. The environmental palettes in DOTL typically play instead with levels of illumination and contrast to achieve images which pay homage to the sci-fi classics which inspired this project. In rare cases, a more rigid color palette is applied (e.g. white-on-black) to achieve the intended aesthetics.

Thanks for tuning in

Hope you enjoyed the creation process! Here are some curated renders of the various environmental palettes available in DOTL.

In the meantime, you can also generate your own Dying Lights over at my repl. Have fun exploring!

Harsh lighting and saturated colors for that otherworldly effect
Harsh lighting and saturated colors for that otherworldly effect
Soft pastel palettes for its comic book vibes
Soft pastel palettes for its comic book vibes
Black and white palettes inspired by manga art
Black and white palettes inspired by manga art
Black-on-light resembles a screen print
Black-on-light resembles a screen print
Light-on-light is a special palette which creates splashes of limited color only on a single face
Light-on-light is a special palette which creates splashes of limited color only on a single face