Skip to content
Code Generation
Skill

/shader-art-coding

Writes, debugs, and art-directs procedural GLSL fragment shaders (Shadertoy mainImage, WebGL2 / GLSL ES 3.00): SDF raymarching, procedural buildings/cities, 2D distance-field graphics, noise / fBm / domain warping, terrain, ocean/coastal water optics, clouds and other volumes,

From plugin
shader-skills
4901 skill

Claude Code

$ npx -y skills add gokayfem/shader-skills --skill shader-art-coding --agent claude-code

SKILL.md

shader-art-coding.SKILL.md
name: shader-art-coding
description: >-
  Writes, debugs, and art-directs procedural GLSL fragment shaders (Shadertoy mainImage, WebGL2 / GLSL ES 3.00):
  SDF raymarching, procedural buildings/cities, 2D distance-field graphics, noise / fBm / domain warping, terrain,
  ocean/coastal water optics, clouds and other volumes, structural color, black hole lensing, vector-field engraving, feedback simulations, PBR lighting, color and tonemapping. Ships a verified GLSL building-block library with a bundler and
  checker. Use when the user asks for a shader, Shadertoy, GLSL/.frag/.glsl code, a raymarcher, an SDF scene, a
  procedural texture or generative visual, or wants a shader fixed, optimized, ported or explained. Not for
  HLSL/Unity ShaderLab or non-graphics GPU compute.
license: MIT
metadata:
  hermes:
    tags:
      - shader
      - glsl
      - shadertoy
      - procedural-art
      - raymarching
      - sdf
    category: development

Shader Art Coding

Treat shader work as visual engineering: start from the intended image, choose the smallest mathematical model that can produce it, build it in inspectable stages, and verify each stage with a debug view.

Workflow

1. **Target.** State the image: subject, camera and framing, dominant forms, materials, light, motion. 2. **Route.** Consult [the example guide](references/example-selection.md) for working sources and visual checks. Pick the rendering model and starting template from `references/subject-routing.md`: 2D distance fields (posters, icons, patterns), SDF raymarching (objects, characters), heightfield marching (landscapes), volume integration (clouds, smoke, fire). For optical mechanisms, orbital light paths, vector-field prints or evolving patterns, use `references/research-studies.md` to select the representation and a visible test of its behavior. 3. **Assemble from the library.** Find building blocks with `python3 scripts/glsl_tools.py search <words>` or `references/library-index.md`, and call them by name. Do not paste or re-derive library code; it is tested. Run `python3 scripts/glsl_tools.py examples <exactName>` to locate direct calls and debug views. Use `rg -n -w <symbol>` within the relevant world directory for host-side callers. 4. **First image fast.** Coordinates, background, one primitive, one light. Then add the debug views. 5. **Refine in order:** proportions, composition, material separation, lighting, atmosphere, color, antialiasing, performance. 6. **Bundle and check.** `python3 scripts/glsl_tools.py bundle shader.glsl -o out.glsl` inlines exactly the functions used. `python3 scripts/glsl_tools.py check out.glsl` lints it and compiles it with glslangValidator when installed. Fix every error, then deliver `out.glsl`.

Run the scripts from this skill's directory. They need only Python 3.

Conventions

  • **Coordinates:** `vec2 uv = (2.0 * fragCoord - iResolution.xy) / iResolution.y;`, so one pixel is

`2.0 / iResolution.y`.

  • **Scene contract:** `vec2 map(vec3 p)` returns `vec2(distance, materialId)`. `raymarch`, `calcNormal`,

`softShadow`, `calcAO` and `sdfThickness` all use it.

  • **Debug:** `#define DEBUG_MODE 0` with 0 final, 1 distance field, 2 normals, 3 ids, 4 steps, 5 masks,

6 lighting terms.

  • **Color pipeline:** light in linear and decode picked colors with `srgbToLinear`. Then exposure, then the

tonemap (`tonemapAgX` by default, per AA sample), then the average, then `linearToSrgb` once, then `ditherTPDF`.

  • **Distances:** respect the `@exact` / `@bound` / `@approx` tags. If a deformation pushes Lipschitz above 1,

divide the distance or lower the `stepScale` of `raymarch`.

Hard rules (these break Shadertoy/WebGL)

  • No `#version` line, no custom uniforms, no `gl_FragColor` / `texture2D` / `iGlobalTime`.
  • No `?:` on structs. Use `vec2(distance, id)` or `if`.
  • Write float literals: `2.0 * PI`, `clamp(x, 0.0, 1.0)`.
  • No `fract(sin(...) * 43758.5453)` hashes. Use `hash12` / `hash22` / `hash33` (integer PCG). Replace them even

when porting with "keep the look": the sine hash's exact pattern already differs between GPUs, and a PCG hash on the same integer cell ids gives the noise the same look. `check` reports a sine hash as an error.

  • Guard NaN sources: `atan(0, 0)`, `pow` of negatives, `sqrt` of negatives, `normalize(vec3(0))`.
  • Keep `dFdx` / `fwidth` out of non-uniform branches and loops, or use an explicit pixel size.

Reference routing

Read only what the task needs:

| File | Read when | |---|---| | `references/subject-routing.md` | starting from a subject ("a jellyfish", "mountains"); maps formal names to subjects | | `references/library-index.md` | choosing functions: every library function with signature, exactness and uses | | `references/sdf-library-guide.md` | modeling: exactness tiers, blends, neighbor-checked repetition, deformation limits, WebGL pitfalls | | `references/rendering-pipeline.md` | lighting rigs, shadows/AO, sky and fog, volumes, tonemapping, AA, performance | | `references/noise-use-cases.md` | choosing Perlin/value/simplex/cellular noise, fBm/ridged/billow/warp/hybrid recipes, game use cases and primary-source code links | | `references/procedural-buildings.md` | parcel IDs, building massing, setbacks/roofs, facade filtering, city repetition and game integration | | `references/terrain-production.md` | terrain representations, designed valleys, slope/altitude materials, tracing limits, chunks and LOD | | `references/research-studies.md` | optics, null geodesics, streamline engraving, reaction-diffusion, terrain caching and offline playback | | `references/frame-budgets.md` | diagnosing low FPS, GPU timing, foliage culling, half-resolution shafts, cache invalidation, streaming budgets and adaptive resolution | | `references/vegetation-habitats.md` | placing tree groves, wet-bank species and understory from shared fields | | `references/world-rendering.md` | kelp forests, sponges, shipwrecks, tides, foliage deta

Read more
@gokayfem
Ships withshader-skills

Shader Skills helps coding agents write, debug and optimize procedural GLSL for Shadertoy and WebGL2. Start with an editable scene, change the lighting or geometry, and bundle it into a single shader.

Stars on GitHub

Momentum

stars in total
490
Star history of gokayfem/shader-skills on GitHub, a chart by star-history.com

More skills from other plugins.

orval

orval

Generate type-safe API clients, TanStack Query/SWR hooks, Zod schemas, MSW mocks, Hono server handlers, MCP servers, and…

orval5d6.6k
@orval-labs@orval-labsInstall Skill
claude-api

claude-api

Use this skill when the user is building against Anthropic APIs or SDKs, including `@anthropic-ai/sdk`, `anthropic`, or Agent SDK…

@oboard@oboardInstall Skill
emitting-output

emitting-output

Writing or converting formatted output in ripwire's C++ source — std::print/std::format via rw::emitTo, emitRaw and formatTo,…

ripwire6d2.5k
@redhat-et@redhat-etInstall Skill

Questions about shader-art-coding.

Which coding agents can use shader-art-coding?
shader-art-coding installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.