概要
AIコーディングエージェント向けのプロシージャルGLSL。21モジュールにまたがる197個の異なる関数名、27個のインタラクティブなShadertoy/WebGL2作品、2つのWebGPUワールド、シェーダーバンドラー、チェッカーを収録しています。
開発ツール計測したスター増加
- 24時間
- +9
- 7日間
- +158
- 15日間
- +247
- 1か月
- 履歴を収集中
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
README.md
オリジナルShader Skills — GLSL & Shadertoy for AI coding agents
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. The skill includes 197 distinct GLSL function names across 21 modules, a dependency bundler and a checker. It works with Claude Code, Codex, Cursor, GitHub Copilot and Gemini CLI.
The full repository includes 27 interactive shader studies and two WebGPU worlds. Use the studies to isolate an effect, then explore how a swimmable kelp forest or a streamed landscape handles visibility, lighting and frame time. Offline shader viewer · WebGPU worlds · Performance guide
npx skills add gokayfem/shader-skills
Choose shader-art-coding and your coding agent in the installer. Then ask:
Create a Shadertoy shader of an alpine valley with snow, a winding river and atmospheric depth. Use the shader-art-coding skill, bundle the result into one file, and check it.
Install options · Shader gallery · Usage · GLSL library · Video-to-shader prompt · Releases · Contributing
Explore the shader studies
Open the self-contained shader viewer from a local checkout, or download the HTML using GitHub’s Download raw file button. It runs offline in a WebGL2 browser. Explore 24 single-pass shaders and three multipass examples. Pause motion, inspect diagnostic views, or switch between fixed resolution and adaptive 30 or 60 fps targets.
![]() |
![]() |
![]() |
|---|---|---|
| Morpho. Change the optical period or watch the left and right wings flash as they tilt. | Comb jelly. Follow the light along eight rows of beating plates. Turn off the side light to isolate the transparent body. | Accretion disk. Lower the camera toward the disk and watch its far side arc over the shadow. Toggle light-path caching. |
![]() |
![]() |
![]() |
| Streamline press. Paper grain follows a vector field around a vermilion cylinder. Change its radius to move the stagnation points. | Reaction–diffusion. Drag to seed a two-channel feedback simulation. Change the feed and removal rates to grow a different pattern. | Cached alpine valley. Move the camera over a retained elevation texture. Three-camera comparison |
The research studies guide links the original papers, explains the approximations and gives a second shot to try for each technique.
Dive, landscape and lighting studies
Compare the chamber to its 80-patch feedback solver in the offline viewer. The world rendering guide gives a diagnostic experiment for each scene.
The full checkout also contains a swimmable WebGPU dive and a Rust/WebGPU landscape renderer with a browser editor. Open the worlds guide for launch instructions and subsystem walkthroughs, or browse all 541 source files and assets.
Measure rendering performance
Where you spend pixels matters. On an Apple M4 in Chrome, reducing the fixed cloud study from 800 × 450 to 480 × 270 cut median image-pass time from 15.00 to 5.55 ms. The same change saved 0.70 ms on the wreck. Each figure includes a one-pixel readback and comes from 60 samples per size. Benchmark method and p95 results
The worlds show how those decisions look in a complete renderer. Trace half-resolution light shafts and distance-based kelp geometry in the dive, or follow cluster rejection and coarse-first streaming in the landscape. Rendering techniques · Frame pacing at six dive viewpoints
Shader gallery
Inspect the grain, normals, and layer masks in the material study.
The agate shader combines filtered mineral bands with a faceted quartz pocket. Adjust BAND_COUNT to change the
spacing and BACKLIGHT to bring out the translucent center. The Voronoi crystal calculation runs inside the pocket.
Open Woodland Edge in the offline viewer to widen the wet bank or clear trees and inspect the understory response. Habitat study
Each image links to its paste-ready shader. The sources are in skills/shader-art-coding/templates/.
Why
Coding agents can misremember formulas or skip visual checks, and WebGL rejects code that desktop GLSL accepts. Common results are struct ternaries, sine hashes that differ per GPU, SDFs with wrong signs, double gamma, and fog that ignores the sky. This skill closes those gaps:
Tested building blocks instead of recalled ones. Every SDF is checked on the GPU:
- the Lipschitz bound (safe to raymarch);
- exactness, by projecting points onto the surface;
- inside/outside signs;
- for curves, agreement with brute-force distance.
Noise derivatives are checked against finite differences, curl noise for zero divergence, color transforms for round trips, and intersectors against their SDFs.
A bundler, so the agent writes
sdRoundCone(...),softShadow(...),tonemapAgX(...)by name and ships one self-contained file.A checker that catches WebGL1 leftovers, sine hashes,
#versionlines and missingmainImage, and compiles with glslangValidator.A workflow with a fixed debug-mode convention, so problems are inspected as fields rather than guessed at.
Routing from subjects ("a jellyfish", "snowy mountains") to techniques, templates and formulas.
Install
Claude Code (plugin marketplace):
claude plugin marketplace add gokayfem/shader-skills
claude plugin install shader-skills@shader-skills
For a manual Claude Code installation, copy skills/shader-art-coding into ~/.claude/skills/ after cloning the repository (see below).
Codex, Cursor, Gemini CLI, GitHub Copilot and other supported agents (via skills):
npx skills add gokayfem/shader-skills
The installer requires Node.js 22.20 or later and installs into the current project by default; add -g for a
global installation. See the skills CLI documentation for supported agents.
Manual installation: clone the repository first, then copy the skill into your agent's skill directory.
git clone https://github.com/gokayfem/shader-skills.git
cd shader-skills
- Codex: copy
skills/shader-art-codingto~/.agents/skills/. - Cursor: copy it to
~/.cursor/skills/, plus the rule inadapters/cursor/. - Copilot:
gh skill install gokayfem/shader-skills shader-art-coding, plusadapters/copilot/. - Gemini CLI:
gemini extensions install https://github.com/gokayfem/shader-skills. - Hermes: copy it to
~/.hermes/skills/.
claude.ai: download shader-art-coding-v3.0.0.zip from the v3.0.0 release and upload it under Settings > Capabilities > Skills. The ZIP also works as a portable skill folder for manual installation.
ChatGPT, Gemini Gems and other chat tools: see adapters/.
Use
The skill looks for ready-to-use shaders in GLSL Studies first. Browse the previews by subject and open one to read its shader. The bundled example guide covers local templates and visual checks.
Copy the general shader task prompt for creation, repair, explanation or optimization. For shot-by-shot recreation, use the reference video prompt.
Ask naturally: "Make a Shadertoy shader of a glass jellyfish drifting through god rays", or "why does my raymarcher have holes?" The skill routes the request, then the agent finds blocks, writes the shader, bundles it and checks it. From a cloned repository, try the included still-life template:
python3 skills/shader-art-coding/scripts/glsl_tools.py search petal leaf
python3 skills/shader-art-coding/scripts/glsl_tools.py bundle skills/shader-art-coding/templates/raymarch-sdf.glsl -o /tmp/shader-skills-example.glsl
python3 skills/shader-art-coding/scripts/glsl_tools.py check /tmp/shader-skills-example.glsl
What the commands do:
examples fresnelDielectriclists direct example calls by source line and shows the coastal-water shader’s debug modes, including mode 5 for Fresnel.searchranks functions by name, summary and@usetags.bundleresolves dependencies transitively and emits them in declaration order.checklints the file and compiles it whenglslangValidatoris installed (brew install glslangorapt install glslang-tools).
The command-line tools need Python 3 and use only its standard library. Generated shaders target Shadertoy / WebGL2 / GLSL ES 3.00; HLSL and Unity ShaderLab are outside this skill's scope.
For an existing video reference, start with the video-to-shader prompt, which guides scene analysis, procedural reconstruction and visual comparison against the clip.
What's in the library
| Module | Highlights |
|---|---|
common |
Rotation, remapping and curve helpers |
relativity |
Schwarzschild light-path integration for the lensed accretion disk |
hash |
PCG integer hashes (pcg3d, pcg4d): bit-exact across GPUs, no sine; safe integer-input float wrappers |
noise |
value, gradient and 2D simplex noise with analytic derivatives, fBm, eroded/ridged/billow fBm, two-level domain warp, hybrid terrain height, curl noise, Voronoi (F1/F2, borders, smooth), interleaved-gradient and R2 dithering |
pattern |
box-filtered checker, grid and stripes (alias-free with no supersampling), hex grid with edge distance, Truchet |
sdf3d |
22 primitives including exact capped cone, round cone, cut and hollow spheres, death star, hex prism, link, gyroid, 3D Bézier tube |
sdf2d |
20 primitives including vesica, moon, heart, star, regular polygon, rounded box with per-corner radii, quadratic Bézier |
operators |
smooth min/max/subtract (quadratic and C2 cubic), smooth union with material blend weight, chamfer, stairs, engrave, round, onion, extrude, revolve, exact elongate |
domain |
repetition (infinite, limited, mirrored), polar sectors, folds, twist and bend with their Lipschitz corrections |
architecture |
stable parcel-based building dimensions/roof IDs, box-filtered facade windows that converge to opening area |
raymarch |
sphere tracing with distance-relative hit threshold, tetrahedral normals, improved soft shadows, AO, thickness; WebGL-safe loops |
shading |
GGX + height-correlated Smith + Schlick, metallic-roughness shadePBR, environment BRDF approximation, wrap diffuse, translucency, rim |
water |
finite-depth dispersion, analytic wave height/slope/curvature, exact dielectric Fresnel including TIR, RGB Beer-Lambert attenuation |
color / tonemap |
exact sRGB curves, Oklab / OkLCh mixing, blackbody colors; AgX (default), AgX punchy, Khronos PBR Neutral, ACES fitted, Reinhard |
volume / atmosphere |
HG, dual-lobe, Rayleigh and Cornette-Shanks phase, energy-conserving volumeStep, Beer-Powder, analytic height fog; physically based single-scattering sky, sun disk with limb darkening |
camera / intersect / post / debug |
look-at, thin-lens DOF, ortho; analytic sphere/box/plane hits; AA helpers, R2 supersampling offsets, cos⁴ vignette, grain, TPDF dither; distance, normal, id and heat debug views |
The full catalog with signatures, exactness and uses is
references/library-index.md.
Noise: from a first field to a game use case
The noise learning guide covers all ten entries in the Noise Learning Progression reference: what each means, where its code lives, when to use it, tuning, and links to author-maintained external implementations. It includes eleven compile-checked recipes and two complete shaders.
| Technique | Call the library | Use it for |
|---|---|---|
| Perlin-style gradient | gradientNoise, gradientNoiseD |
Broad hills, weather masks, surface normals |
| Voronoi | voronoiBorder, smoothVoronoi |
Rock plates, constant-width cracks, cell walls |
| Simplex | simplexNoise, simplexNoiseD |
Ripples, rotating-gradient flow, churning lava |
| Fractal / fBm | fbm, erodedFbm |
Multiscale terrain, clouds, slope-damped detail |
| Domain warp | warpedFbm |
Marble, agate, distorted terrain and cloud bands |
| Value | valueNoise, valueNoiseD |
Cheap smooth masks; quantize inputs for retro blocks |
| Cellular / Worley | voronoi F1/F2 and cell IDs |
Biome regions, foam, per-stone variation |
| Ridged | ridgedFbm |
Mountain crests, canyons, rocky veins |
| Billow | billowFbm |
Puffy smoke, cumulus lobes, rounded terrain |
| Hybrid | hybridTerrainHeight |
Bounded heightmaps combining warped hills, ridges and cells |
These functions are in noise.glsl. Voronoi and Worley refer to the
same cellular family here; fBm and domain warping compose base fields. Simplex performance depends on implementation
and target hardware. The guide distinguishes smooth value noise from blocky hashes and designed river masks from
hydrological simulation.
Click a preview for the standalone Shadertoy shader. Editable sources:
noise-progression.glsl and
noise-terrain-map.glsl.
Procedural buildings, terrain and water
Three complete, texture-free starting points cover construction, landscape and shallow-water optics. Each has art controls, inspectable debug modes, a standalone Shadertoy bundle and a rendered preview.
- Procedural buildings: massing hierarchy, deterministic parcels, neighbor-safe repetition, facade filtering, geometry versus material detail, and mesh/engine integration.
- Terrain production: heightfields versus density, silhouette/detail separation, primary-trace refinement, biome masks, chunk coordinates, seams and LOD.
- Water quality: shallow coast versus open ocean, reflection/refraction paths, finite-depth waves, filtering, quality presets, and the extra renderer/simulation systems needed for film or production water. The existing open-ocean shader remains available.
The coastal example uses QUALITY 1/2/3 for sky reflection, reflected-land rays, and a four-sample still preset
with more waves/steps. It is a single-pass visual study: foam, in-scattering and caustics include artistic
approximations; it does not simulate breaking surf or FFT ocean spectra. The guides identify implemented features
and limits rather than promising a universal “highest quality” or frame rate.
Sources are in templates/. Bundle with glsl_tools.py bundle as above.
All three water presets and every annotated diagnostic view are compiled and rendered by the harness.
Verification
| Check | Where | What it proves |
|---|---|---|
| Lint + drift | glsl_tools.py check |
docs and tags on every function, module order, no WebGL1 or sine-hash patterns, reference snippets identical to the library |
| glslang compile | CI (checks.yml) |
every library module, reference snippet and template compiles as GLSL ES 3.00 |
| WebGL2 compile | tests/ harness |
all library/reference/template units and annotated quality/debug variants compile under ANGLE, which also enforces WebGL-only rules |
| GPU property tests | tests/properties.py |
101 tests × 16,384 samples: Lipschitz, exactness, signs, brute-force curve distance, derivatives, divergence, ranges, round trips, facade filtering, water dispersion/Fresnel/attenuation |
| Renders | harness + gallery | 24 beauty templates plus 32 quality/debug variants; no NaNs or black frames; beauty PNGs saved to gallery/ |
| Bundler regressions | tests/test_bundler.py |
conditional quality macros cannot hide dependencies; annotated variants replace the intended define and reject missing defines |
| Skill effect | evals/ (claude plugin eval, paid, manual) |
output-rule adherence with the skill vs without it on 6 shader tasks, plus no false triggers on 3 near-miss tasks; see evals/README.md |
Run it locally: python3 tests/build_harness.py && python3 tests/serve.py, then open
http://127.0.0.1:8765/build/harness.html. Headless: python3 tests/run_webgl.py (needs Playwright).
To measure a shader change, run python3 tests/run_webgl.py --benchmark --size 320x180 on both revisions with
the same browser, renderer and resolution. Each beauty shader gets one warm-up draw and seven timed draws at
the same animation time. The JSON records all seven samples and their median in milliseconds, including pixel readback.
Conventions
#define DEBUG_MODE 0: 0 final, 1 distance field, 2 normals, 3 ids, 4 steps, 5 masks, 6 lighting terms.- Scene contract
vec2 map(vec3 p)returnsvec2(distance, materialId). - Color pipeline:
- Light in linear color.
- Apply exposure.
- Tonemap each AA sample.
- Average the samples.
- Encode once with
linearToSrgb. - Dither.
Repository
skills/shader-art-coding/ the skill: SKILL.md, glsl/ library, templates/, references/, scripts/glsl_tools.py
tests/ WebGL2 harness, GPU property tests, gallery builder, headless runner
evals/ plugin eval suite: with vs without the skill
gallery/ offline viewer, rendered previews and paste-ready shader bundles
worlds/ WebGPU dive, landscape engine, launch instructions and source catalog
adapters/ prompts for tools without skill support
.claude-plugin/ Claude Code plugin + marketplace manifests
See CONTRIBUTING.md to report a bug, suggest a shader technique or contribute a fix. AGENTS.md defines the checks every library change must pass. Release history and downloads are in the changelog and GitHub Releases.
Credits and license
The GLSL library is released under the MIT license. Its technique sources include Inigo Quilez, hg_sdf, Jarzynski and Olano, Hillaire, AgX, Khronos PBR Neutral, and Oklab. Full credits and sources
Thanks to SamG-Coder for SmartImposter’s forest and ground rendering work and KingdomComeGlueMapper’s material and vegetation studies. Morten S. Mikkelsen published the hex-tiling technique behind the stochastic grain study. Material and vegetation credits
The bundled WebGPU worlds retain their original MIT notices for Dive by Maksymilian Dendura and Landscape engine by SamG-Coder.
関連プロジェクトを探す
読み込み中…

























