/3dcodeverse:3d-lang-glsl-shaderfrom 3dcodeverse
Provides GLSL 330 fragment shader conventions, file structure, uniform block, entry points, and frame-gate thresholds for writing/refining graphics-track shaders in a 3dcode build pipeline.
Ships in 3dcodeverse. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You write ONE Shadertoy-style image pass; the build wraps it, compiles it (OpenGL 3.3 core,
headless), renders the judged frames and a preview GIF up to duration_s, measures them and
shows them to the judge. Every frame is a pure function of the pixel and absolute u_time
(plus the samplers); there is no state between pixels.
src/shader.frag REQUIRED the image pass: mainImage() composites the layers — a few dozen lines (no #version, no uniform/out declarations)
src/*.glsl include files, ONE LAYER EACH, a few KB: 10_noise.glsl, 20_sky.glsl, 30_aurora.glsl, 40_terrain.glsl … — pasted ABOVE shader.frag (and buffer_a.frag) at build time, common.glsl first if present, then file-name order (number the prefixes so helpers precede their callers); functions and constants only
src/buffer_a.frag optional ONE feedback buffer pass, rendered every frame before the image pass
Nothing else is read (a file under src/ of another kind, or a .glsl in a subfolder, is a lint
WARN stray_file). Every error the build prints names the include file and ITS line.
references/interface.md is the interface, executable.
#version 330 core
uniform float u_time; // seconds; judged frames at t = 0, 1, 2.5, 4, 6 s
uniform vec2 u_resolution; // pixels
uniform vec2 u_mouse; // always (0,0) headless
uniform int u_frame; // frame counter — NOT a clock: the sampled times are not evenly spaced
uniform sampler2D u_prev; // previous frame of THIS pass; black at frame 0
uniform sampler2D u_noise; // 256x256 RGBA white noise, repeat, linear: one fetch is a bilinear hash
uniform sampler2D u_buffer_a; // output of src/buffer_a.frag (only when that file exists)
#define iTime u_time // Shadertoy aliases: iTime iResolution iFrame iMouse iChannel0(=u_prev) iChannel1(=u_noise)
out vec4 fragColor; // the ONLY output
NOT available: iChannel2/3, iDate, iSampleRate, iChannelResolution, textures, images, sound.
void mainImage(out vec4 fragColor, in vec2 fragCoord) (preferred) or void main() using
gl_FragCoord.xy. Pixel coordinates, origin BOTTOM-LEFT, y up (the build flips rows when it
writes PNGs). u_prev / u_buffer_a are sampled at fragCoord / u_resolution. Circles must
stay round at the plan's resolution (judge defect stretched_aspect, −0.06): normalise both
axes by u_resolution.y.
3dcode gl-frames; the cap is the highest score the round can get)| measured | threshold | finding | cap |
|---|---|---|---|
| any NaN / Inf pixel | ≥ 1 | nan ERROR | 0 |
| every frame black | > 97 % of pixels under luminance 0.03 in each frame | black ERROR | 0.5 |
| every frame blown | > 97 % over 0.98 in each frame | blown ERROR | 0.5 |
| largest mean |Δ| between consecutive frames | < 0.002 (plan motion non-empty) | static WARN | 0.5 |
| largest mean |Δ| between consecutive frames | > 0.35 | flicker WARN | 0.7 |
| mean edge density | < 0.002 | low_detail WARN | none (the judge is told) |
| any lint ERROR | 0.6 | ||
| build failure (compile error, render timeout) | 0 | ||
| NaN sources: division by zero, sqrt / pow / log of a negative, normalize of a zero vector, | |||
acos / asin outside [−1, 1]. An unmet must acceptance item caps at 0.7. |
texture() not texture2D; fragColor not gl_FragColor; no varying /
attribute; % is integer-only — mod(x, y) on floats.const), no out, no #version,
no #include; precision is ignored (INFO). Only u_prev, u_noise, u_buffer_a may be
sampled. An include file must not define main() / mainImage(); inside buffer_a.frag the
previous buffer is u_prev (sampling u_buffer_a there is a WARN). > 60 000 characters in
one file WARN — split the layers.src/<file>:LINE: error: … — the include file or pass and YOUR line number in it. "no matching function": an int
literal where a float is expected (pow(2, 3), mod(x, 2)) — write 2.0; "too few
components": vec4(col) of a vec3 needs vec4(col, 1.0); "redeclaration": a harness uniform
declared again; "undeclared": a typo, or a helper defined in an include file that sorts AFTER its caller. Loop bounds are
compile-time constants (break early inside); smoothstep(a, b, x) is undefined for a ≥ b; a
frame that does not finish inside the render timeout fails the build.
u_prev is THIS pass's previous frame (black at frame 0); buffer_a.frag reads its own
previous output as u_prev (neighbours at uv ± 1.0 / u_resolution) and shader.frag reads
it as u_buffer_a. An accumulation with gain ≥ 1 saturates by t = 6 s (blown). No
per-frame random seeds, nothing that depends on u_frame alone (flicker).
shader) namesWeights: likeness 0.26, depth_and_detail 0.16, light_and_tone 0.16, motion_quality 0.14,
composition 0.10, technical_cleanliness 0.10, craft 0.08. Likeness: the wrong physics scores
0.4 however complete the inventory — evenly spaced bars standing in for curtains, rays, flames
or waves (comb_artefact, −0.10, cap 0.65); hard-edged opaque shapes standing in for light —
bokeh, glow, aurora, neon (opaque_shapes_for_light, −0.08); a few sparkles for a star field
(a star field is thousands of points); a flat wash for a nebula. Depth and detail: one
texture or noise field filling the frame is flat_fill (−0.08); staircase edges
banding_or_aliasing (−0.05, and a technical_cleanliness deduction). Light and tone: a night
subject with nothing near-black no_dark_range (−0.06); haze lifting a region toward white
white_wash (−0.08); uniformly candy-saturated colour candy_saturation (−0.06). Motion: a
texture scrolling under a fixed shape is 0.5; a hard cut between two sampled times is
flicker (−0.08, cap 0.70). A textbook demo with the brief's colours swapped in is
placeholder_look (−0.10); an effect present in source but invisible in the frame is
wrong_subject (cap 0.40) — check the final fragColor write, the raymarch hit test, the ray
direction, a term multiplied to zero.
write one include file per layer, then shader.frag → 3dcode gl-probe (compiles? one frame at
t = 1 s) → fix each compile error at the file:line it names → 3dcode gl-probe again until it
compiles → 3dcode check (renders the judged frames, runs the gl_frames gate) → fix each
ERROR (NaN, black, blown) → 3dcode judge. Do not finish while gl-probe reports anything:
measured on a ten-rung ladder, sessions that ran this loop compiled 10 of 10, sessions without
it 5 of 10. When a frame or a judge item says a layer looks wrong, edit THAT layer's function
in its include file (the host's edit tool, scoped to the lines); never rewrite a file. Deleting
a layer is a legitimate fix. The round's hand-over, the one look at renders per refine round and the stop rules are the 3dcodeverse skill's ## The loop.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub gaoypeng/3dcodeverse --plugin 3dcodeverse29 skills in this plugin
/3dcodeverseUse for ANY request to make, measure, judge or improve a 3D thing in code: a model, object or prop, a mechanism or robot with joints, a scene or environment, a shader or OpenGL effect — in Blender bpy, CadQuery, Three.js, URDF, GLSL or moderngl. This is 3D coding with the 3dcodeverse plugin: raw executable 3D code that the 3dcode instruments build, measure, render, gate and score. First step, all in ONE read: this file, skills/3d-lang-<language, hyphenated>/SKILL.md and skills/3dcodeverse/references/plan-<static|articulated|scene|graphics>.md (urdf_blender: also skills/3d-lang-blender/SKILL.md and plan-static.md, which it builds on); no c3d-* skill until a 3dcode finding or score item names its topic./3d-lang-blenderUse when writing, refining or repairing a static_object in Blender bpy (language blender): the files and builder names the lint expects, the Z-up metre frame, naming, the sandbox (allowed imports, forbidden bpy calls), the exact thresholds check-contract / check-connectivity / detail_budget measure, what the GLB exporter keeps, the Blender 5.2.2 API traps, and the 3dcode loop that ships it./3d-lang-cadqueryUse when writing, refining or repairing a static_object in CadQuery (language cadquery): the module-level `result` assembly the wrapper reads, named parts and instances, the Z-up metre frame, the lint's import and call lists, the thresholds check-contract / check-connectivity / detail_budget measure, the OCC kernel facts that fail a build, and the 3dcode loop./3d-lang-opengl-pythonUse when writing, refining or repairing a graphics-track moderngl program (language opengl_python): the two entry points setup/render and their exact signatures, the sampled-time trap (render is called at t = 0, 1, 2.5, 4, 6 s, in any order), the final pass into the supplied fbo, the AST lint's import allow-list and forbidden calls, the moderngl facts that decide whether the build runs, the gl-frames gate caps, and the 3dcode loop./3d-lang-scene-blenderUse when writing, refining or repairing a scene in Blender bpy (language scene_blender): the module files and their exact functions (env height_at/build_env, zone build, asset build_<snake>), the ctx every builder receives, the Z-up frame and the Y-up plan conversion, allowed imports and the lint's forbidden table, Blender 5.2 API facts, what Cycles does with what you build, motion as keyframes/drivers, the placement and frame gate thresholds, and the 3dcode loop./3d-lang-scene-threejsUse when writing, refining or repairing a scene in three.js (language scene_threejs): the module files and their exact exports (createScene, env heightAt/buildEnv/SUN_AZIMUTH_DEG, zone build, asset build<Name>), the Y-up metre frame, imports and the forbidden list, the harness-owned src/lib toolbox, the thresholds check-placement, scene-views (exposure, camera, motion) and scene-probe measure, naming, and the 3dcode loop.Other plugins' skills for the same job