# engineSetAmbientOcclusion (Client)

> Sets how many samples ambient occlusion takes. More samples darken corners and crevices more precisely.

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

## Syntax

```lua
bool engineSetAmbientOcclusion(int samples)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `samples` | `int` | From 0 to 32. With 0, ambient occlusion is off. The default is 6. Anything else raises an error. |

## 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
engineSetAmbientOcclusion(0)
```

## See also

- [engineGetAmbientOcclusion (Client)](https://wiki.mymp.gg/en/engineGetAmbientOcclusion.md): Returns how many samples ambient occlusion takes.
