React Three Fiber Materials

VerifiedSafe

Choose and configure React Three Fiber surface materials: PBR, transparency, transmission, with guidance on material cost and version compatibility.

Sby Skills Guide Bot
DevelopmentIntermediate
10/21/2026
Claude CodeCursorWindsurfCopilotCodex
#react-three-fiber#threejs#pbr#webgl#transparency

Recommended for

Automated summary

Guides the selection and configuration of React Three Fiber materials, covering PBR, color spaces, transparency, transmission, and material reuse.

Strengths

  • Provides a decision table mapping visual needs to the simplest suitable material.
  • Calls out concrete PBR pitfalls such as metalness/roughness behavior, texture color spaces, and map/scalar multiplication.
  • Separates ordinary transparency from physical transmission and warns about depth sorting and expensive Drei materials.
  • Starts with version inspection and WebGL/WebGPU caveats instead of assuming compatibility.

Limitations

  • The pasted document is cut off mid-sentence in the lifetime/update section, so guidance on cloning and disposal is incomplete.
  • It covers material choice and caveats more than complete end-to-end implementations for glass, transparency, or custom shaders.
  • Examples target Fiber 9 / React 19 with WebGL; WebGPU and TSL paths are only warned about, not demonstrated.
When to use it

Use when choosing, debugging, or optimizing the appearance and rendering cost of React Three Fiber meshes.

When not to use it

Do not use for writing custom GLSL/TSL shaders, general Three.js animation, or non-R3F rendering workflows.

Security analysis

Safe
Quality score88/100

This is a pure documentation/guidance skill for React Three Fiber materials. It contains only Markdown prose, a comparison table, and a short declarative JSX example. There are no shell commands, no network fetches, no file writes, no obfuscated payloads, and no attempts to redirect the agent or disable safety controls. Declared allowed-tools is empty, consistent with a non-executing reference skill.

No concerns found

How this analysis is made

Examples

Fix flat PBR material
My React Three Fiber gold sphere looks flat and dark. Inspect my meshStandardMaterial settings and Environment setup, then suggest the least complex fix using the versions installed in my project.
Choose a glass material
I need a realistic glass panel in a React Three Fiber scene. Compare meshPhysicalMaterial transmission with Drei MeshTransmissionMaterial for visual quality and render cost, and give me a minimal setup with sensible starting values.
Fix transparent foliage artifacts
My R3F tree leaves use opacity below 1 and show sorting artifacts. Should I switch to alphaTest, adjust depthWrite, or use another approach? Explain the trade-offs and give the material config.

name: r3f-materials description: Choose and configure React Three Fiber surface materials, PBR, transparency, and transmission. Use for mesh appearance and material cost; use shader guidance for custom GLSL or TSL code.

React Three Fiber materials

Inspect the installed renderer, Three.js, Fiber, and Drei versions first. Examples use Fiber 9 / React 19 with WebGL. Do not assume Drei shader-based materials work unchanged with WebGPU.

Choose the least complex material that fits

| Need | Starting point | Constraint | | --- | --- | --- | | Unlit artwork or UI surface | meshBasicMaterial | Still participates in output color/tone-mapping policy | | Ordinary PBR surface | meshStandardMaterial | Metals especially need an environment or suitable lights | | Clearcoat, transmission, sheen | meshPhysicalMaterial | Enable only needed features; more shader work | | Stylized lighting | meshToonMaterial | Needs lights; gradient maps need appropriate filtering | | Normal debugging | meshNormalMaterial | Useful for geometry/normal inspection | | Custom shading | ShaderMaterial or node material | Match WebGL/GLSL versus WebGPU/TSL |

PBR surface with environment lighting

Mount below Canvas. This small procedural environment avoids a remote preset dependency.

import { Environment, Lightformer } from '@react-three/drei'

export default function Example() {
  return (
    <>
      <Environment resolution={64} frames={1}>
        <Lightformer position={[0, 3, 2]} scale={[5, 5, 1]} intensity={3} />
      </Environment>
      <mesh>
        <sphereGeometry args={[1, 32, 24]} />
        <meshStandardMaterial color="goldenrod" metalness={1} roughness={0.3} />
      </mesh>
    </>
  )
}

