OverviewHistoryStatsSecurity
npx skills add ...
Documentation
SKILL.md
npx skills add enzed/r3f-skills --skill r3f-materials
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.
npx skills add enzed/r3f-skills --skill r3f-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.
| 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 |
Mount below Canvas. This small procedural environment avoids a remote preset dependency.
NoColorSpace. Preserve correctly loaded glTF texture metadata.metalness={0} has no effect; an emissive map needs a nonblack emissive color.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.thickness/IOR. Transmission is not equivalent to ordinary transparency.MeshTransmissionMaterial and MeshReflectorMaterial add scene renders. Start with low resolution/samples, and measure before enabling backside passes or one independent buffer per object.DoubleSide everywhere: it changes rendering cost and may hide incorrect winding or normals.needsUpdate; shader feature changes such as adding/removing a map can require recompilation.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.