Communitygithub.com

majiayu000/claude-skill-registry-data

撰寫 GLSL 片段著色器,用於程序化圖形生成。主題包括:形狀(SDF)、圖案、雜訊(Perlin/Simplex/Cellular)、fBm、色彩(HSB/RGB)、矩陣、漸層、動畫。適用於生成式藝術、紋理、視覺特效、WebGL、Three.js 著色器。

claude-skill-registry-data 是什麼?

這個技能專為開發者與 AI 代理設計,提供撰寫 GPU 加速的 GLSL 片段著色器所需的完整知識與實用指南。它涵蓋了從基礎概念(如並行像素執行、標準 Uniform 變數)到進階程序化生成技術(包括 SDF 形狀繪製、Perlin/Simplex/Cellular 雜訊、fBm 分形布朗運動、HSB/RGB 色彩空間與漸層)的廣泛主題。支援的平台包括 WebGL、Three.js 以及 ShaderToy 等工具。其核心優勢在於提供可直接複製貼上的程式碼片段(如圓形、矩形、平鋪與動畫)、清晰的函式參考表格,以及逐步深入的參考文件路徑,讓使用者能快速入門並逐步精通。無論是建立程序化紋理、視覺特效還是生成式藝術,這份技能都能大幅降低著色器開發的學習門檻。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/majiayu000/claude-skill-registry-data/tree/HEAD/creative/shader-hoanghd218-landing-page-ai-kien-2

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

GLSL 片段著色器

撰寫 GPU 加速的片段著色器,用於程序化圖形、紋理與視覺效果。

使用時機

  • 建立程序化紋理(木紋、大理石、雲朵、地形)
  • 使用距離場(SDF)繪製形狀
  • 生成圖案、雜訊、漸層
  • 建立視覺效果與動畫
  • 為 Three.js、WebGL、Processing 撰寫自訂著色器

核心概念

片段著色器在每個像素上同時執行。每個執行緒:

  • 透過 gl_FragCoord 接收像素位置
  • 透過 gl_FragColor(vec4:RGBA 0.0-1.0)回傳顏色
  • 無法與其他執行緒通訊(無狀態)

標準 Uniform 變數

uniform float u_time;       // 已流逝的秒數
uniform vec2 u_resolution;  // 畫布大小(寬度, 高度)
uniform vec2 u_mouse;       // 滑鼠位置(像素)

歸一化座標:vec2 st = gl_FragCoord.xy / u_resolution;

常用函式

函式用途範例
mix(a,b,t)線性插值mix(red, blue, 0.5)
step(edge,x)硬閥值step(0.5, st.x)
smoothstep(e0,e1,x)平滑閥值smoothstep(0.2, 0.8, st.x)
fract(x)小數部分fract(st * 3.0) 用於平鋪
mod(x,y)模數mod(st.x, 0.25)
clamp(x,min,max)限制數值clamp(col, 0.0, 1.0)
length(v)向量長度length(st - 0.5)
distance(a,b)歐幾里得距離distance(st, center)
dot(a,b)內積dot(normal, lightDir)
normalize(v)單位向量normalize(direction)
atan(y,x)角度(弧度)atan(st.y-0.5, st.x-0.5)
sin/cos/pow/abs數學運算硬體加速

快速範例

圓形:

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

矩形:

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;

平鋪:

st = fract(st * 4.0);  // 4x4 網格

動畫:

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

參考資料(漸進式揭露)

基礎

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

繪圖

  • 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

程序化

  • 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 參考

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

工具

  • 線上編輯器: editor.thebookofshaders.com
  • glslViewer: 用於執行 .frag 檔案的 CLI 工具
  • glslCanvas: 用於嵌入即時著色器的 HTML 元件
  • ShaderToy: 使用 iTime、iResolution、iMouse 等 Uniform 變數

外部資源

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

majiayu000/claude-skill-registry-data

Edit existing BMAD agents while maintaining compliance

majiayu000/claude-skill-registry-data

Edit existing BMAD agents while maintaining compliance

majiayu000/claude-skill-registry-data

Edit existing BMAD modules while maintaining coherence

majiayu000/claude-skill-registry-data

Edit existing BMAD modules while maintaining coherence

majiayu000/claude-skill-registry-data

Analyzes current state and user query to answer BMad questions or recommend the next workflow or agent. Use when user says what should I do next, what do I do now, or asks a question about BMad

majiayu000/claude-skill-registry-data

Build AI agents with Google ADK Python (Agent Development Kit). Use for multi-agent systems, workflow agents (sequential/parallel/loop), Vertex AI deployment, tool integration, human-in-the-loop.

majiayu000/claude-skill-registry-data

Build AI agents with Google ADK Python (Agent Development Kit). Use for multi-agent systems, workflow agents (sequential/parallel/loop), Vertex AI deployment, tool integration, human-in-the-loop.

majiayu000/claude-skill-registry-data

Portfolio allocation and rebalancing optimizer. Manages asset allocation across stocks/cash/bonds, performs periodic rebalancing, and ensures diversification according to market regime and risk tolerance.

majiayu000/claude-skill-registry-data

Create a hilarious and ultra-realistic video of an anthropomorphic animal acting like a human vlogger in a real-world setting.

majiayu000/claude-skill-registry-data

Speech-to-text transcription and translation via OpenAI Audio API -- models, response formats, timestamps, prompting, streaming, chunking, and diarization

majiayu000/claude-skill-registry-data

This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc.

majiayu000/claude-skill-registry-data

小省导购员数字人带货版即梦视频提示词生成系统,基于四大智能体协同(提示词生成师、质量管控师、知识库运维师、跨环节适配师),按照"主体+运动+场景+(镜头语言+光影+氛围)"公式输出中英文双版提示词,适配5s短视频。确保人物一致性、视觉连贯性、情绪连贯性,支持知识库智能复用和跨工具适配(Suno音乐、AI绘画),为数字人带货视频提供高质量提示词生成服务。

majiayu000/claude-skill-registry-data

Upload and manage files using Google Gemini File API via scripts/. Use for uploading images, audio, video, PDFs, and other files for use with Gemini models. Supports file upload, status checking, and file management. Triggers on "upload file", "file API", "upload image", "upload PDF", "upload video", "file management".

majiayu000/claude-skill-registry-data

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

majiayu000/claude-skill-registry-data

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

majiayu000/claude-skill-registry-data

Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

majiayu000/claude-skill-registry-data

Conduct domain and industry research. Use when the user says "lets create a research report on [domain or industry]

majiayu000/claude-skill-registry-data

Conduct market research on competition and customers. Use when the user says "create a market research report about [business idea]".

majiayu000/claude-skill-registry-data

Conduct technical research on technologies and architecture. Use when the user says "create a technical research report on [topic]".

majiayu000/claude-skill-registry-data

Builds, edit or validate Agent Skill through conversational discovery. Use when the user requests to "Create an Agent", "Optimize an Agent" or "Edit an Agent".

相關技能