[ELI5] Why does Depth of Field (DoF) setting in video games usually take a toll in performance?

514 views

By blurring the background. Your basically lessening the need to render and reduce resolutions. So it would logically make sense for the increase of the games FPS. However it seems it turning on does oddly the opposite? And I wanna know why that is

In: 48

16 Answers

Anonymous 0 Comments

This will be somewhat “wrong” from a technical perspective, but to keep the answer high-level I think it’s useful as an explanation.

Video games get their final result by effectively “drawing” the world in a series of images, these images are then stitched together for the final result using some fairly advanced mathematics.

As a very simplified example: [Land] -> [Objects/Characters] -> [Particles] -> [Full screen effects] and then we merge all these images together.

DoF occurs in the above staged called “Full screen effects”, most of the game-world at this point has been drawn and a lot of fairly expensive lighting calculations have been performed.

Computers can’t go back in time for free, so our only way to “speed” things up is to simply not do work but because the work has largely already been done there isn’t much left to make the effect “free” or to allow the effect to reduce overall workload.

This isn’t to say it can’t happen… we could apply “some” full-screen effects at an earlier stage but then that result will be carried forward and could produce artifacts; for instance if we applied it before we have drawn the characters they might look like they were “cut out” and simply pasted onto the blurred image which would have them not be blurred when they should be… meaning now we have to perhaps do another pass (which means more work, maybe less) or live with the result and save time.

Alternatively, we apply DoF every-time we draw something to the scene; the issue with this is we are usually looking at thousand’s of “should I blur?” and checking is an instruction.

However you are doing calculations to hopefully “short-circuit” and save time later; everything is an instruction, all instructions take time, it’s a race to simply find out which instructions can prevent more instructions from becoming necessary.

If you are interested in a deep-dive into how “modern” games render; I suggest reading [https://www.adriancourreges.com/blog/2015/11/02/gta-v-graphics-study/](https://www.adriancourreges.com/blog/2015/11/02/gta-v-graphics-study/) by Adrian Courreges where they break-down GTA 5’s rendering pipeline.

You are viewing 1 out of 16 answers, click here to view all answers.