Nodes: Expression

glint · Examples · Tutorials · Gallery

Visual node mode: when no node does what you want, the Expression node takes any GLSL. Here a wobbling spiral from the polar radius and angle.

Nodes: Expression: a GLSL shader

An example in glint, a free live shader editor in the browser: the GLSL code floats over the running picture and recompiles as you type.

The code

One pass, in GLSL.

fragment shader (generated from a node graph)

#version 300 es
precision highp float;

// Generated from nodes: edit the graph, or use "Convert to code" to take it from here by hand.
uniform vec2 resolution;
uniform float time;

in vec2 v_texcoord;
out vec4 fragColor;

void main() {
  // UV
  vec2 nn5dnf9jwe7_uv = (v_texcoord * 2.0 - 1.0) * vec2(resolution.x / resolution.y, 1.0);
  vec2 nn5dnf9jwe7_st = v_texcoord;
  // Polar
  float nn5dnf9kwhw_angle = (atan(nn5dnf9jwe7_uv.y, nn5dnf9jwe7_uv.x) / 6.2831853 + 0.5);
  float nn5dnf9kwhw_radius = length(nn5dnf9jwe7_uv);
  vec2 nn5dnf9kwhw_uv = vec2(atan(nn5dnf9jwe7_uv.y, nn5dnf9jwe7_uv.x) / 6.2831853 + 0.5, length(nn5dnf9jwe7_uv));
  // Expression
  float nn5dnf9ll93_out = float(sin((nn5dnf9kwhw_radius) * 14.0 - time * 3.0 + (nn5dnf9kwhw_angle) * 18.84956 + sin((nn5dnf9kwhw_angle) * 31.41593 + time) * 1.5));
  // Smoothstep
  float nn5dnf9mui0_out = smoothstep(-0.2, 0.6, nn5dnf9ll93_out);
  // Gradient
  vec3 nn5dnf9npn7_rgb = mix(vec3(0.02, 0.03, 0.12), vec3(1.0, 0.75, 0.3), clamp(nn5dnf9mui0_out, 0.0, 1.0));
  fragColor = vec4(nn5dnf9npn7_rgb, 1.0);
}

More Nodes & glitch examples

Nodes: Polar rings · Nodes: Ink clouds · Nodes: Kaleido checker · Nodes: Neon grid · Nodes: Sunset stripes · Nodes: Spotlight · Nodes: Colour wheel rings · Nodes: Marble