Shaders · 2 / 6

Dashboard
Creative coding · Shaders

Ripples from pure math

Treat v_uv as a coordinate plane. Feed it through sin, multiply frequencies, and remap with mix. Because pixels are wider than tall on most screens, multiply uv.x by aspect ratio (resolution.x / resolution.y) so stripes stay square-ish.

float bands = sin(uv.x * 40.0) * 0.5 + 0.5;
vec3 col = mix(darkColor, brightColor, bands);
Pro tip

Scale UV before trig to control spatial frequency — same trick drives water caustics (much heavier math later).

Next

Drive patterns with u_time from JavaScript.