Roblox Needs Better Depth of Field (It's Very Inaccurate)

As a Roblox developer, it is currently too hard to add convincingly accurate depth of field to my game. The way Roblox currently handles depth of field is to arbitrarily apply a gradual gaussian blur* to objects closer or farther than an arbitrary distance value, per the Roblox Developer Hub. While this makes for a good baseline for low-performance devices due to how relatively inexpensive it is computationally**, it’s terribly inaccurate.


From DepthOfFieldEffect

Of course, this is not how real depth of field works with a real camera. Real cameras have lenses, sensors, apertures, and focal lengths, which all impact the depth of field. Additionally, by just arbitrarily applying a gaussian blur to the final rendered image, Roblox’s DOF implementation ignores a crucial element of convincing depth of field: bokeh.

image


Two photographs captured with a real camera. Notice the shape of the blur is the shape of the aperture opening inside the lens, not a simple gaussian blur. This is not possible with Roblox’s current DOF implementation.


Roblox’s DOF implementation, which has no bokeh and instead applies a simple gaussian blur to objects that are out of focus.


New World by Amazon Game Studios, which uses the Amazon Lumberyard game engine, simulates accurate depth of field with bokeh.

If Roblox is able to address this issue, it would improve my development experience because I would be able to add a much more convincing, accurate, and better looking depth of field effect to my games, improving their visual quality that much more.

*While it is not documented what type of blur Roblox applies, the results are consistent with that of a gaussian blur.
**Compared to more accurate DOF implementations

124 Likes

As someone who has studied and was planning on doing photography professionally, I can confirm that the system needs to be tweaked 100%. It doesn’t come off as natural whatsoever and if you’re trying to work on a photorealistic game or showcase, you’re left off needing to either keep the blur and have it do harm to your work instead of complimenting it or keeping the range for it for as far as you can.

26 Likes

Between intensity 0 - 0.215 Roblox uses Bokeh I think but since it’s such a low intensity it’s hard to notice. I’m not sure what roblox uses past that but if there’s bokeh it’s not really obvious at all

2 Likes

Bumping this since there’s been no word on whether this has been filed internally

11 Likes

Sorry for the massive necrobump, but I have some interesting findings here. Apparently, Roblox does render bokeh depth of field for all intensity levels. It’s just that after 0.215, they change how they render it (likely for performance considerations). This has the side effect that, at lower resolutions such as 1080p, the bokeh effect is almost entirely unnoticeable.

In the following 4K screenshots, bokeh can be more easily observed at maximum intensity.

No DOF, 4K

DOF at 0.215 intensity, 4K

DOF at maximum (1) intensity, 4K

In the following 1080p screenshots, the difference in how DOF is done at intensities > 0.215 makes it so that bokeh is less obvious.

DOF at 0.215 intensity, 1080p

DOF at maximum (1) intensity, 1080p

Note that RenderDoc states that both techniques are using a bokeh blur.

Low intensity DOF
image

High intensity DOF
image

So the request here should probably be adjusted to ask for high intensity DOF to be more resolution agnostic.

7 Likes

Perhaps also make it optional to choose the type of blur since bokeh can get quite laggy. Some games just need simple DOF and not fancy bokeh blur.

1 Like