threejs-shaders

Create and integrate GLSL shaders into Three.js scenes with ShaderMaterial.

1|1|Updated Mar 30, 2026
One-click install
npx skills add https://github.com/Entelligentsia/skillforge --skill threejs-shaders-entelligentsia
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: threejs-shaders
Source: https://github.com/Entelligentsia/skillforge/tree/main/threejs-skills/skills/threejs-shaders
Command: npx skills add https://github.com/Entelligentsia/skillforge --skill threejs-shaders-entelligentsia

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Three.js shaders empower developers to craft custom visuals by writing GLSL and wiring it into ShaderMaterial, enabling fine-grained control over rendering, vertex manipulation, and fragment-level effects.

Core Features & Use Cases

  • ShaderMaterial-based customization: implement vertexShader and fragmentShader with uniforms to drive dynamic visuals.
  • Extending built-in materials: leverage onBeforeCompile to inject custom uniforms and modify shader code at runtime.
  • Shader organization & reuse: use external GLSL includes and Shader Includes to compose complex effects and reuse common patterns.

Quick Start

Create a simple ShaderMaterial with a tiny vertex and fragment shader to render a colored quad in a Three.js scene.

Frequently Asked Questions about threejs-shaders

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

FAQPage Schema
How do I create custom GLSL shaders in Three.js?

To create custom GLSL shaders in Three.js, you implement vertexShader and fragmentShader strings and wire them into a ShaderMaterial with uniforms to drive dynamic visuals. This provides fine-grained control over rendering and fragment-level effects.

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

Yes, you can extend built-in Three.js materials by leveraging the onBeforeCompile function to inject custom uniforms and modify shader code at runtime. This allows you to add procedural visuals without rewriting material logic from scratch.

How do I use uniforms to drive dynamic Three.js shader effects?

Uniforms are variables passed from JavaScript into your GLSL ShaderMaterial that allow you to dynamically control visual effects. You define them in the material's uniforms object and reference them in your vertex and fragment shaders.

What is the best way to organize and reuse GLSL shader code in Three.js?

The best way to organize and reuse GLSL shader code in Three.js is by using external GLSL includes and Shader Includes. This allows you to compose complex effects by sharing common patterns across multiple shaders.

Does Three.js ShaderMaterial work for mobile web-based 3D applications?

Yes, Three.js ShaderMaterial works across both desktop and mobile web-based 3D applications. You can create procedural visuals and unique materials using GLSL shaders that render properly on mobile WebGL contexts.

Why use onBeforeCompile instead of ShaderMaterial for Three.js shaders?

You use onBeforeCompile instead of ShaderMaterial when you want to inject custom shader code into existing built-in materials while retaining their default lighting and rendering logic. ShaderMaterial is used when you need entirely custom rendering from scratch.