agentleFS
full-stack-skillsfull-stack-skills/threejs-skills/skills/threejs-materials/SKILL.md

threejs-materials

Skill9 starsChanged 54 days agoApache-2.0View on GitHub

Classic three.js materials (non-Node): MeshStandardMaterial, MeshPhysicalMaterial, Phong/Lambert/Toon/Basic, Line/Points/Sprite materials, MeshMatcapMaterial, MeshNormalMaterial, depth/distance materials, ShaderMaterial and RawShaderMaterial. Use when tuning PBR maps, transparency, depth write, skinning flags, or writing GLSL in ShaderMaterial; for TSL/NodeMaterial/WebGPU shader graphs use threejs-node-tsl instead—not both for the same authoring path unless migrating.

22 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use pose-library-design, video-toolkit and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • LinHao-citySkill

    pose-library-design

    Design reusable 2D character pose libraries, action cycles, and expression states for data-driven animation.

    Also in 4 projects that use this

  • LinHao-citySkill

    video-toolkit

    Create professional videos autonomously using claude-code-video-toolkit — AI voiceovers, image generation, music, talking heads, and Remotion rendering.

    Also in 4 projects that use this

  • GopyrSkill

    azure-speech-to-text

    Also in 3 projects that use this

  • GopyrSkill

    dashscope

    Also in 3 projects that use this

  • alton47Skill

    threejs-performance

    Optimizes Three.js performance — instancing, draw call reduction, LOD, frustum culling, geometry merging, texture compression, Stats.js profiling, and GPU debugging. Use when the user asks about performance, FPS, draw calls, instancing, optimization, lag, stuttering, or profiling a Three.js scene. Trigger keywords: performance, fps, draw calls, instancing, InstancedMesh, LOD, profiling, optimization, Stats.

    Also in 4 projects that use this

  • +5 more from LinHao-city

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 19 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When answering under this skill, prefer responses that:

    line 67
  2. Very specific:

    Call out transparency and depthWrite trade-offs for sorted rendering.

    line 72

“Common” is measured: kept by at least 6 in 10 of the 19 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

When to use this skill

ALWAYS use this skill when the user mentions:

  • Choosing among built-in mesh materials, map slots (albedo, normal, roughness, metalness, ao, emissive), envMap
  • Transparency sorting issues, alphaTest, depthWrite, blending modes, side/double-sided rendering
  • ShaderMaterial / RawShaderMaterial uniforms, includes, and compatibility with lights pipeline
  • Line, points, sprite materials for vector overlays and particles

IMPORTANT: classic materials vs node-tsl

NeedSkill
Standard PBR with maps, physical clearcoat/sheenthreejs-materials
TSL nodes, NodeMaterial, WebGPU-first shading, compute-style graphthreejs-node-tsl
Migrating ShaderMaterial → TSLthreejs-node-tsl (conceptual), keep ShaderMaterial here until cutover

Trigger phrases include:

  • "MeshStandardMaterial", "MeshPhysicalMaterial", "ShaderMaterial", "transparent", "alphaTest"
  • "PBR", "物理材质", "透明", "自定义着色器"

How to use this skill

  1. Select class by lighting model: MeshBasic (unlit), Lambert/Phong (legacy lit), Standard/Physical (PBR).
  2. Assign maps and ensure color space correctness for albedo vs data maps (link threejs-textures).
  3. Environment: set envMap from cube or equirect; align metalness/roughness; consider MeshPhysicalMaterial for transmission/IOR when needed.
  4. Transparency: order objects or use alphaTest/depthWrite trade-offs; mention sorting limitations.
  5. ShaderMaterial: minimize re-lit work unless intentional; document required lights and lights: true flag behavior per version docs.
  6. Performance: share materials across meshes; avoid cloning per frame.
  7. Skinning/morph: set skinning/morphTargets where applicable—mesh side in threejs-objects.

See examples/workflow-pbr-transparent.md.

Doc map (official)

Scope

  • In scope: Non-Node materials listed under Core Materials in docs (except *NodeMaterial).
  • Out of scope: Full Nodes catalog (threejs-node-tsl); post pass materials inside composer (threejs-postprocessing).

Common pitfalls and best practices

  • Wrong normal map normalMapType or tangent space breaks lighting; verify geometry has tangents or use appropriate mode.
  • Premultiplied alpha vs straight alpha mismatches cause fringe halos on foliage.
  • MeshPhysicalMaterial transmission needs thickness and good env—combine with threejs-textures / PMREM.
  • Too many unique materials hurts sorting and batching—merge where possible.

Documentation and version

PBR and ShaderMaterial behavior track the Materials section in three.js docs. Color management and default envMap handling changed in modern releases—always pair material answers with renderer/output settings from threejs-renderers when colors look wrong.

Agent response checklist

When answering under this skill, prefer responses that:

  1. Link MeshStandardMaterial, MeshPhysicalMaterial, or ShaderMaterial pages as appropriate.
  2. Force a clear choice vs threejs-node-tsl when the user asks for “shaders” or “nodes”.
  3. Separate map roles (albedo vs roughness vs normal) and colorSpace expectations with threejs-textures.
  4. Call out transparency and depthWrite trade-offs for sorted rendering.
  5. Note that *NodeMaterial types belong to the node skill, not this one.

References

Keywords

English: meshstandardmaterial, meshphysicalmaterial, shadermaterial, pbr, transparency, envmap, materials, three.js

中文: 材质、PBR、MeshStandardMaterial、物理材质、透明、环境贴图、ShaderMaterial、three.js

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.