跳到正文
cccskills
免费在 GitHub 公开

ck:shader

Write GLSL fragment shaders for procedural graphics. Topics: shapes (SDF), patterns, noise (Perlin/simplex/cellular), fBm, colors (HSB/RGB), matrices, gradients, animations. Use for generative art, textures, visual effects, WebGL, Three.js shaders.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(13)

  • SKILL.md3.7 KB
  • references/glsl-cellular-voronoi-worley-noise-patterns.md3.3 KB
  • references/glsl-colors-rgb-hsb-gradients-mixing-color-spaces.md3.1 KB
  • references/glsl-fbm-fractional-brownian-motion-turbulence-octaves.md3.0 KB
  • references/glsl-fundamentals-data-types-vectors-precision-coordinates.md2.4 KB
  • references/glsl-noise-random-perlin-simplex-cellular-voronoi.md2.8 KB
  • references/glsl-pattern-symmetry-truchet-domain-warping.md2.8 KB
  • references/glsl-patterns-tiling-fract-matrices-transformations.md2.4 KB
  • references/glsl-procedural-textures-clouds-marble-wood-terrain.md3.0 KB
  • references/glsl-shader-builtin-functions-complete-api-reference.md2.9 KB
  • references/glsl-shapes-polygon-star-polar-sdf-combinations.md2.9 KB
  • references/glsl-shapes-sdf-circles-rectangles-polar-distance-fields.md2.4 KB
  • references/glsl-shaping-functions-step-smoothstep-curves-interpolation.md2.8 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

GLSL Fragment Shaders

Write GPU-accelerated fragment shaders for procedural graphics, textures, and visual effects.

When to Use

  • Creating procedural textures (wood, marble, clouds, terrain)
  • Drawing shapes with distance fields (SDF)
  • Generating patterns, noise, gradients
  • Building visual effects and animations
  • Writing custom shaders for Three.js, WebGL, Processing

Core Concepts

Fragment shaders execute simultaneously on every pixel. Each thread:

  • Receives pixel position via gl_FragCoord
  • Returns color via gl_FragColor (vec4: RGBA 0.0-1.0)
  • Cannot communicate with other threads (stateless)

Standard Uniforms

uniform float u_time;       // Elapsed seconds
uniform vec2 u_resolution;  // Canvas size (width, height)
uniform vec2 u_mouse;       // Mouse position in pixels

Normalize coordinates: vec2 st = gl_FragCoord.xy / u_resolution;

Essential Functions

FunctionPurposeExample
mix(a,b,t)Linear interpolatemix(red, blue, 0.5)
step(edge,x)Hard thresholdstep(0.5, st.x)
smoothstep(e0,e1,x)Smooth thresholdsmoothstep(0.2, 0.8, st.x)
fract(x)Fractional partfract(st * 3.0) for tiling
mod(x,y)Modulomod(st.x, 0.25)
clamp(x,min,max)Constrain valueclamp(col, 0.0, 1.0)
length(v)Vector magnitudelength(st - 0.5)
distance(a,b)Euclidean distancedistance(st, center)
dot(a,b)Dot productdot(normal, lightDir)
normalize(v)Unit vectornormalize(direction)
atan(y,x)Angle (radians)atan(st.y-0.5, st.x-0.5)
sin/cos/pow/absMathHardware-accelerated

Quick Patterns

Circle:

float d = distance(st, vec2(0.5));
float circle = 1.0 - smoothstep(0.2, 0.21, d);

Rectangle:

vec2 bl = step(vec2(0.1), st);
vec2 tr = step(vec2(0.1), 1.0 - st);
float rect = bl.x * bl.y * tr.x * tr.y;

Tiling:

st = fract(st * 4.0);  // 4x4 grid

Animation:

float wave = sin(st.x * 10.0 + u_time) * 0.5 + 0.5;

References (Progressive Disclosure)

Fundamentals

  • references/glsl-fundamentals-data-types-vectors-precision-coordinates.md
  • references/glsl-shaping-functions-step-smoothstep-curves-interpolation.md

Drawing

  • references/glsl-colors-rgb-hsb-gradients-mixing-color-spaces.md
  • references/glsl-shapes-sdf-circles-rectangles-polar-distance-fields.md
  • references/glsl-shapes-polygon-star-polar-sdf-combinations.md

Procedural

  • references/glsl-patterns-tiling-fract-matrices-transformations.md
  • references/glsl-pattern-symmetry-truchet-domain-warping.md
  • references/glsl-noise-random-perlin-simplex-cellular-voronoi.md
  • references/glsl-cellular-voronoi-worley-noise-patterns.md
  • references/glsl-fbm-fractional-brownian-motion-turbulence-octaves.md
  • references/glsl-procedural-textures-clouds-marble-wood-terrain.md

API Reference

  • references/glsl-shader-builtin-functions-complete-api-reference.md

Tools

  • Online Editor: editor.thebookofshaders.com
  • glslViewer: CLI tool for running .frag files
  • glslCanvas: HTML embed for live shaders
  • ShaderToy: iTime, iResolution, iMouse uniforms

External Resources

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

AI-optimized browser automation CLI with context-efficient snapshots. Use for long autonomous sessions, self-verifying workflows, video recording, and cloud browser testing (Browserbase).

中文简介正在准备中。当前显示原文说明。

manhvann/codexkit892026年8月29日 更新

Generate images via Nano Banana with 129 curated prompts. Mandatory validation interview refines style/mood/colors (use --skip to bypass). 3 modes: search, creative, wild. Styles: Ukiyo-e, Bento grid, cyberpunk, cinematic, vintage patent.

中文简介正在准备中。当前显示原文说明。

manhvann/codexkit892026年8月29日 更新

Analyze images/audio/video with Gemini API (better vision than Codex). Generate images (Imagen 4), videos (Veo 3). Use for vision analysis, transcription, OCR, design extraction, multimodal AI.

中文简介正在准备中。当前显示原文说明。

manhvann/codexkit892026年8月29日 更新

ck:ask

免费

Answer technical and architectural questions with expert consultation.

中文简介正在准备中。当前显示原文说明。

manhvann/codexkit892026年8月29日 更新

Build backends with Node.js, Python, Go (NestJS, FastAPI, Django). Use for REST/GraphQL/gRPC APIs, auth (OAuth, JWT), databases, microservices, security (OWASP), Docker/K8s.

中文简介正在准备中。当前显示原文说明。

manhvann/codexkit892026年8月29日 更新

Add authentication with Better Auth (TypeScript). Use for email/password, OAuth providers (Google, GitHub), 2FA/MFA, passkeys/WebAuthn, sessions, RBAC, rate limiting.

中文简介正在准备中。当前显示原文说明。

manhvann/codexkit892026年8月29日 更新

查看 manhvann 的全部技能

报告此技能的问题