# Removing SSAO Temporal Dithering

**URL:** <https://forums.unrealengine.com/t/removing-ssao-temporal-dithering/69119>\
**Category:** Rendering\
**Tags:** unreal-engine\
**Created:** [July 16, 2016, 12:09am UTC](https://forums.unrealengine.com/t/removing-ssao-temporal-dithering/69119 "2016-07-16T00:09:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LegendOfCatzard](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LegendOfCatzard](https://forums.unrealengine.com/u/LegendOfCatzard)\
**Post date:** [July 16, 2016, 12:09am UTC](https://forums.unrealengine.com/t/removing-ssao-temporal-dithering/69119/1 "2016-07-16T00:09:48Z")

</div>

TL;DR: I’m looking for a way to get a ~2ms SSAO pass on PS4 at 1080p that isn’t super dithered without TemporalAA.

I’m working on a project that relies heavily on SSAO for local shadows and I’ve run into a bit of a problem. We can only run a single pass of SSAO on our PS4 build for performance as well as FXAA rather than Temporal - a bad combination for the default settings of the SSAO shader. Here’s an example (I’ve blown up the image 2x):

![88f72d2be556de4149a0f6e24f67ffce299d0323.jpeg](https://d1ap1mz92jnks1.cloudfront.net/images/transparent.png)

As you can see the 4x4 pattern used for temporal AA smoothing is very obvious here. I took the liberty of checking out PostProcessAmbientOcclusion.usf to see if there was anything I could mess with to change the bluring settings and I happened upon ths:

```auto

// AO_SAMPLE_QUALITY = 0 : no AO sampling, only upsampling
// AO_SAMPLE_QUALITY = 1 : no dither/per pixel randomization
// AO_SAMPLE_QUALITY = 2 : efficient high frequency 4x4 pattern without jitter for TemporalAA
// AO_SAMPLE_QUALITY = 3 : efficient high frequency 4x4 pattern with jitter for TemporalAA

```

I set the default to 1 and recompiled. I had a number of compile errors regarding a variable “bDebugLookups”. I wasn’t sure if that variable even existed anymore so I commented out everything the would have run if that was set to true and I was able to get the shader compiled, netting me this:

![5609fa9fc8af499a79fc7f8c8cdadfd97b5a2079.jpeg](https://d1ap1mz92jnks1.cloudfront.net/images/transparent.png)

I haven’t checked the frame time difference yet, but it definitely removed the 4x4 pattern. However, I’m getting some seriously weird ghosting problems with AO now:

![b36b596795b653f862c58fb51e84574f45c7a5ca.jpeg](https://d1ap1mz92jnks1.cloudfront.net/images/transparent.png)

Is there something obvious I missed here? Is there a better way to remove the dependency on TemporalAA from SSAO? I would gladly sacrifice detail or resolution over the dithered look. This is all on 4.12.3

---

<div class="post-metadata">

**Author:** ![LegendOfCatzard](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LegendOfCatzard](https://forums.unrealengine.com/u/LegendOfCatzard)\
**Post date:** [July 17, 2016, 8:07pm UTC](https://forums.unrealengine.com/t/removing-ssao-temporal-dithering/69119/2 "2016-07-17T20:07:51Z")

</div>

I just checked - it looks the the ghosting effect in the third image is directly proportional with the AO radius set in the post process. I’ll look through the shader to see if I can find something.

---

<div class="post-metadata">

**Author:** ![LegendOfCatzard](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LegendOfCatzard](https://forums.unrealengine.com/u/LegendOfCatzard)\
**Post date:** [July 20, 2016, 9:27pm UTC](https://forums.unrealengine.com/t/removing-ssao-temporal-dithering/69119/3 "2016-07-20T21:27:30Z")

</div>

Anyone else with this problem? I scoured through the temporal AA settings to see if there was a way I could run it just for SSAO like SSR does but I’m not sure if that would even work.
