Skip to content
ninquiet_

cat ~/projects/matrix-code-rain.shader

-rw-r--r--  vfx / shaders  2025

Matrix code rain

A Matrix-style code rain built in a single shader, step by step.

shader graphsingle shader
Matrix code rain preview

A Matrix-style “code rain” effect built in a single shader.

Problem

The goal was the feeling of training inside the Matrix: endless columns of changing characters falling around you, without simulating thousands of individual characters.

Approach

For the random changing characters, I created a texture of random symbols laid out on a grid with even spacing.

VFX - Matrix Code Rain

Then, by adding a constant offset on Y and nudging X by fixed steps (a floor node keeps the values snapped), I got characters that change over time:

VFX - Matrix Code Rain

Next, I made a simple texture of falling lines with an especially bright tip, and tiled it into an infinite pattern.

VFX - Matrix Code Rain

Reusing some of the logic from before, I added movement:

VFX - Matrix Code Rain

Multiplying both effects gives the base. From there I added extra passes, combined them, and faded the top and bottom of the shape smoothly.

VFX - Matrix Code Rain

Finally, everything is multiplied by a color before output.

VFX - Matrix Code Rain

The last step is a mesh with inverted faces that fits the infinite-top look without visual breaks from culling.

VFX - Matrix Code Rain

Performance

Everything happens in one shader on a single mesh, with no particles or per-character objects, which keeps the effect cheap enough to surround the player.

// migrated from the old wordpress portfolio