# Bloom control - enlarging glare area

I am trying to improve my bloom system. So far I have bloom that looks like this:

What I need is to enlarge the low-bloom areas to make it look like this:

Simply increasing the bloom multiplier results in a linear brightness shift and the lantern's top gets completely lost in a bright epicenter. What I need is a non-linear system that alows to only enlarge bloom on the edges. I tried different approaches and was able to come up with the following formula:

float luma = min(dot(AccumulatedBloom.rgb, LUM_CONVERT), 1);
float bloomMultiplier = lerp(1, bloomAuraMult, pow(1 - luma, bloomAuraPower));


But this formula has a disadvantage, it makes the bloom look like this:

Could anyone help me find the right formula?

## 1 Answer

Bloom effect filters are usually circularly symmetric or isotropic. You can't achieve your goal by solely modifying the radial shape of the filter, since it won't break the symmetry.

However, to implement the desired effect, you can use e. g. the stencil buffer to mask out the region you want to remain dark. Alternatively you can create a texture of the light aura which captures specifically the shape you need. I'm sure there are countless other ways to do it, these are just some quick examples.

• No that is definitely not what I was looking for, I am looking for a universal solution, I am not willing to render another object for each bloomable object on my scene. I am pretty sure my goal is acheavable with the right formula. – cubrman Nov 27 '14 at 9:17
• Well, you can convolve the image with an anisotropic filter, however it will be computationally more demanding in general than e.g. a Gaussian filter, as the latter is separable. What technology are you currently using to perform the bloom effect? Do you perform a convolution by yourself, or do you use a library or framework? Could you include the full shader code in the question? – zogi Nov 27 '14 at 13:02