# engineSetShadows (Client)

> Sets up the sun's shadows: how many cascades, their resolution and whether their edges are soft.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Graphics settings
- **URL**: https://wiki.mymp.gg/en/engineSetShadows

## Syntax

```lua
bool engineSetShadows(int cascades, int resolution [, bool soft = true])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `cascades` | `int` | From 0 to 4. With 0, the sun casts no shadows. The default on PC is 4. |
| `resolution` | `int` | Pixels per side of the shadow map: a power of two from 512 to 8192. The default on PC is 4096. |
| `soft` | `bool` | `true` softens the shadows' edges, `false` keeps them hard. *(default: `true`)* |

## Returns

`true` if the setting was applied, `false` if the renderer is not running.

The setting applies to the whole client and stays after the resource stops.

## Example

```lua
engineSetShadows(2, 2048, false)
```

### Note

`resolution` must be valid even with 0 cascades. Values outside the limits raise an error.

## See also

- [engineGetShadows (Client)](https://wiki.mymp.gg/en/engineGetShadows.md): Returns the sun's shadow settings.
- [engineSetLocalLightShadows (Client)](https://wiki.mymp.gg/en/engineSetLocalLightShadows.md): Turns the shadows of local lights (point, spot and rect lights) on or off.
