Jump to content
  • Advertisement

Different amount bloom/glow per object

This topic is 504 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

Hi, I'd like to implment bloom with a different amout of blurring per object.

All the tutorials about bloom I found are global, they just render all the blooming objects in one RT, apply the same amount of blur to them and add to the original image.

Let's say I have a laser and a pistol, but the laser makes much more light than the pistol when shooting, so I want the laser to have much stronger bloom effect.
If I have lot of these different glowing objects, what is a good way to solve this problem?

Since the bloom effect can be quite large I'd like to do the bluring not in single/vert/horz pass, but iteratively via Kawase Bloom.
I was thinking about smth. like this.:

1. render objects and write the bloom strength in a stencil buffer (let's say strength can be integer from 1 to 10)
2. blur pixel with the Kawase 4 pixel kernels, but use only pixels that have stencil bigger than 1
3. write blurred value and find maximum stencil strength of the pixels used in kernel, decrease it by 1 and write to stencil
4. repeat from step 2, until some max limit (let's say 10)

But I still see some potential issues, not sure if this would work, does anybody have an idea how to do different amount of glow per object?
I don't care about the correctnes, I'm more interested in performance.

Share this post

Link to post
Share on other sites

It doesn't make sense to apply bloom as a per-object effect because in the real world "bloom" is a global blurring operator applied to the light entering the camera due to lens imperfections, and so affects all objects equally.

You could probably achieve a similar effect to what you want by rendering in HDR and apply bloom to the HDR pixels before tonemapping. Your laser would be more bright in comparison to the pistol, and so the perceptually visible area of the bloom kernel will be larger than for the pistol once you apply tonemapping.

Edited by Aressera

Share this post

Link to post
Share on other sites
On 26/07/2017 at 8:32 AM, Hodgman said:

This is the earliest bloom article I remember reading, and it has the feature you want: http://www.gamasutra.com/view/feature/130520/realtime_glow.php

Yeah, most later implementations of bloom do it as a global effect on every pixel equally.

Great article. First time I have seen it.

The technique described in there is identical to how I implement glow in my game.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!