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.
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.
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.
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
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.
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
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.