r3f-shaders

Author and apply GLSL shaders within React Three Fiber using shaderMaterial.

Updated Apr 2, 2026
One-click install
npx skills add https://github.com/DSalischiker/portfolio-space-exploration --skill r3f-shaders-dsalischiker
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r3f-shaders
Source: https://github.com/DSalischiker/portfolio-space-exploration/tree/main/.agents/skills/r3f-shaders
Command: npx skills add https://github.com/DSalischiker/portfolio-space-exploration --skill r3f-shaders-dsalischiker

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a streamlined approach for building, extending, and applying GLSL shaders within React Three Fiber, enabling developers to craft custom visual effects without breaking the React workflow.

Core Features & Use Cases

  • ShaderMaterial and raw ShaderMaterial integration in React Three Fiber for custom visual effects.
  • GLSL authoring workflow with vertex/fragment shaders, uniforms, and vUv/vNormal data.
  • Extending built-in materials and enabling HMR-friendly shader development with live updates.
  • Real-world use cases include vertex displacement, Fresnel-based edges, dissolve effects, and texture-driven shader experiments in interactive scenes.

Quick Start

Create a custom shader material in a React Three Fiber scene and observe live shader editing with HMR.

Frequently Asked Questions about r3f-shaders

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

FAQPage Schema
How do I create custom GLSL shaders in React Three Fiber?

To create custom GLSL shaders in React Three Fiber, use Drei's shaderMaterial helper or raw ShaderMaterial to define vertex and fragment shaders, pass structured uniforms, and integrate the material into your scene graph for custom visual effects.

How does HMR work with shader materials in R3F?

HMR-friendly shader development in R3F enables live updates to vertex and fragment shaders during editing without losing scene state, allowing instant visual feedback while authoring GLSL code and adjusting uniforms interactively.

Can I use Drei's shaderMaterial with instanced geometries in React Three Fiber?

Yes, Drei's shaderMaterial and raw ShaderMaterial can be applied to both simple and instanced geometries in React Three Fiber, supporting custom visual effects like vertex displacement and Fresnel edges across multiple instances.

What common shader patterns can I implement in React Three Fiber?

Common shader patterns in React Three Fiber include vertex displacement, Fresnel-based edge effects, dissolve transitions, and texture-driven experiments, utilizing vUv and vNormal data within the GLSL vertex and fragment shaders.

Does this shader workflow support TypeScript typings for uniforms?

Yes, the shader workflow provides TypeScript typings for structured uniforms and shader materials, ensuring type safety when defining GLSL parameters and integrating Drei helpers within React Three Fiber components.

What's the best way to structure uniforms for R3F shader materials?

The best way to structure uniforms for R3F shader materials is to enforce a structured uniform object with consistent naming, pass them to shaderMaterial or raw ShaderMaterial, and leverage TypeScript typings for maintainable GLSL development.