Agent skill · AI & Agents

threejs-materials-lighting

Light and shade a three.js scene: choose materials (MeshStandardMaterial PBR vs unlit MeshBasicMaterial), add ambient/hemisphere/directional/point/spot lights, turn on shadow maps, and use an environment map (IBL) for realistic reflections. Use when a three.js model looks black, flat, or wrong — when the user mentions three.js materials, MeshStandardMaterial, lights, shadows, envMap, or PBR. For renderer/loop setup use threejs-scene-setup; for loading models use threejs-gltf-loading.

gamedev-skillsgithub.com/gamedev-skillsGitHub ↗
claude-codeclinecodexcursorcopilotwindsurfApache-2.0
Install
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill threejs-materials-lighting --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 7 KB
Bundled scripts: none
Requires: three.js r165+ (verified against r184; physically based lighting)
Path: skills/web-engines/threejs-materials-lighting/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 406
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# three.js Materials & Lighting Make three.js surfaces look right: pick the correct material, light the scene, enable shadows, and add image-based lighting. Patterns target **r165+**, verified against **r184** (lighting is physically based by default since r155). ## When to use - Use when a mesh renders black or flat, when choosing a material, adding lights, enabling shadows, or setting up environment-map reflections (IBL). - Use when code constructs `MeshStandardMaterial`, `DirectionalLight`, etc., or sets `renderer.shadowMap.enabled` or `scene.environment`. **When *not* to use:** the renderer/camera/loop → `threejs-scene-setup`. Loading models (whose PBR materials this complements) → `threejs-gltf-loading`. Custom GLSL/`ShaderMaterial` is its own topic; for the portable concept see `shader-programming`. ## Core workflow 1. **Pick a material by need.** `MeshStandardMaterial` (PBR: `roughness`, `metalness`, reacts to lights/IBL) for realism; `MeshPhysicalMaterial` for clearcoat/transmission; `MeshBasicMaterial` (unlit, ignores lights) for UI/flat; `MeshNormalMaterial`/`MeshDepthMaterial` for debugging. 2. **Add light, or nothing shows.** Lit materials need a light source and/or `sc

What's inside
Steps it walks through
  1. When to use
  2. Core workflow
  3. Patterns
  4. 1. PBR material under a 3-light rig
  5. 2. Unlit material (no light needed)
  6. 3. Shadows (the three required switches + camera fit)
  7. 4. PBR textures on a material
  8. 5. Image-based lighting from an HDR environment
  9. Pitfalls
  10. References
  11. Related skills
Ships with 1 file
  • references/materials-lights-table.md
More from awesome-gamedev-agent-skills
All skills →
About this skill
What does the threejs-materials-lighting skill do?

Light and shade a three.js scene: choose materials (MeshStandardMaterial PBR vs unlit MeshBasicMaterial), add ambient/hemisphere/directional/point/spot lights, turn on shadow maps, and use an environment map (IBL) for realistic reflections. Use when a three.js model looks black, flat, or wrong — when the user mentions three.js materials, MeshStandardMaterial, lights, shadows, envMap, or PBR. For renderer/loop setup use threejs-scene-setup; for loading models use threejs-gltf-loading.

How do I install it?

Run `npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill threejs-materials-lighting --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From gamedev-skills/awesome-gamedev-agent-skills, a repository with 406 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going