# Explain the property of light.shadow.camera.near/far/right/left/top/bottom?

**URL:** <https://discourse.threejs.org/t/explain-the-property-of-light-shadow-camera-near-far-right-left-top-bottom/2695>\
**Category:** Questions\
**Tags:** lights\
**Created:** [May 2, 2018, 4:02am UTC](https://discourse.threejs.org/t/explain-the-property-of-light-shadow-camera-near-far-right-left-top-bottom/2695 "2018-05-02T04:02:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Liu\_Hao](https://avatars.discourse-cdn.com/v4/letter/l/3e96dc/32.png) [@Liu\_Hao](https://discourse.threejs.org/u/Liu_Hao)\
**Post date:** [May 2, 2018, 4:02am UTC](https://discourse.threejs.org/t/explain-the-property-of-light-shadow-camera-near-far-right-left-top-bottom/2695/1 "2018-05-02T04:02:32Z")

</div>

I just start to create a game use three.js by copy and modify the example code,  
One thing really confuse me is the shadow of lights.  
First , the shadow edge is not sharp, it has some jags / sawtooth . see code snaps here : [http://jsfiddle.net/f17Lz5ux/5131/](http://jsfiddle.net/f17Lz5ux/5131/)

Second, when I change code to this:

```
light.shadow.camera.top = 180;
light.shadow.camera.bottom = -100;
light.shadow.camera.left = -120;
light.shadow.camera.right = 120;

```

the shadow enlarged, and becomes less recognizable.

when I change code to this:

```
light.shadow.camera.near = 1;
light.shadow.camera.far = 10;
light.shadow.camera.right = 15;
light.shadow.camera.left = - 15;
light.shadow.camera.top	= 15;
light.shadow.camera.bottom = - 15;
light.shadow.mapSize.width = 1024;
light.shadow.mapSize.height = 1024;

```

the shadow disappear !

so, could someone help me explain the light.shadow.camera.near/far/right/left/top/bottom property ?

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [May 2, 2018, 7:49am UTC](https://discourse.threejs.org/t/explain-the-property-of-light-shadow-camera-near-far-right-left-top-bottom/2695/2 "2018-05-02T07:49:54Z")

</div>

> [@Liu\_Hao](#):
>
> the shadow disappear !

I can see it in this example: [Edit fiddle - JSFiddle - Code Playground](https://jsfiddle.net/ctpk6y4f/2/)

The mentioned values just define the frustum of the shadow camera which is used for calculating the shadow map of a light source. To achieve good shadow quality, the frustums should be as small/tight as possible.

You should be aware that `right`, `left`, `top` and `bottom` are only values of an orthographic shadow camera. `SpotLight` has a perspective shadow camera so these values are ignored.

---

<div class="post-metadata">

**Author:** ![Liu\_Hao](https://avatars.discourse-cdn.com/v4/letter/l/3e96dc/32.png) [@Liu\_Hao](https://discourse.threejs.org/u/Liu_Hao)\
**Post date:** [May 2, 2018, 10:23am UTC](https://discourse.threejs.org/t/explain-the-property-of-light-shadow-camera-near-far-right-left-top-bottom/2695/3 "2018-05-02T10:23:58Z")

</div>

Thanks for your reply.  
I have a problem with directional light shadow, when at scene initialize, the player is stand on (0,0,0) which is in the light shadow camera’s frustums, but when the player move some way , it goes out of the frustums, so I need to change light shadow camera when I change the player’s position ? or set the frustums as large as possible ?

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [May 2, 2018, 12:51pm UTC](https://discourse.threejs.org/t/explain-the-property-of-light-shadow-camera-near-far-right-left-top-bottom/2695/4 "2018-05-02T12:51:50Z")

</div>

You should try to change the position of the directional light according to the player’s position.
