# FXAA without tonemapper

**URL:** <https://forums.unrealengine.com/t/fxaa-without-tonemapper/374670>\
**Category:** Rendering\
**Tags:** fyi, unreal-engine, Post-Process, Anti-Aliasing, Rendering, CPP, question\
**Created:** [October 27, 2016, 9:19pm UTC](https://forums.unrealengine.com/t/fxaa-without-tonemapper/374670 "2016-10-27T21:19:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Answers.Archive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Answers.Archive](https://forums.unrealengine.com/u/Answers.Archive)\
**Post date:** [October 27, 2016, 9:19pm UTC](https://forums.unrealengine.com/t/fxaa-without-tonemapper/374670/1 "2016-10-27T21:19:48Z")

</div>

Hi,

I would like to use FXAA without tonemapping. If I either replace the tonemapper with a custom one (as a blendable in a global post process volume), or disable it completely using FEngineShowFlags, FXAA does not seem to work anymore. Is this expected behaviour ?

Note : temporal AA still works in this case, but I would prefer FXAA since I am capturing a preview scene (previous frames information would not be available for TAA).

Thanks,

Nicolas

---

<div class="post-metadata">

**Author:** ![Answers.Archive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Answers.Archive](https://forums.unrealengine.com/u/Answers.Archive)\
**Post date:** [October 27, 2016, 9:19pm UTC](https://forums.unrealengine.com/t/fxaa-without-tonemapper/374670/2 "2016-10-27T21:19:49Z")

</div>

Hi Nicolas,  
Thanks for reporting this. It looks like this is a bug. FXAA requires luminance in the alpha channel in order to work, and that’s not generated if you’re using a custom tonemapper.

You could workaround (albeit with some loss of quality) by defining FXAA\_GREEN\_AS\_LUMA 1 in FXAAShader.usf.

The proper fix would probably involve modifying the pixel shader in PostProcessMaterialShaders.usf like this (from PostProcessTonemap.usf):

```
half3 Color = GetMaterialEmissive(PixelMaterialInputs);
half LuminanceForPostProcessAA = dot(Color, half3(0.299f, 0.587f, 0.114f));
OutColor = float4(Color, LuminanceForPostProcessAA);

```

You’d probably want to only do that for materials with BL\_ReplacingTonemapper.

I think also you’d need to make the BL\_ReplacingTonemapper PostProcessMaterial output to a R8G8B8A8 texture, because it uses an R11G11B10 buffer currently.

I’ll get this bugged at our end so we fix it in a future release.

---

<div class="post-metadata">

**Author:** ![Answers.Archive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Answers.Archive](https://forums.unrealengine.com/u/Answers.Archive)\
**Post date:** [October 27, 2016, 9:19pm UTC](https://forums.unrealengine.com/t/fxaa-without-tonemapper/374670/3 "2016-10-27T21:19:50Z")

</div>

For tracking purposes, this is bugged as UE-35455

---

<div class="post-metadata">

**Author:** ![Answers.Archive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Answers.Archive](https://forums.unrealengine.com/u/Answers.Archive)\
**Post date:** [October 27, 2016, 9:19pm UTC](https://forums.unrealengine.com/t/fxaa-without-tonemapper/374670/4 "2016-10-27T21:19:51Z")

</div>

Hey Ben,

Thank you for your help 🙂  
It would actually be an issue for us to have a modified engine (even if it is a single shader), so we will probably wait for the fix to be integrated to a proper engine version. Can we expect it to be in 4.14 ?

Have a nice week end,

Nicolas
