learn GLSL from zero
ToolsCreate with shadersShader MakerFree online shader builderToolkitShader works ready for your siteSketcher LabPaint your landing’s hero with shaders3D StudioThe Three.js editor in your browser
GamesPlay with shadersOnomatoShaderType a word, blow it upThe WatcherAn eye that follows youAetherLiquid glass with an eye insideBloomcoreA word grows a garden of lightPyrokineThrow fire at the wallVoltaicThe pyramid throws lightningSurfSurf a shader ocean

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]
close