Lesson 7 of 10 · Domain warping

Snake

Python with iridescent sheen.

fract() tiles space into cells. Warp before fract() and cells deform into scales. Distance to each cell center gives a hexagonal-ish shape.

Python scales under your desk lamp.

fract(p)Fractional part. Repeats 0-1 infinitely. With warp = irregular cells.
TryRaise the 5.0 in gl_FragCoord.xy / R * 5.0 to 8.0 and scales shrink, denser. Drop to 3.0 and they grow like iguana skin.
Freebie

SCALES

Find // replace this and swap that line for these two:
float ang = atan(p.y, p.x) + T * 0.15;
wp = vec2(cos(ang), sin(ang)) * length(p) * 5.0 + warp * 0.6;

Paste it. The scales spin like a python hunting.

The code

[object Object]