barmoshe/claude-creative-stack

shader-smith

Author GLSL fragment shaders for visual effects, backgrounds, post-processing, and generative visuals, and wrap them in a runnable WebGL2 or Three.js r128 preview.

소스 보기

사용 방법

  1. 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
  2. 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
  3. 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/barmoshe/claude-creative-stack --skill shader-smith

시작 전 확인

  • 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
  • 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 Skill 문서

원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.

Shader Smith

Opinionated about GLSL style; minimal about the host code.

When to trigger

  • "Write a shader that looks like X"
  • "Raymarch a scene"
  • "SDF logo"
  • "Background effect with mouse"
  • "Post-processing filter"

Pick a host first

TargetHost
Standalone preview, no sceneVanilla WebGL2 in one HTML artifact
In an existing Three.js r128 sceneShaderMaterial / RawShaderMaterial (artifact)
R3F scene<shaderMaterial /> — delegate to freshtechbro/claudedesignskills
Pixi v8 filterFilter + fragment shader

GLSL ES 3.00 template

glsl
#version 300 es
precision highp float;

uniform vec2  uResolution;
uniform float uTime;
uniform vec2  uMouse;       // 0..1

out vec4 fragColor;

// --- helpers ---------------------------------------------------------------
float hash21(vec2 p){ p = fract(p*vec2(234.34,435.345)); p += dot(p, p+34.23); return fract(p.x*p.y); }
float noise(vec2 p){
  vec2 i = floor(p), f = fract(p);
  float a = hash21(i), b = hash21(i+vec2(1,0)), c = hash21(i+vec2(0,1)), d = hash21(i+vec2(1,1));
  vec2 u = f*f*(3.-2.*f);
  return mix(a,b,u.x) + (c-a)*u.y*(1.-u.x) + (d-b)*u.x*u.y;
}

// --- main ------------------------------------------------------------------
void main(){
  vec2 uv = (gl_FragCoord.xy - 0.5*uResolution) / uResolution.y;
  float n = noise(uv*4.0 + uTime*0.3);
  vec3 col = mix(vec3(0.05,0.07,0.12), vec3(0.9,0.55,0.3), n);
  fragColor = vec4(col, 1.0);
}

Minimal WebGL2 host (HTML artifact)

Key points the scaffold must include:

  • Fullscreen triangle, not quad — 1 draw call, no index buffer.
  • Resize handler that sets canvas.width = cssW * devicePixelRatio.
  • requestAnimationFrame loop feeding uTime in seconds.
  • Pointer-move listener writing to uMouse normalized.
  • Respect prefers-reduced-motion — pause time.

Technique cheat sheet

TechniqueWhen to reach for
SDF 2D (circle/box/rounded) + smoothstepCrisp shapes, logos, UI glow
Domain warp (p += noise(p))Organic flows, liquid, fabric
fBm (fractal Brownian motion)Clouds, terrain noise, paper
Raymarch SDF 3D3D scenes with no geometry upload
Worley / VoronoiCells, skin, crystals
Feedback (ping-pong FBO)Trails, reaction-diffusion, blur

Delegation

  • Full scene-graph shader work with multiple passes → hand to freshtechbro/claudedesignskills Three.js / R3F skills.
  • This skill: single-shader effects + wrapper.

Common pitfalls

  • precision highp float; — always declare; mobile defaults vary.
  • #version 300 es must be the first line (no preceding comment).
  • Avoid dynamic loops on mobile GPUs — unroll or cap iterations.
  • gl_FragCoord.y points up in WebGL; invert if matching image coords.

Output shape

  1. Approach — 2 sentences on technique.
  2. Shader in a fenced block labeled glsl.
  3. Full HTML artifact (shader + host) in a fenced block labeled html.
  4. Uniform reference table.
  5. Known artifacts — one paragraph on mobile/perf caveats.

Further reading

  • knowledge/05-graphics-design.md — GLSL cheat sheet.
  • knowledge/03-artifacts.md — Three.js r128 and three/examples/jsm restrictions.
  • artifacts/html/shader-playground.html — working starter.

관련 작업

같은 저장소의 Skills

더 많은 Skills

모든 Skills