# Light Three.js Scenes and Tune Shadows

Renderer differences and light intensity units can make Three.js scenes hard to light consistently. Use renderer-specific examples to choose lights, tune shadows, and set up HDR environment lighting.

## Install

```bash
npx skillstore add cloudai-x/threejs-lighting
```

## Metadata

- Status: approved
- Slug: cloudai-x-threejs-lighting
- Skillstore revision: r1
- Version status: missing
- Tree hash: 01d56875e0b4ad0a29c584336d08a358b9aa533d7db752253f6baaa33c136b63
- Author: cloudai-x
- GitHub username: cloudai-x
- Repository: https://github.com/cloudai-x/threejs-skills/tree/0e181866f095b5f06d005133876e926515390d95/skills/threejs-lighting
- Ref: 5a685fd3b2304f9e4cbf5164d3ac3186cd35324e
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands
- Quality score: 73
- Public page: https://skillstore.pages.dev/skills/cloudai-x-threejs-lighting
- Manifest: https://skillstore.pages.dev/api/skills/cloudai-x-threejs-lighting/manifest

## Capabilities

- Compare light types by intensity units, falloff, and shadow support.
- Configure shadow casting and receiving, then tune map resolution, camera bounds, and bias.
- Set up HDR or cube environment lighting and control lighting intensity separately from background brightness.
- Generate ambient light probes from cube captures or bake a grid for position-dependent lighting.
- Adapt lighting setups to WebGPU, including area light texture registration and per-material light selection with TSL.
- Reduce shadow rendering work by limiting shadow casters or updating static shadow maps only when needed.

## Use Cases

- Light a product viewer: Set up HDR reflections for a product and adjust its lighting without changing the background brightness.
- Fix outdoor shadow artifacts: Tune the directional shadow camera and bias, or evaluate cascaded shadows for a larger scene.
- Adapt a scene to WebGPU: Identify renderer-specific lighting setup changes and assign selected lights to a node material.

## Prompt Templates

### Add a light and shadow

```
Show me how to add a directional light so the box casts a shadow on the floor. List the settings for the renderer, light, and meshes.
```

### Separate HDR lighting from the background

```
Show how to load my HDR image in Three.js r186. Reduce its lighting intensity without changing the background brightness.
```

### Diagnose directional shadow artifacts

```
Review my directional shadow settings. Explain how to adjust camera bounds, map resolution, and bias, and suggest an order for testing the changes.
```

### Plan lighting for many WebGPU point lights

```
Compare clustered and dynamic lighting for my Three.js r186 scene. Explain the shadow constraints and how TSL can restrict a node material to selected lights.
```

## Limitations

- Examples target Three.js r186, so check API availability when using another revision.
- The skill provides reference examples, not an automated visual test or GPU benchmark.
- HDR and cube map examples require image assets supplied by your project.
- Some examples assume an existing scene, camera, and renderer.

## Best Practices

- State your Three.js revision and renderer before adapting an example.
- Use a camera helper to verify directional shadow bounds before increasing map resolution.
- Disable shadow casting on lights that do not need it, especially point lights that require six shadow passes.

## Anti Patterns

- Do not rely on removed legacy lighting flags to restore brightness. Retune point and spot lights for their distance and candela values.
- Do not use light layers to select individual meshes. The renderer tests light layers against the camera.
- Do not manually prefilter an equirectangular HDR texture when assigning it directly as the scene environment. The renderer handles prefiltering.

## Security Audit

- Audited at: 2026-11-21T15:52:37.511\+00:00
- Summary: All 76 shell execution alerts match Markdown fences or inline Three.js examples, not shell or Ruby commands. The three reconnaissance alerts concern scene geometry and light probes, not host inspection. No evidence of prompt injection or unauthorized data access was found in SKILL.md.

## Stats

- Views: 0
- Downloads: 1
- Favorites: 0
- Popularity score: 0
