TSR feedback thread

Hi @Ligazetom and welcome on this thread!

Jumping from 5.2 and 4.27 si quite a jump!

TAA between 4.27 and 5.2 has only receive very minor changes. As proof of how little has changed on the TAA shader itself, wanted to share with you a diff of the file. Sadly looks like it is not possible two files on github with a link, so instead please find here a diff of the shader file.

TAAShader4.27vs5.2.txt (6.9 KB)

You will see there it’s only minor addition like a pixel shader for mobile, some file struct changes.

Only major thing that changed is in the cvar control the quality. In UE4, sg.AntiAliasingQuality used to control r.PostProcessAAQuality which was 0 aand 1 was FXAA where as 2 and 3 where two quality of TAA. But now in UE5 this sg.AntiAliasngQuality instead controls a r.TemporalAA.Quality. If you want further details how to migrate some settings I recommend looking at the commit message of that change: https://github.com/EpicGames/UnrealEngine/commit/eadb45ef3718ce60c640d915ea1261c30dc6abce

Otherwise something worth noting is that TAA is now capable r.TemporalAA.Quality 0 and 1 to have a R11G11B10 history that saves memory bandwidth thanks to a tricked discovered in TSR development that is enabled by default with r.TemporalAA.R11G11B10History.

So what could actually have changed so much between 4.27 and 5.2 that disrupt your project? My though are on motion vectors that are important consequence on the quality of TAA and more specifically the setting that has changed with this change https://github.com/EpicGames/UnrealEngine/commit/e9b8605b3b2c9235072f67b27eb6c6ca68e31382 replacing the r.BasePassOutputsVelocity and r.DepthPassMergedWithVelocity with a single r.VelocityOutputPass.

The 1080 TI was a great GPU! And is not that far off to current gen consoles! However TSR’s goal was to accomodate performance for other rendering feature of UE5 by allowing low rendering resolution, so it is designed and optimised from the ground up for the rendering resolution to be lower than the display resolution. It can run at whatever rendering and display resolution. Thing is to allow rendering a much lower resolution, it meant investing runtime performance in its quality to hide better the lower rendering resolution than TAA. So while both are Temporal Upscalers, TSR is doing a looooot more than TAA morivated for quality reason.

Interestingly the cost of TSR scales with the rendering resolution unlike TAAU. So as the rendering resolution lowers, it means more work for TSR to maintain image quality, but interestingly it’s runtime costs become cheapers per frames. We explain this a little bit better in upcoming 5.2 TSR documentation.

TSR cost scaling.pdf (302.8 KB)

Now TSR goal was to targetting current gen console but also make sure it future proof for possibly more powerful hardware too. So for instance Fortnite using TSR on PS5 and XSX is using the Medium anti-aliasing scalability (sg.AntiAliasingQuality=1) while XSS uses sg.AntiAliasingQuality=0. In 5.3, I’ve added shader permutation to also uses 16bit instruction in D3D12 for Windows like we do on console ( https://github.com/EpicGames/UnrealEngine/commit/c83036de30e8ffb03abe9f9040fed899ecc94422 ), and while your 1080 TI is comparable to a console, it sadly doesn’t support 16bit VALU instructions which TSR heavily makes uses of to optimise its performance on current gen consoles.
So this is why sg.AntiAliasingQuality=0 might actually be most fitted for your GPU. Here is how to configure it in editor:

One way to find out what goes into the cost of TSR is using ProfileGPU in the console with r.ProfileGPU.Root TemporalSuperResolution and here you can see the cost of each TSR passes, for instanec

Epic Anti-Aliasing Quality:

LogRHI:        9.5% 0.64ms   TemporalSuperResolution() 1739x748 -> 2786x1198 9 dispatches
LogRHI:           0.1% 0.01ms   TSR ClearPrevTextures 1739x748 1 dispatch 109x47 groups
LogRHI:           0.2% 0.01ms   TSR ForwardScatterDepth 1739x748 1 dispatch 218x94 groups
LogRHI:           0.5% 0.03ms   TSR DilateVelocity(MotionBlurDirections=0 OutputIsMoving SubpixelDepth) 1739x748 1 dispatch 218x94 groups
LogRHI:           0.4% 0.03ms   TSR DecimateHistory(ReprojectMoire) 1739x748 1 dispatch 218x94 groups
LogRHI:           1.9% 0.13ms   TSR RejectShading(WaveSize=32 FlickeringFramePeriod=3.000000  ComposeTranslucency) 1739x748 1 dispatch 145x63 groups
LogRHI:           0.4% 0.02ms   TSR SpatialAntiAliasing(Quality=2) 1739x748 1 dispatch 218x94 groups
LogRHI:           0.2% 0.01ms   TSR FilterAntiAliasing 1739x748 1 dispatch 218x94 groups
LogRHI:           4.5% 0.30ms   TSR UpdateHistory(Quality=Epic R11G11B10) 5572x2396 1 dispatch 697x300 groups
LogRHI:           1.2% 0.08ms   TSR ResolveHistory 2786x1198 1 dispatch 349x150 groups

Low Anti-Aliasing Quality:

LogRHI:        3.6% 0.23ms   TemporalSuperResolution() 1739x748 -> 2786x1198 6 dispatches
LogRHI:           0.1% 0.01ms   TSR ClearPrevTextures 1739x748 1 dispatch 109x47 groups
LogRHI:           0.2% 0.01ms   TSR ForwardScatterDepth 1739x748 1 dispatch 218x94 groups
LogRHI:           0.5% 0.03ms   TSR DilateVelocity(MotionBlurDirections=0 SubpixelDepth) 1739x748 1 dispatch 218x94 groups
LogRHI:           0.4% 0.03ms   TSR DecimateHistory() 1739x748 1 dispatch 218x94 groups
LogRHI:           1.3% 0.08ms   TSR RejectShading(WaveSize=32 FlickeringFramePeriod=0.000000  ComposeTranslucency) 1739x748 1 dispatch 145x63 groups
LogRHI:           1.0% 0.06ms   TSR UpdateHistory(Quality=Low R11G11B10 OutputMip1) 2786x1198 1 dispatch 349x150 groups
1 Like