roedyrustam/vibes-plug/glsl-shader-expert
- community
Checking that the SKILL.md file is still in the repository.
Web shaders: TSL, WebGPU WGSL, and WebGL GLSL in Three.js / Shader web modern: TSL, WebGPU WGSL, dan GLSL di Three.js.
Install
npx vskill@latest install roedyrustam/vibes-plug/glsl-shader-expertSKILL.md
Modern Web Shader Expert (TSL, WGSL, Compute Shaders & GLSL)
<a name="english"></a>
English
Orchestration & Integration
Connects and orchestrates with relevant domain skills:
web-3d-graphics-expert— WebGPU/WebGL scene rendering and NodeMaterial binding.web-game-engine-expert— Physics simulations, particle systems, and VFX materials.ui-ux-pro-max— Modern visual effects, glassmorphism, and screen-space distortion.visual-ui-auditor— Visual validation of shader effects, color spaces, and post-processing aesthetics.anti-slop— Anti-slop graphics enforcement, eliminating cheap neon glow and unoptimized fullscreen blurs.performance-web-vitals— GPU profiling, draw call reduction, and compute shader optimization.
Description
Production-grade guidance for authoring, compiling, and optimizing GPU shaders for modern web applications. Focuses on the cutting-edge TSL (Three Shading Language) node system which cross-compiles to both WGSL (WebGPU) and GLSL (WebGL2), standalone WGSL Compute Shaders for parallel processing (particles, boids, simulation), and legacy GLSL optimization.
Trigger Conditions
Activate this skill when the user is:
- Writing custom shader materials in Three.js or Babylon.js.
- Refactoring legacy GLSL shaders to Three Shading Language (TSL) or WebGPU WGSL.
- Implementing WebGPU Compute Shaders (
@computeworkgroups, storage buffers). - Creating procedural VFX: fluid simulations, volumetric clouds, noise-based terrain, or holographic shields.
- Designing post-processing screen passes (bloom, chromatic aberration, SSAO/GTAO, depth of field).
- Optimizing GPU bottlenecks, thread divergence, or ALU instruction counts.
Modern Web Shader Paradigms (2026)
| Paradigm | Target API | Key Advantages | When to Use | |
|---|---|---|---|---|
| TSL (Three Shading Language) | WebGPU + WebGL2 | Cross-compiles node trees to WGSL and GLSL; type-safe JavaScript/TypeScript syntax. | Default standard for modern Three.js (r170+) materials and post-processing. | |
| WGSL (WebGPU Shading Language) | WebGPU native | Direct GPU memory access, structured storage buffers, atomic operations. | Raw WebGPU apps, Babylon.js WebGPU compute, custom WebGPU pipelines. | |
| Compute Shaders | WebGPU | General-purpose GPU (GPGPU) computing; runs without rasterization or vertex buffers. | 100,000+ particle systems, cloth physics, fluid simulation, GPU boids. | |
| GLSL (ES 3.0) | WebGL2 fallback | Universal device compatibility on legacy hardware. | Legacy Three.js/Babylon.js projects and fallback pipelines. |
1. Three Shading Language (TSL) Node System
TSL replaces string-concatenated GLSL with modular, type-safe node expressions that Three.js automatically compiles to WGSL on WebGPU and GLSL on WebGL2.
2. WebGPU Compute Shaders (GPGPU Parallel Processing)
Compute shaders run arbitrary mathematical workloads across thousands of GPU threads simultaneously:
3. Babylon.js Node Material & WebGPU WGSL Compute Shader
Babylon.js compiles Node Materials (NME) to WGSL on WebGPU and GLSL on WebGL2. For raw mathematical simulation, Babylon.js provides first-class native WGSL compute shaders:
4. High-Performance Shader Rules (GPU Architecture)
- Eliminate Branching Divergence:
- GPU threads execute in lockstep warps (NVIDIA: 32 threads, AMD/Apple: 32-64 threads).
- If threads inside the same warp take different branches in an
if/else, both paths are evaluated serially, destroying throughput. - Use Math Primitives: Replace branches with
step(),smoothstep(),mix(),clamp(), orselect().
```glsl // BAD: Divergent GPU branch if (vDepth > 0.5) { color = vec3(1.0); } else { color = vec3(0.0); }
// GOOD: Branchless step function color = vec3(step(0.5, vDepth)); ```
- Precision Management:
- Always specify precision for mobile GPUs.
- Use
mediump(16-bit float) for colors, normal vectors, and UVs to gain 2x arithmetic throughput and save bandwidth. - Reserve
highp(32-bit float) for world-space coordinates and depth calculations.
- Precompute on CPU or Vertex Shader:
- Never compute values in the fragment shader (millions of pixels) that are constant across the mesh or linear across vertices.
- Move matrix inversions, static lighting directions, or uniform transformations to the CPU or Vertex stage.
Sovereign Execution, Token Efficiency & Invariants
| Dimension | Sovereign Mandate & Deterministic Contract | |||||
|---|---|---|---|---|---|---|
| Frontier Model Cascade | Medium / High (GPT-5.6 Sol Medium, Gemini 4 Argon, Claude Sonnet 5.5 High, Grok 4.7 High Fast) | |||||
| Availability Fallback | Gemini 4 Argon/Pro -> Gemini 3.8 Flash; Claude Opus 5.5 -> Claude Opus 4.6 (Zero unhandled missing-model errors) | |||||
| KV-Cache & Token Protocol | Pin static instructions & schemas at prompt prefix (kv-cache-prefix-optimizer); pass surgical CONTEXT_MAP.md slices (<250 tokens/call) during Swarm Fan-Out | |||||
| SaaT CLI & MCP Dispatch | CLI: `vibes skill exec glsl-shader-expert <audit\ | eval\ | verify\ | generate\ | blueprint> / MCP: vibes_skill_dispatch, vibes_ast_query, vibes_compile_cache, vibes_optimize_budget, vibes_verify_gate` | |
| NFR & Anti-Slop Invariants | P99 API Gateway Latency < 85ms, OpenAPI 3.1 / TypeSpec strict schema parity, RFC 9457 Problem Details error contracts, Idempotency-Key enforcement; 100% complete zero-placeholder output verified via node scripts/check-anti-slop.js --strict |
<a name="bahasa-indonesia"></a>
Bahasa Indonesia
Integrasi Orkestrasi
Terhubung dan mengorkestrasi skill domain yang relevan:
web-3d-graphics-expert— Rendering scene WebGPU/WebGL dan integrasi NodeMaterial.web-game-engine-expert— Simulasi fisika, sistem partikel, dan material efek game.ui-ux-pro-max— Efek visual modern, glassmorphism, dan distorsi screen-space.visual-ui-auditor— Validasi visual efek shader, ruang warna, dan estetika post-processing.anti-slop— Penegakan anti-slop grafis, membasmi neon glow murahan dan blur fullscreen tanpa optimasi.performance-web-vitals— Profiling GPU, optimasi draw call, dan compute shader.
Deskripsi
Panduan produksi untuk menulis, mengompilasi, dan mengoptimalkan shader GPU untuk aplikasi web modern. Fokus pada sistem node TSL (Three Shading Language) yang dapat dikompilasi silang menjadi WGSL (WebGPU) dan GLSL (WebGL2), Compute Shader WGSL mandiri untuk pemrosesan paralel GPU skala masif (partikel, boids, simulasi cairan), dan optimasi GLSL.
Kondisi Pemicu
Aktifkan skill ini ketika pengguna:
- Menulis custom shader material pada Three.js atau Babylon.js.
- Merefaktor shader GLSL lama menjadi Three Shading Language (TSL) atau WebGPU WGSL.
- Mengimplementasikan WebGPU Compute Shader (
@computeworkgroups, storage buffers). - Membuat efek visual prosedural (simulasi air, awan volumetrik, medan prosedural, perisai hologram).
- Merancang post-processing passes (bloom, chromatic aberration, SSAO, depth of field).
- Mengatasi bottleneck GPU, thread divergence, atau instruksi ALU berlebih.
Prinsip Utama Shader Modern
- Adopsi TSL (Three Shading Language):
- Hindari menulis shader dalam bentuk string concatenation GLSL mentah pada proyek modern. Gunakan TSL (
Fn,color,uv,positionLocal). TSL menjaga keamanan tipe (type-safety) dan otomatis menghasilkan WGSL atau GLSL sesuai runtime.
- GPGPU dengan Compute Shader:
- Manfaatkan WebGPU Compute Shader untuk kalkulasi ribuan partikel atau simulasi matematika tanpa melalui tahap rasterisasi atau vertex buffer tradisional.
- Aturan Anti-Branching (Branchless Shader):
- GPU mengeksekusi instruksi dalam kelompok thread (warp/wavefront). Percabangan
if/elseyang tidak seragam akan memaksa GPU mengeksekusi kedua cabang secara berurutan (branch penalty). - Gunakan fungsi matematika seperti
step(),smoothstep(), danmix()alih-alih percabangan logika kondisional.
- Manajemen Presisi:
- Gunakan
mediump(16-bit float) untuk warna, koordinat UV, dan vektor normal untuk melipatgandakan kecepatan komputasi pada GPU smartphone. - Gunakan
highp(32-bit float) hanya untuk posisi ruang dunia (world space) dan perhitungan kedalaman (depth).
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/glsl-shader-expert/SKILL.md
Popularity
- Repository stars
- 51
- Repository forks
- 10
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/roedyrustam/vibes-plug/glsl-shader-expert)