FXAA without tonemapper

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

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.

For tracking purposes, this is bugged as UE-35455

Hey Ben,

Thank you for your help :slight_smile:
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