Blurred UIs using Depth of Field Effect

Pretty sure no one has posted about this yet but by using the Depth of Field effect and a Part that’s material is set to glass with a transparency of 1, a completely invisible part, you can create blurred sections on the screen.

Example :

By using this effect, and some little complex math, you can create a GuiObject with a blur.

Notice : Only the frame is blurred, the rest of the scene isn’t.

There are issues however, SurfaceGuis and BillboardGuis are “hidden” just because that’s how the glass material works.

Notice : The BillboardGui and SurfaceGui are gone.

Put a Depth of Field object inside of Lighting with these properies.


And this simple UI module / api I whipped up

BlurUI.rbxm (4.7 KB)

To create a blur frame, require the Module and use function ApplyBlur with the first Param being your GuiObject.

const Module = require( Module Here )

Module.ApplyBlur( GuiObject, Frame, CanvasGroup, etc ) -> 
      RbxScriptconnection ( GlassPart update connection )

This is just an example, not a well polished service, it doesn’t support UICorners or Rotations on the GuiObject, you can figure that out.

Here are some pros and cons of using this over a regular blur object.

Pros :

  • fancy
  • looks better
  • functionality
  • able to use in gameplay rather than Menu screens

Cons :

  • Cannot use other Depth of Fields with this
  • Guis in 3d space are hidden
  • Expensive to use ( Depth of Field )
  • Because the blur is an Part, you can see the sun’s reflections
  • Could be removed
    ( using a Part with a glass material with transparency higher than 1 has to be a bug )

Quick note, because of how close the DOF is, it doesn’t effect anything else, your camera has to be inside of a rendered triangle to even notice it.

Roblox place I used in the examples :
Testing.rbxl (80.6 KB)

3 Likes

Looks nice, I can see a wide use in indie games with creative features using this I wouldn’t even put “GUIs in 3d space are hidden” as a con, because it could be used as a pro.