cloudai-x avatar

Threejs Lighting

This covers the full Three.js lighting toolkit from basic ambient and directional lights through spotlights, point lights, and RectAreaLight for soft illumination. You get detailed shadow configuration including map sizes, bias settings, and frustum tuning for each light type, plus environment-based lighting with HDR maps. The shadow optimization section is genuinely helpful, showing you how to fix acne artifacts and balance quality versus performance. If you're setting up realistic lighting or debugging why your shadows look wrong, the concrete examples for each light's shadow camera setup will save you time. The IBL section gets cut off but the fundamentals are solid.

skills.sh installs
17.2K
GitHub stars
4.1K
last updated
Aug 21, 2026

Install

$ npx -y skills add cloudai-x/threejs-skills --skill threejs-lighting --agent claude-code

Installs into .claude/skills of the current project.

Files

Three.js Lighting

Targets three.js r186. Examples use WebGLRenderer; the WebGPU and TSL section uses WebGPURenderer.

Quick Start

import * as THREE from "three";

const renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setPixelRatio(window.devicePixelRatio);
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);

const scene = new THREE.Scene();

const camera = new THREE.PerspectiveCamera(50, window.innerWidth / window.innerHeight, 0.1, 100);
camera.position.set(4, 3, 8);

// A single directional light: intensity is a plain multiplier, no distance falloff
const dirLight = new THREE.DirectionalLight(0xffffff, 3);
dirLight.position.set(5, 10, 5);
scene.add(dirLight);

const floor = new THREE.Mesh(
  new THREE.PlaneGeometry(20, 20),
  new THREE.MeshStandardMaterial({ color: 0x808080 })
);
floor.rotation.x = -Math.PI / 2;
scene.add(floor);

const mesh = new THREE.Mesh(
  new THREE.BoxGeometry(1, 1, 1),
  new THREE.MeshStandardMaterial({ color: 0x3a76c4 })
);
scene.add(mesh);

Sponsors

Details

Repository
github.com/cloudai-x/threejs-skills
Category
Debugging

More from cloudai-x/threejs-skills

All 10

Recommended

More Debugging
1jeffallan avatarflutter-expertjeffallan/claude-skillsUse when building cross-platform applications with Flutter 3+ and Dart. Invoke for widget development, Riverpod/Bloc state management, GoRouter navigation, plat14.7Kskills.sh installs
2wshobson avatardeployment-pipeline-designwshobson/agentsDesign multi-stage CI/CD pipelines with approval gates, security checks, and deployment orchestration. Use this skill when designing zero-downtime deployment pi14.2Kskills.sh installs
3wshobson avatarpython-anti-patternswshobson/agentsUse this skill when reviewing Python code for common anti-patterns to avoid. Use as a checklist when reviewing code, before finalizing implementations, or when 13.8Kskills.sh installs
4wshobson avatarprotocol-reverse-engineeringwshobson/agentsMaster network protocol reverse engineering including packet analysis, protocol dissection, and custom protocol documentation. Use when analyzing network traffi13.5Kskills.sh installs
5googlechrome avatarchrome-extensionsgooglechrome/modern-web-guidanceBuild and publish Chrome Extensions using Manifest V3 best practices. Use this skill whenever the user asks to create, modify, debug, or understand Chrome brows12.8Kskills.sh installs
6github avatarwebapp-testinggithub/awesome-copilotToolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing br12.5Kskills.sh installs