skills/threejs-skills/threejs-materials/SKILL.md
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.
npx skillsauth add partme-ai/full-stack-skills threejs-materialsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
ALWAYS use this skill when the user mentions:
envMapalphaTest, depthWrite, blending modes, side/double-sided renderingShaderMaterial / RawShaderMaterial uniforms, includes, and compatibility with lights pipelineIMPORTANT: classic materials vs node-tsl
| Need | Skill |
|------|--------|
| Standard PBR with maps, physical clearcoat/sheen | threejs-materials |
| TSL nodes, NodeMaterial, WebGPU-first shading, compute-style graph | threejs-node-tsl |
| Migrating ShaderMaterial → TSL | threejs-node-tsl (conceptual), keep ShaderMaterial here until cutover |
Trigger phrases include:
MeshBasic (unlit), Lambert/Phong (legacy lit), Standard/Physical (PBR).envMap from cube or equirect; align metalness/roughness; consider MeshPhysicalMaterial for transmission/IOR when needed.alphaTest/depthWrite trade-offs; mention sorting limitations.lights: true flag behavior per version docs.skinning/morphTargets where applicable—mesh side in threejs-objects.// Option A: alphaTest — hard cutoff, no sorting issues
const matA = new THREE.MeshStandardMaterial({
map: texture, alphaMap: alphaTexture,
alphaTest: 0.5, transparent: true
});
// Option B: depthWrite false — soft transparency, needs manual sorting
const matB = new THREE.MeshStandardMaterial({
map: texture, transparent: true, opacity: 0.6,
depthWrite: false // prevents depth-fighting but requires back-to-front sorting
});
See examples/workflow-pbr-transparent.md.
| Docs section | Representative links | |--------------|----------------------| | Materials (core) | https://threejs.org/docs/Material.html | | PBR | https://threejs.org/docs/MeshStandardMaterial.html | | Physical | https://threejs.org/docs/MeshPhysicalMaterial.html | | Custom GLSL | https://threejs.org/docs/ShaderMaterial.html |
*NodeMaterial).normalMapType or tangent space breaks lighting; verify geometry has tangents or use appropriate mode.MeshPhysicalMaterial transmission needs thickness and good env—combine with threejs-textures / PMREM.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.
When answering under this skill, prefer responses that:
MeshStandardMaterial, MeshPhysicalMaterial, or ShaderMaterial pages as appropriate.colorSpace expectations with threejs-textures.depthWrite trade-offs for sorted rendering.*NodeMaterial types belong to the node skill, not this one.English: meshstandardmaterial, meshphysicalmaterial, shadermaterial, pbr, transparency, envmap, materials, three.js
中文: 材质、PBR、MeshStandardMaterial、物理材质、透明、环境贴图、ShaderMaterial、three.js
development
Provides per-component and per-API examples with cross-platform compatibility details for uni-app, covering built-in components, uni-ui components, and APIs (network, storage, device, UI, navigation, media). Use when the user needs official uni-app components or APIs, wants per-component examples with doc links, or needs platform compatibility checks.
tools
Creates new uni-app projects via the official CLI or HBuilderX with Vue 2/Vue 3 template selection, manifest.json and pages.json configuration, and directory structure setup. Use when the user wants to scaffold a new uni-app project, initialize project files with a single command, or set up the development environment.
tools
Browses, installs, configures, and manages plugins from the uni-app plugin market (ext.dcloud.net.cn) including component plugins, API plugins, and template plugins with dependency handling. Use when the user needs to find and install uni-app plugins, configure plugin settings, manage plugin dependencies, or integrate third-party components.
tools
Develops native Android and iOS plugins for uni-app including module creation, JavaScript-to-native communication, and plugin packaging for distribution. Use when the user needs to build custom native modules, extend uni-app with native capabilities (camera, Bluetooth, sensors), or create publishable native plugins.