threejs-shaders

Implement custom GLSL shader effects in Three.js using ShaderMaterial and RawShaderMaterial.

Updated Mar 25, 2026
One-click install
npx skills add https://github.com/dogmandcl/Claude-Threejs-Skills --skill threejs-shaders-dogmandcl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: threejs-shaders
Source: https://github.com/dogmandcl/Claude-Threejs-Skills/tree/main/skills/threejs-shaders
Command: npx skills add https://github.com/dogmandcl/Claude-Threejs-Skills --skill threejs-shaders-dogmandcl

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Three.js shader development becomes approachable by guiding developers to implement and integrate custom GLSL shader effects using ShaderMaterial, RawShaderMaterial, and related techniques.

Core Features & Use Cases

  • ShaderMaterial vs RawShaderMaterial: Choose between built-in shader tooling and full custom control over the rendering pipeline.
  • Uniforms, Varyings, and GLSL Patterns: Manage uniforms, varyings, and common shader patterns for dynamic visuals.
  • Extending Built-in Materials: Customize standard materials with onBeforeCompile and shader chunks to create unique looks.
  • Debugging & Performance: Tools and tips for debugging shaders and optimizing performance in real-time rendering.

Quick Start

Create a basic ShaderMaterial with a minimal vertex and fragment shader to render a colored object in Three.js.

Frequently Asked Questions about threejs-shaders

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

FAQPage Schema
How do I create a custom shader in Three.js?

ShaderMaterial vs RawShaderMaterial in Three.js differs by built-in tooling versus full custom control. ShaderMaterial provides automatic uniforms and attributes, while RawShaderMaterial requires you to manually define all GLSL variables for complete pipeline control without built-in assumptions.

How do I extend built-in Three.js materials with custom shader code?

You can extend built-in Three.js materials by using the onBeforeCompile hook to inject custom shader chunks into the existing GLSL pipeline. This approach allows you to add dynamic visual effects like displacement or Fresnel without rewriting the entire material from scratch.

What are common GLSL patterns for dynamic Three.js visual effects?

Common GLSL patterns for dynamic Three.js visual effects include using textures for surface detail, vertex displacement for geometric deformation, and Fresnel effects for edge-based rim lighting. These patterns leverage uniforms and varyings to create dynamic visuals in real-time 3D scenes.

How do I debug and optimize WebGL shaders in Three.js?

To debug and optimize WebGL shaders in Three.js, inspect uniform values and shader compilation errors, then optimize GLSL logic for real-time rendering performance. Managing varyings efficiently and minimizing texture lookups are key practices for maintaining high frame rates.