threejs-shaders

Create custom GLSL shaders for Three.js ShaderMaterial and RawShaderMaterial.

46.2k|5.7k|Updated Mar 29, 2026
One-click install
npx skills add https://github.com/calesthio/OpenMontage --skill threejs-shaders-calesthio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: threejs-shaders
Source: https://github.com/calesthio/OpenMontage/tree/main/.agents/skills/threejs-shaders
Command: npx skills add https://github.com/calesthio/OpenMontage --skill threejs-shaders-calesthio

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This tool helps developers implement custom GLSL shaders in Three.js to create bespoke visual effects beyond built-in materials.

Core Features & Use Cases

  • ShaderMaterial and RawShaderMaterial support for both unified and full-control rendering.
  • Uniforms, varying variables, and common shader patterns (texture sampling, vertex displacement, Fresnel, noise, gradients, rim lighting, and dissolve effects) enable a wide range of visuals.
  • Use cases include real-time data-driven graphics, cinematic post-processing-like effects, and interactive scenes with procedurally generated materials.

Quick Start

Create a simple ShaderMaterial with a custom vertex/fragment shader and animate a uniform in your 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 for visual effects?

To create custom GLSL shaders in Three.js, use ShaderMaterial or RawShaderMaterial to define vertex and fragment shaders, pass dynamic data via uniforms, and implement patterns like noise or Fresnel for bespoke rendering.

What is the difference between ShaderMaterial and RawShaderMaterial in Three.js?

ShaderMaterial in Three.js automatically injects built-in uniforms and attributes, while RawShaderMaterial provides full control by requiring you to manually declare all GLSL variables, making it suited for advanced rendering techniques.

When do I need custom shader materials instead of built-in Three.js materials?

You need custom shader materials when building bespoke visual effects beyond built-in options, such as vertex displacement, dissolve effects, rim lighting, or real-time data-driven graphics for interactive scenes.

How do I customize existing Three.js materials using onBeforeCompile?

Customize existing Three.js materials using onBeforeCompile to inject custom GLSL code into the standard shader pipeline, allowing you to modify rendering behavior without writing a full ShaderMaterial from scratch.

Can I use procedural noise and Fresnel patterns in WebGL shader materials?

Yes, you can implement procedural noise and Fresnel patterns in WebGL shader materials by writing custom GLSL fragment shaders to generate dynamic textures, gradients, and realistic rim lighting effects.

What are the performance considerations for real-time GLSL shaders in Three.js?

Performance guidance for real-time GLSL shaders involves optimizing fragment calculations, minimizing uniform updates, and using efficient patterns to ensure smooth frame rates in VFX demos and interactive scenes.