Threepp.DirectionalLight¶
Directional light (like sunlight)
A light whose rays are emitted in parallel from infinitely far away. It can cast shadows.
To cast shadows, set castShadow=true, call renderer.setShadowMapEnabled(true), and set receiveShadow=true on the receiving objects. Directional light shadows are rendered with an orthographic camera, so specify the area covering the scene with setShadowOrthoBounds.
Members¶
Constructors¶
Properties¶
Methods¶
- setShadowMapSize
- setShadowBias
- setShadowNormalBias
- setShadowRadius
- setShadowNearFar
- setShadowOrthoBounds
- dispose
DirectionalLight¶
Constructor
Arguments
| Arguments | Default | Description |
|---|---|---|
color |
0xffffff |
Light color (0xRRGGBB). |
intensity |
void |
Light intensity. |
Description
Constructor
type¶
Property \ Access: r/w
Description
"DirectionalLight" (read-only)
setShadowMapSize¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
w |
|
|
h |
|
Description
Shadow map resolution (default 2048x2048)
setShadowBias¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
bias |
|
Description
Shadow bias to reduce shadow acne (e.g. -0.0005)
setShadowNormalBias¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
bias |
|
Description
Bias along the normal
setShadowRadius¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
radius |
|
Description
Soft shadow radius (PCF)
setShadowNearFar¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
near |
|
|
far |
|
Description
near/far of the shadow camera
setShadowOrthoBounds¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
left |
|
|
right |
|
|
top |
|
|
bottom |
|
Description
Shadow area of the directional light (orthographic)
dispose¶
Method
Description
Releases resources