Objectual UI Blur [3.3]

I’ve decided to remake this resource because I found it very jumbled and not that optimized. For example, my code (one single module, type-safe as-well) is about 170 lines. As for optimizations, the original resource used to clone and parent a local script which created a multitude of Parts with SpecialMeshes set to Wedge (mind you, not even a WedgePart) and whip up the shape of a rectangle that way. My module simply creates a part which should cover the entire frame. It would also hide that part if either the ScreenGui or the Frame itself is visible.


Usage:

Code-wise

If you only want to handle blurring manually, then the module presents 3 simple functions (which you’d need only 2) for usage:

  • .new(GuiObject: GuiObject, Arguments: UIBlurArguments) : UIBlur
    This function simply creates the blur effect on a (usually Frame) GuiObject instance. The arguments table accept as follows:
{
	Corner : number?, -- 0 - 3
	Fragmented : boolean?, -- Little sunlight effect using displaced geometry
	Inverted : boolean?, -- Inverts the screen colors for that particular GuiObject
	DisableBelowNeededGraphics : boolean?, -- Disables the blur effect if the "QualityLevel" is set to a value below 8
}
  • Update(self: UIBlur) simply updates the blur effect. This is a function which you don’t need to call since the module already updates the effect Pre-Render.

  • Destroy(self: UIBlur) simply destroys the blur effect (not the BlurEffect instance, see Object-wise for info) and clears the little resources it used.

For an example on how to use, you simply:

local UIBlur = require(game.ReplicatedStorage.UIBlur)
UIBlur.new(script.Parent.Frame)
Object-wise

If the module’s AutoAddEnabled attribute is enabled, the module will automatically* scan the Player’s PlayerGui for BlurEffect instances, and apply a blur effect accordingly. Setting the BlurEffect.Enabled to false also disables the blur, like the real thing! Beware however with rounded frames, as the module will try its best to add the best corner to the blur, however it isn’t perfect. I recommend code-generated blur for frames with UICorners!

*Note: for the auto-adder to work, the module should be required, but only that! No need to actually use the .new function.


Features (BloatWare):

Corners?

Yes, the module uses a pre-modelled MeshPart instead of a regular part for rounding. Corners also support fragmentation! This method isn’t that good either, because on 1:1 ratios the corner will look stretched, but this is best for buttons.

  • Level 1 is a barely rounded square
  • Level 2 is a square rounded 50% of the way
  • Level 3 is a circle
Fragmentation?

Yes, since the parts used to make the blur are Glass-material, with some neat geometry one could make a “shiny” bloom just like below (third frame):

Inverted colors?

Yes, using a cool little trick from a tutorial (linked in the Update Log) I also added this functionality. Beware that it might look too crisp for simple usage, so I recommend turning this on only for a square Frame. The sample place file provided below also features a ColorCorrection effect (disabled by default).


Make sure the version of the module (found at line 5) and this post’s title match to get the latest product!

UI Blurs Sample Place File (73.8 KB)


Despite the name, I think this may have become too bloated.
Please let me know if you encounter any issues/bugs, or have improvement ideas!


Update Log

16 May 2024

  • Changed how arguments passed on Blur creation are made, please update all your scripts accordingly (I know I should’ve done this when I added Fragmentation sorry)
  • Added inverted colors (thanks to this tutorial)

11 May 2024

  • Added fragmentation (order of arguments changed!)
  • Added variable depth scaling depending on the Corner used (DepthOfField is weird)

26 April 2024

  • Added a sample place file

25 April 2024

  • Added functionality to the corner argument
  • Updated Part.Size formula
38 Likes

This is a remake of a remake of a remake lol

Remakes are meant to be better :upside_down_face:

5 Likes

Hello! Could you please provide a testing place? Thanks!

There, it’s pretty easy to use nonetheless but whatever:


There seems to be a split between the blur and the edge of the ui?
image
And this one is larger than the ui

1 Like

That’s odd, thought I fixed that. Is it the newest version of the module? If it is, I’ll look at the sizing formula right when I get home

It is yea, I dunno what’s causing it

Alright, I’ve done some changes to how the sizing is handled, so make sure to update the module (if it hasn’t automatically, the current version is 2.4. If it still looks weird, that’s simply because of how the DepthOfField renders blur, which in turn I’ll have to make the module account for that (by making the 3D part smaller)

I wish there was a way to do ui blur that worked for low graphics quality… Still a neat resource though, didnt know you could use dof like that :V :heart:

Thank you, I tried using SurfaceAppearances with Transparency for lower graphics, however they don’t work either… Unfortunately, even though “Blur” can be rendered at the lowest level, it cannot be “shaped” to match a part of the screen. Surely, if anything possible comes up, I’ll make sure to update the module!

1 Like

Maybe surfaceGuis could work?
TEXT LIMIT AHHHHH

SurfaceGuis don’t help at all. You might be thinking to put that SurfaceAppearance’ image into an ImageLabel on the blurry part, but images don’t work like that.