1
\$\begingroup\$

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

enter image description here

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

enter image description here

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: enter image description here

Could anyone help me find the right formula?

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

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.

\$\endgroup\$
2
  • \$\begingroup\$ 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. \$\endgroup\$
    – cubrman
    Nov 27, 2014 at 9:17
  • \$\begingroup\$ 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? \$\endgroup\$
    – zogi
    Nov 27, 2014 at 13:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .