threejs-materials

Explain and demonstrate Three.js material types with code examples.

45|50|Updated Jan 24, 2026
One-click install
npx skills add https://github.com/zocomputer/skills --skill threejs-materials-zocomputer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: threejs-materials
Source: https://github.com/zocomputer/skills/tree/main/External/threejs-materials
Command: npx skills add https://github.com/zocomputer/skills --skill threejs-materials-zocomputer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and examples for using and customizing various material types within the Three.js 3D graphics library, enabling users to achieve desired visual appearances for their 3D models.

Core Features & Use Cases

  • Material Type Overview: Explains the purpose and application of different Three.js materials (Basic, Lambert, Phong, Standard, Physical, Toon, Normal, Depth, Shader, RawShader).
  • Detailed Property Explanations: Covers essential properties like color, roughness, metalness, textures, and advanced features like clearcoat, transmission, and iridescence.
  • Code Examples: Provides practical JavaScript code snippets for creating and configuring each material type.
  • Use Case: When styling a 3D product model in a web application, use this Skill to select and configure the appropriate material (e.g., MeshStandardMaterial for realistic rendering, MeshPhysicalMaterial for car paint effects) and apply textures for detailed surfaces.

Quick Start

Use the threejs-materials skill to create a PBR material with a green color, 0.5 roughness, and 0.5 metalness.

Frequently Asked Questions about threejs-materials

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

FAQPage Schema
What is the difference between MeshStandardMaterial and MeshPhysicalMaterial in Three.js?

MeshStandardMaterial in Three.js provides basic PBR rendering with roughness and metalness, while MeshPhysicalMaterial extends it to support advanced properties like clearcoat, transmission, and iridescence for complex car paint or glass effects.

How do I apply textures to a 3D mesh using Three.js materials?

To apply textures to a 3D mesh using Three.js materials, configure the map property of your chosen material type, such as MeshStandardMaterial, by loading an image file and assigning it to create detailed surface appearances on your WebGL models.

When should I use custom shaders instead of built-in Three.js materials?

Use custom ShaderMaterial or RawShaderMaterial in Three.js when built-in materials cannot achieve your desired visual effect, allowing you to write custom GLSL code for unique styling and optimized material performance in WebGL applications.

Can I use Three.js materials to create a realistic metal surface on a 3D model?

Yes, you can create a realistic metal surface in Three.js by using MeshStandardMaterial and configuring its metalness property to 1.0 while adjusting the roughness property to control the sharpness of reflections on the 3D mesh.

Does Three.js support toon shading for non-photorealistic 3D graphics?

Yes, Three.js supports toon shading through the MeshToonMaterial, which is designed specifically for non-photorealistic rendering and allows you to achieve a cartoon-like appearance on 3D meshes in WebGL applications.

Why does my Three.js basic material ignore scene lighting?

MeshBasicMaterial in Three.js is designed to ignore scene lighting entirely and render at a constant color, making it useful for debugging geometry or creating unlit UI elements rather than realistic 3D graphics.