threejs-shader-expert

Creates custom GLSL shaders, materials, and effects for Three.js projects.

Updated Jul 13, 2026
One-click install
npx skills add https://github.com/Ohmnia/site-build --skill threejs-shader-expert-ohmnia
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: threejs-shader-expert
Source: https://github.com/Ohmnia/site-build/tree/main/.opencode/skills/threejs-shader-expert
Command: npx skills add https://github.com/Ohmnia/site-build --skill threejs-shader-expert-ohmnia

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing custom GLSL shaders for Three.js requires strict adherence to GLSL ES 3.00 syntax rules, and small mistakes in type casting, qualifiers, or swizzling cause cryptic compile errors. This Skill provides the exact specification rules needed to write correct shaders, materials, and effects the first time. ## Core Features & Use Cases - GLSL ES 3.00 Syntax Enforcement: Applies strict type mapping, storage qualifiers, interpolation rules, and swizzling constraints so shaders compile without implicit-cast or qualifier-order errors. - Custom Materials & Effects: Guides creation of ShaderMaterial-based effects such as animated gradients, particle systems, and post-processing passes for Three.js scenes. - Use Case: You are building an interactive WebGL landing page and need a custom animated shader material. Use this Skill to generate a vertex and fragment shader pair that follows GLSL ES 3.00 rules, with correct in/out qualifiers, flat interpolation for integer varyings, and valid swizzle operations. ## Quick Start Use the threejs-shader-expert skill to write a GLSL ES 3.00 fragment shader that animates a color gradient over time for a Three.js ShaderMaterial.

Frequently Asked Questions about threejs-shader-expert

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a custom GLSL shader for Three.js?

Write vertex and fragment shaders following GLSL ES 3.00 rules and pass them to a Three.js ShaderMaterial. Declare inputs with `in`, outputs with `out`, and shared values with `uniform`, using explicit type constructors since implicit casting is not allowed.

How to pass data between vertex and fragment shaders in GLSL ES 3.00?

Declare matching `out` variables in the vertex shader and `in` variables in the fragment shader. Use `flat` interpolation for integer types and `smooth` for perspective-correct float interpolation.

Does GLSL ES 3.00 allow implicit type conversion?

No, GLSL ES 3.00 performs no implicit casting between numerical types. You must wrap values in explicit constructors, for example `float(1)` or `vec3(1.0)`, or the shader fails to compile.

Why does my shader fail with a swizzle error?

Swizzle errors occur when mixing component sets like `rgba` with `xyzw` in one selector, or when assigning to a swizzle with duplicate components such as `v.xx`. Use one component set per expression and unique components on the left side of assignments.

What is the correct qualifier order in GLSL ES 3.00?

The required order is `invariant`, then interpolation (`smooth` or `flat`), then storage (`in`, `out`, `uniform`, `const`), then precision. Interpolation qualifiers only apply to `in` and `out` variables.