Gojiberry AI
AI agents that find and contact high-intent leads for you
Try Gojiberry free →
Hermes Agent
Run your Hermes agent, fully managed
Launch on Hostinger →
Hostinger VPS
Spin up a VPS in one click, 20% off
Launch on Hostinger →
Firecrawl
Crawl and scrape any site into clean data
Try Firecrawl free →
Runable
One AI agent to build, run, and grow your business
Try Runable free →
Context.dev
One API to scrape, enrich, and extract the web
Start building free →
Jotform
Forms, workflows, and AI Agents for your team
Try Jotform free →
Runable
One AI agent to build, run, and grow your business
Try Runable free →
OpenClaw
Deploy a managed OpenClaw agent in 60 seconds
Launch on Hostinger →
Sponsor here
9/10 sponsor slots taken — 1 left
Claim it →
Claude Market
Menu
SkillsMCPPluginsMarketplacesNewsletterSubmit MCPSkillPluginMCPMCP, plugin, or skillAdvertise
Claude Market
SkillsMCPPluginsMarketplacesNewsletterSubmit MCPSkillPluginMCPMCP, plugin, or skillAdvertise
Skills/gamedev-skills/awesome-gamedev-agent-skills/threejs-materials-lighting
threejs-materials-lighting logo

threejs-materials-lighting

gamedev-skills/awesome-gamedev-agent-skills
838 installs462 stars
Run it on Hostinger, 20% off →Your friend gets 20% off too, using this linkFree API →|View on GitHub|Create your own skill →

Installation

npx skills add https://github.com/gamedev-skills/awesome-gamedev-agent-skills --skill threejs-materials-lighting

Summary

>

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 r184, 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.

  1. Add light, or nothing shows. Lit materials need a light source and/or

scene.environment. Combine a soft fill (AmbientLight/HemisphereLight) with a key DirectionalLight.

  1. Mind light intensity. Since r155, lighting is physically based; modern

intensities are higher than old tutorials (a key DirectionalLight ≈ 1–3).

  1. Enable shadows in three places. renderer.shadowMap.enabled = true, the

light's castShadow = true, and each mesh's castShadow/receiveShadow. Then fit the light's shadow camera to the scene.

  1. Use an environment map for grounded reflections. Assign an equirectangular or

PMREM-processed texture to scene.environment; PBR materials pick it up automatically.

  1. Verify under real lighting — confirm the surface responds to the key light

(highlights move), shadows land where expected, and reflections look plausible.

Patterns

1. PBR material under a 3-light rig

import * as THREE from 'three';

const material = new THREE.MeshStandardMaterial({
  color: 0xcc4444,
  roughness: 0.5,     // 0 = mirror, 1 = fully matte
  metalness: 0.0,     // 0 = dielectric (plastic/wood), 1 = metal
});
const mesh = new THREE.Mesh(new THREE.SphereGeometry(1, 32, 16), material);
scene.add(mesh);

// Soft sky/ground fill + a directional key light.
scene.add(new THREE.HemisphereLight(0xbbddff, 0x443322, 1.0)); // sky, ground, intensity
const key = new THREE.DirectionalLight(0xffffff, 2.5);
key.position.set(5, 10, 7);
scene.add(key);

2. Unlit material (no light needed)

// MeshBasicMaterial ignores lights — for flat color, UI, or sprites/labels.
const flat = new THREE.MeshBasicMaterial({ color: 0x44aa88 });
// A textured color map should be tagged sRGB so colors aren't washed out:
const tex = new THREE.TextureLoader().load('assets/logo.png');
tex.colorSpace = THREE.SRGBColorSpace;
const logo = new THREE.MeshBasicMaterial({ map: tex, transparent: true });

3. Shadows (the three required switches + camera fit)

renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;     // softer edges

const sun = new THREE.DirectionalLight(0xffffff, 3);
sun.position.set(8, 12, 6);
sun.castShadow = true;
sun.shadow.mapSize.set(2048, 2048);                   // default 512; raise for crisp
// DirectionalLight uses an OrthographicCamera — fit it tightly to the scene:
const cam = sun.shadow.camera;
cam.near = 1; cam.far = 40;
cam.left = -15; cam.right = 15; cam.top = 15; cam.bottom = -15;
scene.add(sun);

mesh.castShadow = true;
ground.receiveShadow = true;                          // a plane to catch the shadow

4. PBR textures on a material

const loader = new THREE.TextureLoader();
const colorMap = loader.load('assets/brick_color.jpg');
colorMap.colorSpace = THREE.SRGBColorSpace;           // color maps are sRGB
const normalMap = loader.load('assets/brick_normal.jpg'); // data maps stay linear
const roughMap  = loader.load('assets/brick_rough.jpg');

const brick = new THREE.MeshStandardMaterial({
  map: colorMap,
  normalMap,
  roughnessMap: roughMap,
  metalness: 0,
});

5. Image-based lighting from an HDR environment

import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';

new RGBELoader().load('assets/studio.hdr', (hdr) => {
  hdr.mapping = THREE.EquirectangularReflectionMapping;
  scene.environment = hdr;     // lights + reflects all PBR materials
  scene.background = hdr;       // optional: show it as the backdrop
});
// Optional cinematic tone curve:
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.0;

Pitfalls

  • Mesh is pure black → a lit material with no light and no scene.environment.

Add a light or an environment map; to confirm geometry, temporarily swap to MeshBasicMaterial/MeshNormalMaterial.

  • Scene too dark even with lights → old tutorial intensities. r155+ is physically

based; raise intensities (key light ≈ 2–3) or add an environment map.

  • Shadows don't appear → you missed one of the three switches

(renderer.shadowMap.enabled, light.castShadow, mesh castShadow/ receiveShadow).

  • Shadows are cut off or blocky → the DirectionalLight's orthographic

