threejs-shaders

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

Updated Mar 17, 2026
One-click install
npx skills add https://github.com/alexzhang1030/platform-demo --skill threejs-shaders-alexzhang1030
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: threejs-shaders
Source: https://github.com/alexzhang1030/platform-demo/tree/main/.agents/skills/threejs-shaders
Command: npx skills add https://github.com/alexzhang1030/platform-demo --skill threejs-shaders-alexzhang1030

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you create and customize Three.js shader-based visuals when built-in materials are not enough, making it easier to implement unique rendering effects, vertex deformation, and custom lighting behavior.

Core Features & Use Cases

  • Shader authoring: Build vertex and fragment shaders with ShaderMaterial or RawShaderMaterial.
  • Uniforms and varyings: Pass dynamic values, colors, textures, and per-vertex data through the rendering pipeline.
  • Material extension: Modify existing Three.js materials with onBeforeCompile for targeted visual changes.
  • Common effects: Implement texture sampling, noise, gradients, Fresnel, rim lighting, dissolve, and instanced rendering.
  • Use case: Create a glowing object with animated displacement, a textured surface with custom tinting, or a post-style effect by wiring shaders into a standard Three.js scene.

Quick Start

Ask for a Three.js shader that adds a Fresnel rim-light effect to a mesh using ShaderMaterial, uniforms, and a custom fragment shader.

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 Three.js shader for visual effects?

To create custom Three.js shaders, you build vertex and fragment shaders using ShaderMaterial or RawShaderMaterial, passing dynamic values through uniforms and varyings to achieve unique rendering effects and vertex deformation.

What's the best way to modify existing Three.js materials without writing a full shader?

Modifying existing Three.js materials is best done using the onBeforeCompile method, which allows you to inject custom shader code for targeted visual changes without replacing the entire material.

How do I implement a Fresnel rim-light effect on a Three.js mesh?

Implementing a Fresnel rim-light effect involves setting up a ShaderMaterial with custom uniforms and a fragment shader that calculates viewing angle to produce edge lighting on the mesh.

Does this approach support GLSL3 and instanced rendering for Three.js?

Yes, the shader construction approach supports GLSL3 compatibility and instanced rendering, allowing you to build performance-conscious visual effects like dissolve and noise for multiple meshes.

Why use custom ShaderMaterial when built-in Three.js materials exist?

Use custom ShaderMaterial when built-in Three.js materials are not enough to implement unique rendering effects, custom lighting behavior, or specific vertex displacement and texture sampling.

Can I pass dynamic values and textures through the Three.js rendering pipeline?

Yes, you pass dynamic values, colors, and textures through the rendering pipeline using uniforms, while varyings transfer per-vertex data between your vertex and fragment shaders.