PBR and color decisions

  • Use metalness near 0 for dielectrics and near 1 for bare metals; intermediate values usually describe mixtures or texture filtering. Roughness controls microsurface response, not opacity.
  • Color/albedo and emissive textures use sRGB; roughness, metalness, normal, AO, and masks use NoColorSpace. Preserve correctly loaded glTF texture metadata.
  • Maps multiply scalar settings: a metalness map with metalness={0} has no effect; an emissive map needs a nonblack emissive color.
  • A normal map alters shading; a displacement map alters vertices and needs enough geometry subdivisions. Normal maps do not alter the silhouette.
  • An emissive surface does not illuminate nearby geometry or automatically produce a halo. Add appropriate lighting and a bloom pipeline when those effects are required.
  • PBR appearance changed across recent Three.js releases. Validate with controlled lighting/exposure; do not blindly compensate for an upgrade with extra lights or color conversion.

Transparency and glass

  • opacity < 1 needs transparent for ordinary alpha blending. For cutout foliage or decals, consider alphaTest to avoid sorting artifacts; choose soft transparency only when required.
  • depthWrite={false} can help some transparent layers but is not a universal fix. Test overlap order, backfaces, and intersection with opaque objects.
  • Use physical transmission for glass, generally with opacity 1 and a meaningful thickness/IOR. Transmission is not equivalent to ordinary transparency.
  • Drei MeshTransmissionMaterial and MeshReflectorMaterial add scene renders. Start with low resolution/samples, and measure before enabling backside passes or one independent buffer per object.
  • A shared transmission sampler is cheaper in some scenes but cannot reproduce all visibility between transparent/transmissive objects. Read the helper's documentation before choosing it.
  • Do not enable DoubleSide everywhere: it changes rendering cost and may hide incorrect winding or normals.

Lifetime and updates

  • Share materials when objects should share appearance. Clone before changing one instance's color, maps, or uniforms; a cached glTF material may be used elsewhere.
  • R3F owns declarative material children. Externally allocated/shared materials need explicit lifecycle ownership. Disposing a material does not dispose its textures.
  • Animate ordinary material properties through typed refs. Value changes such as roughness or color do not require needsUpdate; shader feature changes such as adding/removing a map can require recompilation.
  • Material arrays require matching geometry groups. An array alone does not assign arbitrary materials to faces.

Verify

Render under the intended lighting and output pipeline, then test transparent overlaps, shadows, and repeated mount/unmount. Compare GPU cost before adding transmission or reflection passes.

Sources

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/react-three-fiber-materials-mvda872a/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/react-three-fiber-materials-mvda872a' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/react-three-fiber-materials-mvda872a/download' --output '.skill-downloads/react-three-fiber-materials-mvda872a/SKILL.md.part' && mv '.skill-downloads/react-three-fiber-materials-mvda872a/SKILL.md.part' '.skill-downloads/react-three-fiber-materials-mvda872a/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/react-three-fiber-materials-mvda872a/SKILL.md' && test -s '.skill-downloads/react-three-fiber-materials-mvda872a/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/r3f-materials' && cp -R '.skill-downloads/react-three-fiber-materials-mvda872a' '.claude/skills/r3f-materials'

Cursor
test -f '.skill-downloads/react-three-fiber-materials-mvda872a/SKILL.md' && test -s '.skill-downloads/react-three-fiber-materials-mvda872a/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/r3f-materials' && cp -R '.skill-downloads/react-three-fiber-materials-mvda872a' '.cursor/skills/r3f-materials'

Codex
test -f '.skill-downloads/react-three-fiber-materials-mvda872a/SKILL.md' && test -s '.skill-downloads/react-three-fiber-materials-mvda872a/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/r3f-materials' && cp -R '.skill-downloads/react-three-fiber-materials-mvda872a' '.agents/skills/r3f-materials'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/react-three-fiber-materials-mvda872a'

openskills read 'react-three-fiber-materials-mvda872a'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/react-three-fiber-materials-mvda872a/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills