# Post Process Manager

![](/images/ppm/PPM_thumbnail_B.png){.rounded-lg}

!!!tip Post Process Manager - Code Plugin
Available on the [FAB marketplace](https://fab.com/s/96b4dfa5436b).
!!!

## Setup

1. Install the plugin from FAB. Manual process: Copy `PostProcessManager/` into your project's `Plugins/` folder, regenerate project files and build.
2. **Example content:** You can find three example materials and `DT_PostProcessExamples` in the plugin's Content folder. Commit those assets with the plugin.
![](/images/ppm/PPM_ExampleContent.png){.rounded-lg}
3. **Your own effects:** Use the existing example DataTable. If you want to create a DataTable: Use the row struct `PostProcessEffectDefinition` (an effect tag and a material), and add it under *Project Settings > Plugins > Post Process Manager > Effect Tables*.
![](/images/ppm/PPM_TableSetup.png){.rounded-lg}

   The example table is in that list by default. Remove it once you no longer need it.
![](/images/ppm/PPM_PluginProjectSettingsTables.png){.rounded-lg}

4. **Material:** each post process material needs a scalar parameter named `PostProcess Intensity`. You can use the provided example material function, which has this included.
![](/images/ppm/PPM_ExampleContentMF.png){.rounded-lg}
![](/images/ppm/PPM_ExampleContentMF2.png){.rounded-lg}

## Gameplay tags

The plugin ships its own tag source, `Config/Tags/PostProcessManagerTags.ini`:

| Tag | Example material |
|---|---|
| `PostProcess.Example.Desaturate` | `M_PP_Desaturate`: fades to greyscale |
| `PostProcess.Example.Vignette` | `M_PP_Vignette`: darkens the edges |
| `PostProcess.Example.Tint` | `M_PP_Tint`: multiplies by `Tint Color` (red by default) |

You can add new tags to this source from the Gameplay Tag Manager by selecting `PostProcessManagerTags.ini` as the source.

**Restricting tags:** turn on *Restrict Effect Tags* and add parent tags (for example `PostProcess`) to *Allowed Effect Tags*. Then:
- The tag pickers on all the plugin's nodes, on the data table rows and on *Preloaded Effects* only show those tags.
  The editor module does this through a Gameplay Tags category remap named `PostProcessManagerEffects`.
- At runtime, Add rejects any other tag with a warning, and table rows that use other tags are skipped.

![](/images/ppm/PPM_PluginProjectSettingsTags.png){.rounded-lg}

## API

All functions exist on the **Post Process Manager Subsystem** and as static nodes that you can call from any Blueprint.
![](/images/ppm/PPM_BPFucntionsOverview.png){.rounded-lg}

| Function | Defaults |
|---|---|
| Add Post Process Effect (Tag, Intensity, Fade In Duration, *Fade Curve*) | 1, 0.15 |
| Add Post Process Effect For Duration (Tag, Intensity, Duration, Fade In, Fade Out, *Fade In Curve*, *Fade Out Curve*) | 1, 1, 0.15, 0.15 |
| Set Post Process Effect Intensity (Tag, Intensity, *Remove At Zero*) | Sets the intensity directly, without a fade. Use it to drive the effect from a timeline or slider. Adds the effect if it isn't active. Unless Remove At Zero is ticked, the effect stays at 0 so it can blend back up instantly |
| Remove Post Process Effect (Tag, Fade Out Duration, *Fade Curve*) | 0.15 |
| Add Post Process Effects / Add Post Process Effects For Duration / Remove Post Process Effects | Same as above, but take a **Gameplay Tag Container**. All the effects use the same settings. You can set the tags directly on the node |
| Remove All Post Process Effects (Fade Out Duration, *Fade Curve*) | 0.15 |
| Is Post Process Effect Active, Get Post Process Effect Intensity, Get Post Process Effect Material, Get Active Post Process Effects | |
| Register Effect Table | Adds a table at runtime |

The curve parameters are under the node's advanced (collapsed) section.

```cpp
#include "PostProcessManagerSubsystem.h"   // add "PostProcessManager" to your module dependencies

if (auto* PPM = UPostProcessManagerSubsystem::Get(this))
{
    PPM->AddPostProcessEffect(DesaturateTag);                          // intensity 1, fade 0.15s
    PPM->AddPostProcessEffectForDuration(TintTag, 0.6f, /*Hold*/ 2.f);  // fades in, holds 2s, fades out
    PPM->RemovePostProcessEffect(DesaturateTag, 1.f, EaseOutCurve);
}
```

## Behaviour

- **Fades:** a fade duration of `<= 0` applies or removes the effect instantly.
- **Intensity `<= 0`:** removes the effect. The Fade In Duration and curve are used as the fade-out.
- **Adding an active effect:** fades from the **current** intensity to the new one, cancels a pending removal,
  and makes a timed effect permanent. *For Duration* also restarts the hold timer.
- **Timed effects:** they are on screen for `Fade In + Duration + Fade Out`.
- **Fade curves:** the curve's time range is stretched to fit the fade. Its value (0 to 1) blends from the start intensity to the target intensity.
  Values above 1 overshoot, which is useful for punchy hits. With no curve, the fade is linear.
- **Remove:** calling Remove again while the effect is fading out does nothing.
- **Events:**
  - `OnPostProcessEffectAdded(Tag)` fires once the material is loaded and the fade-in starts.
  - `OnPostProcessEffectChanged(Tag, Intensity)` fires whenever the intensity changes, so every frame during a fade.
  - `OnPostProcessEffectRemoved(Tag)` fires once the effect has fully faded out.

  Events are queued and sent after the manager finishes its update, so it's safe to add or remove effects from inside a listener.

## Sequencer: Post Process Effect Track

In a Level Sequence, go to *+ Track > Post Process Effect Track*. It's a root track, not bound to any actor.

![](/images/ppm/PPM_Sequencer.png){.rounded-lg}

- **Sections:** each section drives one effect. Set its **Effect Tag** in the section's properties (right-click the section > Properties).
  Key the **Intensity** curve to fade it in and out. With no keys, the intensity is 1.
  To add more sections, right-click the track and choose *Add Post Process Effect Section*. A track can have several rows.
- **Sequencer wins:** while a section is evaluating, Blueprint and gameplay calls for that tag are ignored, and the debug view marks the effect `[Sequencer]`.
- **Section end:** when the playhead leaves the section, or the sequence stops, the effect is **removed instantly**.
- **Editor preview:** the track previews in the editor viewport while you scrub and play.

## Editor preview window

Click **Post Process** in the level editor toolbar to open the *Post Process Preview* window.
![](/images/ppm/PPM_Preview.png){.rounded-lg}

- **Preview by Tag:** pick an effect tag (filtered like every other tag picker in the plugin) and click Add.
- **Preview by Material:** assign any post process material and click Add. It doesn't need a tag or a data table row.
- **Previews:** each preview gets its own intensity slider and an X button to remove it. *Clear All* removes every preview.
- **Lifetime:** previews show in the level viewport (not in PIE), carry over when you open another map, and are removed when you close the window.
  The manager's volume in the editor world is temporary and hidden, so it never dirties the level or gets saved.

The same direct-material functions are available to Blueprint: *Set Post Process Material Intensity* and *Remove Post Process Material*.
They're instant, with no fading, and are handy for quick tests.

## Loading

- On world start, the manager loads only the data tables. Materials are soft references.
- **Preloaded Effects** (a tag list in the settings): these materials load when the world starts and stay in memory.
  Use this for effects that must appear on the exact frame you add them.
- All other materials load **asynchronously** the first time their effect is added. The fade-in starts once the material has loaded,
  usually a few frames later. Removing an effect while it's loading cancels the load.
  Turn off *Async Load Materials* to load them synchronously instead.
- *Keep Loaded Materials* keeps on-demand materials in memory after their effect is removed. When it's off,
  they can be garbage collected and are streamed in again the next time.

## Debug

- `PostProcessManager.Debug 1` shows a "PostProcess Effects" list on screen with each active effect, its intensity and its state:
  fading, fading out, holding (with the time left), or loading. Turn it off with `PostProcessManager.Debug 0`. It isn't available in Shipping builds.

## Settings

![](/images/ppm/PPM_PluginProjectSettings.png){.rounded-lg}

The settings are stored in their own config file instead of `DefaultGame.ini`:
- **Plugin defaults:** `Plugins/PostProcessManager/Config/DefaultPostProcessManager.ini`. This ships with the plugin,
  so anyone who installs it gets the example setup.
- **Project overrides:** `<Project>/Config/DefaultPostProcessManager.ini`. The editor writes this file when you change a setting.

To change the defaults that ship with the plugin, edit the plugin's ini. You can also copy over the
`[/Script/PostProcessManager.PostProcessManagerSettings]` section from a project's override file.

| Setting | Plugin default |
|---|---|
| Effect Tables | The example table |
| Restrict Effect Tags / Allowed Effect Tags | On / `PostProcess` |
| Preloaded Effects | Empty |
| Async Load Materials | On |
| Keep Loaded Materials | Off |
| Intensity Parameter Name | `PostProcess Intensity` |
| Volume Priority | 1000 |
| Tick When Paused | Off |
| Ignore Time Dilation | Off |

## Notes

- One instance per tag. To stack the same look twice, use two tags.
- The draw order between effects comes from each material's *Blendable Location* and *Blendable Priority*.
- The manager exists in Game, PIE and Editor worlds. Editor worlds never preload materials and don't show the debug view.
- Requires Unreal Engine 5.6 or newer, because the Sequencer hooks use the 5.6 playback-state API.
