---
name: r3f-lighting
description: React Three Fiber lighting - light types, shadows, Environment component, IBL. Use when adding lights, configuring shadows, setting up environment lighting, or optimizing lighting performance.
---
# React Three Fiber Lighting
## Quick Start
```tsx
import { Canvas } from '@react-three/fiber'
function Scene() {
return (
)
}
```
## Light Types Overview
| Light | Description | Shadow Support | Cost |
|-------|-------------|----------------|------|
| ambientLight | Uniform everywhere | No | Very Low |
| hemisphereLight | Sky/ground gradient | No | Very Low |
| directionalLight | Parallel rays (sun) | Yes | Low |
| pointLight | Omnidirectional (bulb) | Yes | Medium |
| spotLight | Cone-shaped | Yes | Medium |
| rectAreaLight | Area light (window) | No* | High |
## ambientLight
Illuminates all objects equally. No direction, no shadows.
```tsx
```
## hemisphereLight
Gradient from sky to ground. Good for outdoor scenes.
```tsx
```
## directionalLight
Parallel light rays. Simulates distant light (sun).
```tsx
// With target (light points at target)
function DirectionalWithTarget() {
const lightRef = useRef()
return (
<>
>
)
}
```
## pointLight
Emits light in all directions. Like a light bulb.
```tsx
```
## spotLight
Cone-shaped light. Like a flashlight.
```tsx
// SpotLight helper
import { useHelper } from '@react-three/drei'
import { SpotLightHelper } from 'three'
function SpotLightWithHelper() {
const lightRef = useRef()
useHelper(lightRef, SpotLightHelper, 'cyan')
return
}
```
## rectAreaLight
Rectangular area light. Great for soft, realistic lighting.
```tsx
import { RectAreaLightHelper } from 'three/examples/jsm/helpers/RectAreaLightHelper'
function AreaLight() {
const lightRef = useRef()
return (
<>
>
)
}
// Note: RectAreaLight only works with MeshStandardMaterial and MeshPhysicalMaterial
// Does not cast shadows natively
```
## Shadow Setup
### Enable Shadows on Canvas
```tsx