> For the complete documentation index, see [llms.txt](https://docs.allout.game/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.allout.game/core-engine-concepts/camera-and-post-processing.md).

# Camera & Post Processing

### Camera

Every player starts off with a camera that follows them as they move. To adjust zoom or move the camera to other places, we provide a set of APIs.

In CSL, the camera is a per-player struct on `Player`:

* **`camera.follow_player: bool`**: when `true`, the engine keeps the camera following the player.
* **`camera.position: v2`**: the camera center in world space (used when `follow_player = false`).
* **`camera.size: float`**: zoom amount. **Larger = more zoomed out** (you see more of the world).

Because camera changes are **purely cosmetic**, apply them on the local client only:

```go
import "core:ao"

My_Player :: class : Player_Base {
    ao_late_update :: method(dt: float) {
        if is_local() {
            // Simple "set and forget" zoom
            camera.size = 7.0;
        }
    }
}
```

#### Custom follow (offset + smoothing)

If you want camera offsets, cutscenes, or custom smoothing, turn off `follow_player` and drive `camera.position` yourself:

```go
import "core:ao"

My_Player :: class : Player_Base {
    ao_late_update :: method(dt: float) {
        if !is_local() return;

        camera.follow_player = false;

        // Follow slightly above the player
        target_pos := entity.world_position + v2{0, 0.5};

        // Smoothly move towards the target (dt-safe)
        t := clamp(dt * 10.0, 0.0, 1.0);
        camera.position = lerp(camera.position, target_pos, t);

        // Smooth zoom
        target_size := 6.0;
        camera.size = lerp(camera.size, target_size, t);
    }
}
```

### Post Processing

Post Processing allows you to apply visual effects to your camera like distortion, color grading, and other effects to make your game pop!

You can configure post-processing in two ways:

* **Configure in the editor**: set up the default post-processing stack via **Edit → Game Config → Post Processing**. This applies when using the default camera behavior.
* **Configure at runtime via CSL**: use the `Post_Processing` API to dynamically apply effects from your component’s `ao_update` or `ao_late_update` methods.

If you enable any effect, All Out will automatically use the HDR pipeline.

#### CSL Post Processing API

Call any of the following functions each frame to apply post-processing effects. When any `Post_Processing` function is called, it **overrides** the editor defaults for that frame — so you must call every effect you want active.

| Function                               | Config Struct                                 | Fields                                                     |
| -------------------------------------- | --------------------------------------------- | ---------------------------------------------------------- |
| `Post_Processing.bloom`                | `Post_Processing.Bloom_Config`                | `bloom_amount: float`                                      |
| `Post_Processing.color_grade`          | `Post_Processing.Color_Grade_Config`          | `color_filter: v3`, `saturation: float`, `contrast: float` |
| `Post_Processing.chromatic_aberration` | `Post_Processing.Chromatic_Aberration_Config` | `channel_offsets: v3`, `focal_point: v2`                   |
| `Post_Processing.blur`                 | `Post_Processing.Blur_Config`                 | `directions: float`, `quality: float`, `size: float`       |
| `Post_Processing.film_grain`           | `Post_Processing.Film_Grain_Config`           | `strength: float`, `noise_scale: float`                    |
| `Post_Processing.vignette`             | `Post_Processing.Vignette_Config`             | `radius: float`, `softness: float`                         |

```go
import "core:ao"

My_Component :: class : Component {
    ao_late_update :: method(dt: float) {
        // Apply bloom + vignette every frame
        Post_Processing.bloom({bloom_amount = 0.04});
        Post_Processing.vignette({radius = 0.8, softness = 0.4});
    }
}
```

Because post-processing is **purely cosmetic**, wrap calls in an `is_local()` check when used on a player component so only the local client applies the effect.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.allout.game/core-engine-concepts/camera-and-post-processing.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
