Skip to contentCREATIVE·CODE·ART
1
1
3
GLSL shader

Ink Current

A TouchDesigner GLSL TOP shader running in the browser: simplex-noise ink with a feedback trail, the way a Feedback TOP smears light. The live example for the TouchDesigner guide.

Licence: CC BY-NC-SA 4.0: remix with credit, non-commercial, share alike

View the code
uniform float uTime;
uniform float uSpeed;
uniform float uFlow;
uniform float uScale;
out vec4 fragColor;
void main() {
  vec2 p = vUV.st - 0.5;
  p.x *= 1.4;
  float t = uTime * 0.12 * uSpeed;
  float n1 = TDSimplexNoise(vec3(p * uScale, t));
  float n2 = TDSimplexNoise(vec3(p * uScale * 2.3 + 7.0, t * 1.4));
  float ink = n1 * 0.65 + n2 * 0.35;
  float ridge = pow(1.0 - abs(ink), 3.0);
  float hue = 0.52 + 0.38 * ink + 0.10 * sin(t * 0.7);
  vec3 col = TDHSVToRGB(vec3(hue, 0.75, ridge));
  vec2 drift = vec2(n1, n2) * 0.006 * uFlow;
  vec3 prev = texture(sTD2DInputs[0], vUV.st + drift).rgb;
  col = max(col, prev * (0.90 + 0.06 * uFlow));
  fragColor = TDOutputSwizzle(vec4(col, 1.0));
}