shadow.camera frustum is too big/small or doesn't cover the scene; tighten left/right/top/bottom/near/far and raise shadow.mapSize. Visualise it with new THREE.CameraHelper(light.shadow.camera).

  • Shadow acne / peter-panning → adjust light.shadow.bias (small negative) and

light.shadow.normalBias.

  • Colors look washed out / too bright → color (albedo) textures need

texture.colorSpace = THREE.SRGBColorSpace; normal/roughness/metalness maps must stay linear (leave them as NoColorSpace).

  • PointLight shadows tank performance → a point light renders the scene 6 times

(cube map). Prefer one shadow-casting DirectionalLight; use cheaper fakes elsewhere.

References

  • For the material cheat-sheet (which Mesh*Material for which look), light types

and their parameters/units, transparency vs alphaTest ordering, and the PMREMGenerator/RoomEnvironment route to IBL without an HDR file, read references/materials-lights-table.md.

Related skills

  • threejs-scene-setup — renderer, camera, and loop (set shadowMap, tone mapping).
  • threejs-gltf-loading — models arrive with PBR materials this skill tunes.
  • shader-programming — custom shader effects (engine-agnostic concept).

Score

0–100
55/ 100

Grade

C

Popularity15/30

838 installs — growing adoption.

Completeness19/30

Documented: full SKILL.md body, one-line install. Missing: description, category/license metadata.

Trust15/25

Community skill with a public GitHub source repository you can review.

Freshness6/15

No update timestamp is tracked for this skill in our catalog.

Scored automatically from popularity, completeness, trust, and freshness — computed only from data in our catalog, never fabricated.

Proud of your score? Add this badge to your README.

Paste a snippet into your GitHub README. The badge updates automatically and links back to this page.

Threejs Materials Lighting skill score badge previewScore badge

Markdown

[![Threejs Materials Lighting skill](https://www.claudemarket.ai/skills/gamedev-skills/awesome-gamedev-agent-skills/threejs-materials-lighting/badges/score.svg)](https://www.claudemarket.ai/skills/gamedev-skills/awesome-gamedev-agent-skills/threejs-materials-lighting)

HTML

<a href="https://www.claudemarket.ai/skills/gamedev-skills/awesome-gamedev-agent-skills/threejs-materials-lighting"><img src="https://www.claudemarket.ai/skills/gamedev-skills/awesome-gamedev-agent-skills/threejs-materials-lighting/badges/score.svg" alt="Threejs Materials Lighting skill"/></a>

Threejs Materials Lighting FAQ

How do I install the Threejs Materials Lighting skill?

Run “npx skills add https://github.com/gamedev-skills/awesome-gamedev-agent-skills --skill threejs-materials-lighting” in your terminal. The skill is added to your agent's skills directory and picked up automatically on the next run — no restart or extra configuration needed.

What does the Threejs Materials Lighting skill do?

> The full SKILL.md on this page shows the exact instructions the skill gives your agent.

Is the Threejs Materials Lighting skill free?

Yes. Threejs Materials Lighting is a free, open-source skill published from gamedev-skills/awesome-gamedev-agent-skills. As with any third-party skill, review the source repository before installing it into an agent with sensitive access.

Does Threejs Materials Lighting work with Claude Code and OpenClaw?

Yes. Skills use the portable SKILL.md format, so Threejs Materials Lighting works with Claude Code, OpenClaw, Codex, Hermes, and any other agent that reads SKILL.md skills.

Recommended skills

Browse all →
find-skills logo

find-skills

vercel-labs/skills

2.9M installsInstall
grill-me logo

grill-me

mattpocock/skills

817K installsInstall
frontend-design logo

frontend-design

anthropics/skills

762K installsInstall
grill-with-docs logo

grill-with-docs

mattpocock/skills

696K installsInstall
improve-codebase-architecture logo

improve-codebase-architecture

mattpocock/skills

671K installsInstall
agent-browser logo

agent-browser

vercel-labs/agent-browser

652K installsInstall

Related guides

Hand-picked reading to help you choose, install, and use agent skills.

GuideBest Openclaw Skills 2026GuideHow To Evaluate Openclaw Skill Before InstallingGuideOpenclaw Skills Complete Guide

Skills by category

FrontendBackend & APIsTesting & QASecurityDevOps & CI/CDMCP & ToolingAutomationData & Analysis+27 more

MCP servers by category

MCP & ToolingBackend & APIsData & AnalysisDevOps & CI/CDAutomationSecurityDocsTesting & QA+24 more

Plugins by category

AutomationDevOps & CI/CDData & AnalysisDesign & CreativeSecurityBackend & APIsFrontendTesting & QA+16 more

Marketplaces by category

AutomationData & AnalysisDevOps & CI/CDDesign & CreativeFrontendBackend & APIsTesting & QASecurity+21 more

The Agent Stack

Weekly Claude Code, Agent SDK, and MCP moves worth your time — free.

Claude Market

AI agent skills directory, marketplace, and workflow hub for OpenClaw, Hermes Agent, Claude Code, Codex, and MCP-powered operator stacks.

Independent project, not affiliated with Anthropic.

Resources

  • Browse Skills
  • Browse MCP Servers
  • Browse Plugins
  • Browse Marketplaces
  • Newsletter

More

  • Submit a Tool
  • Create a Skill
  • Advertise
  • Free Tools
  • API
  • Shipping
  • Contact
  • Terms
  • Privacy
© 2026 Claude Market · Not affiliated with Anthropic
Fazier badgeFeatured on Twelve ToolsFeatured on Wired BusinessRemote OpenClaw - Featured on AI Agents DirectoryListed on Turbo0Featured on Uneed