threejs-impl-shadows

Configure Three.js r160+ directional, spot, and point light shadows.

11|Updated Mar 20, 2026
One-click install
npx skills add https://github.com/OpenAEC-Foundation/Three.js-Claude-Skill-Package --skill threejs-impl-shadows
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: threejs-impl-shadows
Source: https://github.com/OpenAEC-Foundation/Three.js-Claude-Skill-Package/tree/main/skills/source/threejs-impl/threejs-impl-shadows
Command: npx skills add https://github.com/OpenAEC-Foundation/Three.js-Claude-Skill-Package --skill threejs-impl-shadows

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Shadows in Three.js projects are often misconfigured or neglected, resulting in missing, biased, or flickering shadows that degrade realism.

Core Features & Use Cases

  • Renderer and light opt-ins: enable shadowMap on renderer, castShadow/receiveShadow on lights and objects.
  • Shadow map tuning: configure mapSize, bias, normalBias, and different shadow map types (PCF, PCFSoft, VSM) per scene needs.
  • Guided workflows: per-light shadow setup for DirectionalLight, SpotLight, and PointLight, including frustum setup and camera helpers for debugging.

Quick Start

Enable shadows in renderer and lights, then enable per-object shadow casting/receiving and adjust the shadow camera frustum for your scene to ensure shadows render correctly.

Frequently Asked Questions about threejs-impl-shadows

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

FAQPage Schema
Why do my Three.js shadows flicker or fail to appear in the scene?

Three.js shadows often flicker or disappear due to misconfigured shadow camera frusta or incorrect bias values. Properly setting mapSize, normalBias, and ensuring renderer and per-object castShadow flags are enabled resolves these issues.

How do I configure shadow maps for DirectionalLight and SpotLight in Three.js?

To configure shadow maps for DirectionalLight and SpotLight, enable shadowMap on the renderer, set castShadow on the light, and adjust the shadow camera frustum. Tuning mapSize and bias ensures accurate shadow projection across the scene.

What is the difference between PCFSoft and VSM shadow map types in Three.js?

PCFSoft and VSM are Three.js shadow map types that offer varying degrees of edge softness and filtering. Choosing between them depends on scene requirements, with VSM providing smoother shadows but requiring careful bias tuning.

Does this shadow setup workflow apply to Three.js r160 and later versions?

Yes, the shadow configuration workflow applies to Three.js r160 and later versions. It covers directional, spot, and point light shadows, including mapSize, camera frusta, bias, and per-object shadow flags for modern scenes.

How do I use CameraHelper to debug shadow camera frustum issues in Three.js?

Use CameraHelper to visualize the shadow camera frustum boundaries in Three.js. This debugging workflow reveals if objects fall outside the frustum, allowing you to adjust the near, far, and orthographic dimensions to capture shadows correctly.

What are the limitations of using alpha-test with shadow maps in Three.js?

Using alpha-test with shadow maps in Three.js can cause edge artifacts if bias and normalBias are not properly adjusted. Correctly configuring per-object shadow properties and shadow map tuning mitigates these visual limitations.