Unreal Engine 4 post-processing

Everything about latency. Tips, testing methods, mouse lag, display lag, game engine lag, network lag, whole input lag chain, VSYNC OFF vs VSYNC ON, and more! Input Lag Articles on Blur Busters.
Post Reply
flagbender
Posts: 19
Joined: 23 Feb 2016, 10:51

Unreal Engine 4 post-processing

Post by flagbender » 23 Feb 2016, 10:56

I think I understand that post-processing such as HBAO, bloom, DOF, motion blur, lens flare, etc. cause input lag, even if you're reaching a capped fps. I've got some questions about PP lag, specifically in Unreal Engine 4.

1. Does input lag differ between different GPU speeds? Say you have a GTX 670 or something, and it can get a solid 60fps even with these PP options. Would something like a Titan have less input lag? I'm wondering if it's a case where the Titan would render those buffer frames more quickly, or whether a solid 60fps means that the buffers have been created at full speed, so GPU speed wouldn't matter.

2. How many frames of lag would those sorts of effects create anyway? Is it like 1 extra frame, or could it be more than that? Is it possible that Unreal Engine 4 doesn't add extra lag with post-processing (by perhaps always having the same number of frames buffered regardless of options)?

Trip
Posts: 157
Joined: 23 Apr 2014, 15:44

Re: Unreal Engine 4 post-processing

Post by Trip » 23 Feb 2016, 18:03

Post processing adds latency because it is using shaders to an already rendered scene. Depending on what shaders are used it affects how long the processing will take and hence the latency. I don't think in a situation where the framerate is capped out however it will add latency since frames are never thrown away they will just stay in the buffer until they are scanned out. In a scenario where you arent capped though it does add some latency. Usually this also results in lower fps but this doesn't have to be the case necessarily since different resources can be used for the post processing in parallel with the main rendering. You know how fxaa doesn't have a large performance hit well thats the catch it does cost a bit more time to process but since it's in parallel it doesn't matter as much since those resources aren't used anyway.
flagbender wrote:1. Does input lag differ between different GPU speeds? Say you have a GTX 670 or something, and it can get a solid 60fps even with these PP options. Would something like a Titan have less input lag? I'm wondering if it's a case where the Titan would render those buffer frames more quickly, or whether a solid 60fps means that the buffers have been created at full speed, so GPU speed wouldn't matter.
I don't think so it's capped so latency will stay the same in an uncapped situation it might though. However when you don't use post processing and are uncapped I think the 670 might even be better since it has a higher clock speed and less shader units. But this depends on the effects and resolution. Usually the more effects and the higher the resolution the better these bigger cards works since they can work really well in parallel.
flagbender wrote:2. How many frames of lag would those sorts of effects create anyway? Is it like 1 extra frame, or could it be more than that? Is it possible that Unreal Engine 4 doesn't add extra lag with post-processing (by perhaps always having the same number of frames buffered regardless of options)?
Again depends on the shaders used and if it's more than 1 frame of latency your framerate will suffer since the main rendering has to be stalled for the post-processing to finish.
My source is wikipedia:"
https://en.wikipedia.org/wiki/Video_post-processing
Also know I am just using my own logic since I can't find a good source of information on the internet about buffers in gpu's. I assume there are at least 3 in series in this setup. One for the main rendering part one for post processing and one for the display scan-out. Verdict I don't think post-processing will add latency in a capped situation if frame rate is maintained otherwise it probably will.

flagbender
Posts: 19
Joined: 23 Feb 2016, 10:51

Re: Unreal Engine 4 post-processing

Post by flagbender » 24 Feb 2016, 06:10

So you think there's no additional lag caused by post-processing at a capped framerate? I'd like to believe that. It sounds to me like you're saying that PP doesn't cause inherent lag, but that it causes lag in much the same way as any other part of a rendered scene - by lowering fps. Is that what you mean?

User avatar
lexlazootin
Posts: 1251
Joined: 16 Dec 2014, 02:57

Re: Unreal Engine 4 post-processing

Post by lexlazootin » 24 Feb 2016, 08:15

i'm not trip, but yes. That's pretty much how it works.

flagbender
Posts: 19
Joined: 23 Feb 2016, 10:51

Re: Unreal Engine 4 post-processing

Post by flagbender » 24 Feb 2016, 08:24

Cool, that's what I wanted to hear :)

Thanks Trip and lexlazootin.

Trip
Posts: 157
Joined: 23 Apr 2014, 15:44

Re: Unreal Engine 4 post-processing

Post by Trip » 24 Feb 2016, 12:01

flagbender wrote:So you think there's no additional lag caused by post-processing at a capped framerate? I'd like to believe that. It sounds to me like you're saying that PP doesn't cause inherent lag, but that it causes lag in much the same way as any other part of a rendered scene - by lowering fps. Is that what you mean?
Ye pretty much if you cap fps the lag you get is the time it stays in the buffer because of the frame cap I don't think post processing will add any extra latency unless your framerate drops of course.

flagbender
Posts: 19
Joined: 23 Feb 2016, 10:51

Re: Unreal Engine 4 post-processing

Post by flagbender » 29 Feb 2016, 04:46

Thanks buddy :)

RLBURNSIDE
Posts: 104
Joined: 06 Apr 2015, 16:09

Re: Unreal Engine 4 post-processing

Post by RLBURNSIDE » 02 Mar 2016, 14:36

Postprocessing usually has a well-known and uniform, fixed rendering code on the order of a couple miliseconds. The big benefit to doing stuff like AA and other algorithms (reflections, etc) in screen space is that their cost becomes fixed, i.e. it's one less variable to worry about that could tank your framerate.

The big takeaway from this is that yes, they add some rendering costs (over not having any) but usually pretty minor, but are usually faster than doing the same thing in world space during actually scene rendering, where a variable workload yields more unpredictable costs. When you do stuff like AA in screen space (FXAA for example as already mentioned), you get a fixed performance cost since the frame size doesn't vary, and the rendering costs are fairly uniform at the pixel level (in screen space). Overall postprocessing is often used to increase rendering performance over traditional approaches, so if your goal is to avoid a frame taking 17ms (resulting in one frame of additional latency) instead of 15ms, then you should use PP instead of more expensive things. Especially for AA, that's the obvious thing here.

If you want a consistent framerate, you should benchmark your game and try settings so that your minimum FPS is 60 or whatever you want it to be.

I recommend if you are ultra-twitchy to get a G-Sync of Freesync monitor, and in those cases, yes, 1-2 ms does add a tiny, tiny bit of extra latency but usually that is a tradeoff for visual settings that you can tone down elsewhere. Basically, Postprocessing is a Good Thing. Of course some effects are really overkill like film grain and such nastiness. Sometimes people just put too many effects on. Less is more sometimes.

Post Reply