Jump to content
  • Advertisement
gamer9xxx

Different amount bloom/glow per object

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
Advertisement

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

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

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!