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

490 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

You blur a pixel by mixing in colours from the surrounding pixels. Like smearing paints to blur a painting.

The process of rendering is going object by object through the virtual world and transforming its 3d information into pixels. This happens in parallel for thousands pixels at a time. There is no set order. For this reason the code that calculates the colour of a pixel does not know the colour of its neighbouring pixels.

Even if it could know, what would this mean for blurring? I need the unblurred colour from the neighbouring pixel. If my program is producing blurred colours then I’m stuck. My neighbouring pixel is already blurred. I need all the unblurred colours for a blur effect.

For this reason blurring is done by rendering to an image and then blurring the result, an expensive extra step.

This texture is a normal rectangle texture of a certain resolution, so there is no way to have less resolution in the area I know I’m going to blur.

There is a variable rate shader (the program that runs on your GPU) that calculates a single colour that is used by multiple pixels. So that is one solution that may help here, I’m bit out of touch to know if this is common. It was a big promise for VR and eye tracking so that you could render more details where the eye is looking.

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