# Gen 5 Temporal Anti-Aliasing

**URL:** <https://forums.unrealengine.com/t/gen-5-temporal-anti-aliasing/152107>\
**Category:** Feedback & Requests\
**Tags:** unreal-engine\
**Created:** [October 13, 2020, 5:38pm UTC](https://forums.unrealengine.com/t/gen-5-temporal-anti-aliasing/152107 "2020-10-13T17:38:09Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![Guillaume.Abadie](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/guillaume.abadie/32/1200533_2.png) [@Guillaume.Abadie](https://forums.unrealengine.com/u/Guillaume.Abadie)\
**Post date:** [March 25, 2021, 12:05pm UTC](https://forums.unrealengine.com/t/gen-5-temporal-anti-aliasing/152107/15 "2021-03-25T12:05:48Z")

</div>

Hi Guys,

sorry for the delay…

> [@](#):
>
> But for some reason, with Gen5 TAA, I see way, way more ghosting on WPO foliage, and extreme ghosting on some translucent particles. I have “Output velocities during base pass” enabled in the project settings, and I think foliage correctly uses the velocities with Gen4 TAA, as I do not see any significant amount of ghosting on WPO foliage with Gen4 TAA. Gen5 TAA looks significantly sharper on non-moving foliage, but when there’s a bit of wind, Gen5 TAA looks quite bad on the foliage due to the ghosting.

> [@](#):
>
> That are the settings I have tested with, but Gen5 TAA has the strong ghosting on WPO foliage with those settings, and the very strong ghosting on translucent particles.

Gen5 TAA is very unforgiving if the motion vectors are incorrect. On a WPO animation, this can happen when for instance animating with a material parameter without a PreviousFrameSwitch node to also feed what was the material parameter at the previous frame. More information here: [Utility Material Expressions in Unreal Engine | Unreal Engine 5.3 Documentation](https://docs.unrealengine.com/en-US/RenderingAndGraphics/Materials/ExpressionReference/Utility/index.html)

Best tool to verify the motion vector of your world position animations is the motion blur visualizer show flag

 ![Untitled.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/d/4/d4acf5d14455128f380930838c55ababd9b20266.jpeg)

I have made some improvements there in UE5 to be a bit more forgiving, but I won’t be able to cherry pick back this in UE4 due to how the code base has diverged a bit.

> [@](#):
>
> I’m using these settings with ‘Output velocities during base pass’ in the project settings and it seems to have improved the ghosting:
> 
> r.TemporalAA.Algorithm=1  
> r.BasePassOutputsVelocity=1  
> r.BasePassForceOutputsVelocity=1

Yes, in fact I’ve made a change in UE5 so that r.BasePassForceOutputsVelocity=1 becomes automatic when r.TemporalAA.Algorithm=1 and r.BasePassOutputsVelocity=1

> [@](#):
>
> It is significantly more expensive, thanks very much [Guillaume.Abadie](https://forums.unrealengine.com/member/35222-guillaume-abadie) for mentioning the “r.TemporalAA.R11G11B10History=1” optimization, that does help a bit with performance. Are there any further optimizations coming to 4.26 for this?

Don’t forget the r.TemporalAA.Upsamling=1 and change screen percentage, you can compensate the TAA by upscaling and go beyond and save frame performance by lowering r.ScreenPercentage without loosing to much quality in the upscaling. Gen5TAA and its costs are primarily intended for upscaling in term of quality but also performance. Many of it’s pass’s cost will scale with r.ScreenPercentage too.

I use r.ProfileGPU.Root=_TAA_ and r.ProfileGPU.ShowUI=0 to quickly profile TAA in the editor’s console.

r.TemporalAA.Algorithm=1 r.TemporalAA.Upsamling=1 r.ScreenPercentage=50

```auto

LogRHI: 23.2% 1.29ms TAAU 2420x1221 -> 2420x1221 7 dispatches
LogRHI: 1.7% 0.09ms TAA ClearPrevTextures 2420x1221 1 dispatch 303x153 groups
LogRHI: 3.9% 0.22ms TAA DilateVelocity 2420x1221 1 dispatch 303x153 groups
LogRHI: 2.4% 0.14ms TAA DecimateHistory 2420x1221 1 dispatch 303x153 groups
LogRHI: 5.3% 0.29ms TAA FilterFrequencies 2420x1221 1 dispatch 303x153 groups
LogRHI: 2.3% 0.13ms TAA CompareHistory 2420x1221 1 dispatch 303x153 groups
LogRHI: 1.1% 0.06ms TAA DilateRejection 1210x611 1 dispatch 152x77 groups
LogRHI: 6.6% 0.37ms TAA UpdateHistory R11G11B10 2420x1221 1 dispatch 303x153 groups

```

r.TemporalAA.Algorithm=1 r.TemporalAA.Upsamling=1 r.ScreenPercentage=60

```auto

LogRHI: 17.3% 0.61ms TAAU 1210x611 -> 2420x1221 7 dispatches
LogRHI: 0.8% 0.03ms TAA ClearPrevTextures 1210x611 1 dispatch 152x77 groups
LogRHI: 1.6% 0.06ms TAA DilateVelocity 1210x611 1 dispatch 152x77 groups
LogRHI: 1.6% 0.06ms TAA DecimateHistory 1210x611 1 dispatch 152x77 groups
LogRHI: 2.1% 0.07ms TAA FilterFrequencies 1210x611 1 dispatch 152x77 groups
LogRHI: 1.1% 0.04ms TAA CompareHistory 1210x611 1 dispatch 152x77 groups
LogRHI: 0.6% 0.02ms TAA DilateRejection 605x306 1 dispatch 76x39 groups
LogRHI: 9.5% 0.34ms TAA UpdateHistory R11G11B10 2420x1221 1 dispatch 303x153 groups

```

> [@](#):
>
> I’m seeing the same thing, but only with r.TemporalAA.R11G11B10History=1; with r.TemporalAA.R11G11B10History=0 the noise goes away.

Yeah I ran into similar issue on Lumen in land of Nanite demo. Fixed in UE5 and haven’t ran into other issues since to a point I was able to change the default of that cvar. I cherrypicked the simple fix from UE5 to 4.26.2 for you. 🙂

> [@](#):
>
> Are there any further optimizations coming to 4.26 for this?

Not as many as I had hoped, there has been some issues with devkit deliveries to test my changes, so we ended up needing to prioritize UE4 to remain stable given this is what Fortnite is shipping with on PS5 and XSX. Also there the source code has diverged quite a bit in UE5 that makes cherry picking some of the improvements back into 4.26 dificult. ☹

Stay safe! I’ll try to be a bit more responsive. Sorry about this :o

---

_[View the full topic](https://forums.unrealengine.com/t/gen-5-temporal-anti-aliasing/152107)._
