Sign in to follow this  

The wrong way to apply Bloom & Lens streak...

This topic is 2811 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The converntial way to apply post bloom and lens streak involves a final ADD, which inevitably excessively over-brightens the high-luminance areas in an image. This somtimes gives us bad visual efx. Another way is to apply LERP instead of ADD. This brings us an opposite issue: the whole image is overly darkened except for the bright areas. I wanna discuss: Is there any good solution to fix the over-brighten problem and maintain overall luminance of an image?

Share this post


Link to post
Share on other sites
First of all, abbreviations are nice, but maybe not everyone understands them (or ADD means addition? :P ).

Second, if you think about real life: What happens when you look into a bright light with your eyes? Your pupils shrink, so the "scene" will be darker (you're blinded a bit).
What happens with a camera? If there is no auto-brightness/whatever stuff, the bright light will be over-bright, and the bloom effect will bleed into a much larger area.

So both methods (whatever the abbreviations mean) seem totally right.
Some games even simulate the short term blindness: if you suddenly turn towards the sun, a fading white "screen" and a bigger but shrinking lens streak will be on top the scene.

I hope that helps.

Share this post


Link to post
Share on other sites
Quote:
Original post by dextml
Is there any good solution to fix the over-brighten problem and maintain overall luminance of an image?

You can do it as it happens in reality. Bloom is an an optical aberration of light from an intense light source. Simply said, you can see it as a non-linear, brightness dependent blur. In fact, in reality bloom is additive on the overall image, yet subtractive from the light source it originates from. Energy from the bright source is distributed along non-optimal paths along the optical system (the light is diffracting and scattering) onto neighbouring parts of the image. So energy conservation is guaranteed, while the over all image does indeed brighten up. This is obviously independent from any tonemapping adjustment operation, such as your eyes adjusting to the increased brightness.

So in fact the most realistic operation is an ADD, with or without adaptive blur.

Share this post


Link to post
Share on other sites
Quote:
Original post by Yann L
Quote:
Original post by dextml
Is there any good solution to fix the over-brighten problem and maintain overall luminance of an image?

In fact, in reality bloom is additive on the overall image, yet subtractive from the light source it originates from.

So in fact the most realistic operation is an ADD, with or without adaptive blur.


Yes, the core idea is to guarant enery conservation.
i think the problem is the substraction op, which can give plenty of jagginess. It's non-trivial to faithfully perform the substraction with smooth edges.

Share this post


Link to post
Share on other sites
The formulae i'm currently using is

max( col, texture2D( glow, uv ) * glowfactor )

where glowfactor is about 1.15... In here the glow texture is just a blurred version of the rendered scene..

It has no physic logic whatsoever but I like the result, but it's just my taste :)

It is creating the halo over the dark areas arround a bright object yet preserves the very bright discontinuities with satisfiying entropy..

But it's just an idea.. :)

Share this post


Link to post
Share on other sites
Instead of a simple additive blend, use a screen blend. Looks much better IMO, and doesn't suffer from the overexposure problems of additive blending.

I've also used a made-up blend mode using "max" like ptitjulien's above, which can work pretty well too.
e.g. to avoid the darkening problem of your "lerp" solution", you can do something like:
return lerp( original, max(original,bloom), ... );

Share this post


Link to post
Share on other sites
Quote:
Original post by ptitjulien
The formulae i'm currently using is

max( col, texture2D( glow, uv ) * glowfactor )

where glowfactor is about 1.15... In here the glow texture is just a blurred version of the rendered scene..

But it's just an idea.. :)

That's nice. But still, it reduces the natural color-bleeding feeling.
Hodgeman has offered a better version.

Quote:
Posted by Hodgman
Instead of a simple additive blend, use a screen blend. Looks much better IMO, and doesn't suffer from the overexposure problems of additive blending.

I've also used a made-up blend mode using "max" like ptitjulien's above, which can work pretty well too.
e.g. to avoid the darkening problem of your "lerp" solution", you can do something like:
return lerp( original, max(original,bloom), ... );

Brilliant!
Even though ScreenBlend is not cheap, but it's worth for the good composition result and scales well with future GPUs.

the lerp(ori, max(ori, bloom)) is a cheap alternative to screen blend. In my case, that works well too. :)

Share this post


Link to post
Share on other sites
Quote:
Original post by MJP
Quote:
Original post by dextml
Brilliant!
Even though ScreenBlend is not cheap, but it's worth for the good composition result and scales well with future GPUs.


Expensive? It's just b + a * (1 - b).


man, that's only true for LDR images (namely, lum ranges from 0 to 1).
For HDR composition, u have to do more.

Share this post


Link to post
Share on other sites
Quote:
Original post by dextml
Quote:
Original post by MJP
Quote:
Original post by dextml
Brilliant!
Even though ScreenBlend is not cheap, but it's worth for the good composition result and scales well with future GPUs.


Expensive? It's just b + a * (1 - b).


man, that's only true for LDR images (namely, lum ranges from 0 to 1).
For HDR composition, u have to do more.

For HDR, we don't need these complex methods, that we just do exposure adjustment.

Share this post


Link to post
Share on other sites
Quote:
Original post by dextml
Quote:
Original post by MJP
Quote:
Original post by dextml
Brilliant!
Even though ScreenBlend is not cheap, but it's worth for the good composition result and scales well with future GPUs.


Expensive? It's just b + a * (1 - b).


man, that's only true for LDR images (namely, lum ranges from 0 to 1).
For HDR composition, u have to do more.

Do it post tone-mapping and saturate() the bloom/original colors. Works fine; did this for a Doom 3 project.

Share this post


Link to post
Share on other sites

This topic is 2811 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this