Glow effect with adjustable threshold (enjoy)

Hey all,

So I really love the Glow effect in Unity, but one thing that always bothered me about it was the inability to selectively dial in at what level of brightness/saturation the glow actually affects (i.e. darker colors do not get a glow/blur applied).

In other bloom/glow shaders I had used and written this was the case and I felt it provided a more realistic effect (only lighter highlights come through), without washing out the whole screen.

So I made a version of the Glow effect that does just that. The only addition is one new Inspector parameter (GlowThreshold), and one additional line placed in the down sample pass of the down sample shader (which means there is a new shader file as well).

When the glow threshold is 0 you basically have the old Glow effect (the whole screen is affected). As the glow threshold approaches 1, only colors with a higher and higher brightness value actually pass through the effect and get blurred and combined.

I think you’ll really enjoy the control of having this parameter.

I’ve included a Unity package that you can import into your projects to add this new image effect. You of course will need Unity Pro to use this effect. You can add the effect to your camera by selecting it in the editor and going to:

Component->Image Effects->Glow Threshold

Of course the old Glow effect is left intact.

Enjoy!

91203–3568–$glowthresholdeffect_898.unitypackage (5.73 KB)

xcellent work! thanks for sharing this.

This is awesome… thanks :slight_smile:

wow fantastic - thanks so much for sharing ; )

thanks, i love it :smile:

well done!thx!

Very nice.

Whats wrong at my side? Pro License I have.

Import Pro Standard Assets package.

I am a stupid moose!
I forgot to add Pro Asset package. All fine! Super work!

Any screenshots? :]

So this would make lightmaps look even better?

Thanks for sharing this one! I always wanted to “choice” when it comes to “glow” :wink:

Awesome! Fantastic stuff. Thanks for sharing. Plugged right into a project I’m working on…

Very cool glow; thanks for sharing this; offers users a choice of techniques :slight_smile:

Think the default pro blur has nice features too, but sometimes yes, you want it based on scene highlights, rather than alpha maps (as cool as that is in varying context)

Hi,

Great work. Do you know how can I change/remove the black border of the shader?

In Windows by default Unity chooses to open the paint program, which apparently breaks things when I make changes (only the border remains when I’m trying i.e. to change the color of it).

Thanks.

Hi there

Can i use this glow on the trail renderer.

thanx

I couldn’t get this to import.

The file glowthresholdeffect_898.unitypackage is 40kb once extracted from the .gz and when I try to import, it says “Error while importing package: Couldn’t decompress package” It extracted from the .gz without saying the file was corrupt so I’m not sure what’s going on.

Could someone post the files themselves instead of a package?

I’ve seen this myself a couple of times, and it seems to work if you simply remove the .gz instead of manually extracting it (then import into Unity). Not sure if this is your problem, but worth a try I guess :slight_smile:

Thanks! This must be at the wiki :slight_smile:

I was really disappointed with the built-in Glow, so I’m very relieved to see the ability to set the threshold. Much needed; thanks!

I also had to change the clamping of the Blur Spread. I don’t see any good reason to lock it to 0.5 - 1, so I changed the min to 0. Turns out 0.01 Blur Spread was pretty close to what I was looking for.

Threshold is a great addition to glow effects. Thanks again.