Distance Field-Based Reactive Cubes - Shader Deformation on PCG - Exploration

TLDR: No-Code, No-Blueprint, Only-Shader reactive cubes system based on PCG using distance fields.

In this exploration, I combined Unreal Engine's PCG framework with a material-based deformation system that reacts in real time to distance fields. The idea was to prototype a stylized surface behavior that reacts to dynamic elements without relying on any gameplay logic or blueprint-driven interaction.

The base layer consists of thousands of cube instances distributed procedurally over a flat terrain. While the PCG setup itself is intentionally minimal, it serves as a lightweight backbone to populate the environment and test the material response at scale. Each instance uses a custom material that samples the engine’s distance field using DistanceToNearestSurface, and applies the result to a world position offset with falloff control. The entire deformation is handled in the GPU, allowing the mesh instances to "breathe" or collapse in response to nearby dynamic actors.

The displacement effect is fully real-time and resolution-independent, with parameters exposed to fine-tune falloff intensity, range, and axis control. No collision events or triggers are used; the interaction is entirely spatial, driven by the underlying distance field volume around the sphere or player. This allows for elegant and performant deformation even under heavy instance counts.

What interested me most about this approach was its scalability and abstraction—being able to create localized reactions across a large field of instances, without communication between them, and with zero impact on CPU logic. It opens up possibilities for reactive environments, ambient storytelling, and systemic world responses in stylized or abstract visual spaces.