TypologySienna Chen
ToolsMiddleweight

GLSL

The little language that colors every pixel.

The small language that runs on the graphics card to color every pixel and move every point. Almost every shader effect (liquid, smoke, glow, distortion) is a few dozen lines of it. One typo and the whole canvas goes black, so always ask for complete code.

Breaks when
one syntax error blanks the whole canvasprecision differs between desktop and mobile
Also called
fragment shader, vert/frag, shader code, GLSL ES

Prompts

Signed-distance logo reveal
GLSL ES 3.00 fragment shader for a ShaderMaterial on a full-screen plane. Build the brand mark from SDF primitives (two circles and a rounded box, smooth-min k = 0.08). Reveal: the zero contour dilates from −0.3 to 0 over 1.2 s with an ease-out-expo curve of uTime. Anti-alias the edge with fwidth. Colors come from two uniforms; no hex in the shader.
Noise you can tune from JS
A GLSL fragment shader with a 3-octave simplex FBM (include the noise function inline, no #include) driven by uniforms uScale, uSpeed, uWarp and uContrast, all exposed in a lil-gui panel. Comment each uniform with a sensible range. The image should read as slow smoke in one ink color on paper, not a rainbow.
Vertex displacement with correct normals
Vertex + fragment pair for a Three.js sphere: displace along the normal by FBM(position × 2.0 + uTime × 0.2) × 0.18. Recompute the normal in the vertex shader from two neighbouring samples (finite differences) so lighting stays right. Fragment: half-Lambert diffuse plus a rim term; output premultiplied alpha.

Related

Resources · 6