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

Here is a little preview of an effect created to give the feeling of matrix trainning code, is a single shader

For the random changing text, I’ve created a texture with random text, organized on a grid with perfect distnaces between each other

VFX - Matrix Code Rain

Then, by adding a constant offset on Y, and moving a little X on fixed values (using floor node to keep the values fixed) I was able to have a changing letters effect:

VFX - Matrix Code Rain

Then, I’ve created simple texture of falling lines, where the tip is specially bright, and tilled them making them an inffinite pattern

VFX - Matrix Code Rain

And using some of the already calculated logic before, I added some movement

VFX - Matrix Code Rain

Then after multiplying both effects, we have the perfect base:

Now we just need to add some extra passes, combine them, and create a smooth fading on top and bottom of the sahep

VFX - Matrix Code Rain

And multiply by a color before output the value

VFX - Matrix Code Rain

So we have this at the end

Now we just need to create a mesh with inverted faces, that fits with the effect of infinite top, but without breaking visually because the culling, and we are done

VFX - Matrix Code Rain

// migrated from the old wordpress portfolio