BlockEdge

Technology and digital life

How a flat Unreal Engine mosaic casts sunlight across an animated fox

In Oday Abuzaeed’s interactive mosaic, a fox can pass behind painted scenery and into sunlight without a separate 3D object standing in front of it. The shader artist used a depth map authored in Substance 3D Designer to make both effects work on the same flat surface in Unreal Engine. A third system makes whole flowers appear near the player rather than revealing a circular patch of texture.

Lighting the mural one tile at a time

Abuzaeed created two maps alongside the artwork: one records the relative depth of the painted elements, and the other runs from dark on the left to bright on the right to indicate horizontal position. Each mosaic tile has a single value in each map. That choice determines how the moving light looks: its edge follows the tile boundaries instead of cutting through individual pieces.

In Unreal Engine, custom HLSL nodes compare the maps with a three-component light direction to determine which tiles to illuminate. A BlackBody node supplies a sunlight tint based on color temperature, which the material applies with an Overlay blend. Abuzaeed describes this as an art-directed approximation of directional light, not a simulation of global illumination.

How a flat Unreal Engine mosaic casts sunlight across an animated fox (1)

Putting the fox behind painted scenery

The fox animation uses a flipbook texture containing a sequence of frames. A custom HLSL function uses time and adjustable start and end frames to loop part of that sequence. Separate texture-coordinate controls let Abuzaeed move or resize the fox without changing which frame the material displays.

The depth map doubles as a way to hide parts of the fox. An adjustable threshold determines which painted elements appear in front of it. The material then applies sunlight after combining the visible fox with the mural, so the moving light affects the character and the scenery together.

How a flat Unreal Engine mosaic casts sunlight across an animated fox (2)

Revealing whole flowers near the player

For the flowers, Abuzaeed divided the surface into a grid and varied each flower’s rotation, size and position using seeded values. This produces an irregular arrangement that can be reproduced. Each flower region also has an identifier, allowing the material to activate a particular flower rather than just the pixels nearest the player.

An Unreal Engine Blueprint supplies the player’s world position. The material projects it onto the ground plane to define a circular area around the player, then tests each flower region against that area using approximately 30 comparison samples. Once the sampled overlap reaches roughly 20%, the material displays the entire flower. As with the sunlight, the visible change respects the shape in the artwork: the player controls when a flower appears, but the edge of the circle never slices through its petals.