Sign in to follow this  
nakolium

Fake-HDR blur problem

Recommended Posts

Hi, while adding an background-blur / fake-hdr effect to a little program of mine I encountered a "little" problem. After adding the blurred textur to my final scene i wondered where those black/dark edges came from that are visible at some of the "towers" at the following screenshot... clicky thinking about it made clear to me, that the blur shaders do not only blur the sky into the dark areas were the towers and spheres would be later, but also blur the dark areas that should not glow into those which should. i cleared the background to black, to make clear what i mean: clicky Up to now, i use 2 textures to render to via FramebufferObjects, and 2 shaders to blur the results. (one time vertically, and one time horizontally) My idea to get rid of those dark edges/areas in my glow-texture was to render the completely blurred glow to an extra texture, then blend this texture and the one containing the orignal image together using a shader choosing always the brighter pixel, which should solve the problem by discarding the dark blurred pixels and using the unblurred original-value. but that would mean to use an extra texture and another shader. just to make the background a bit glowy [smile] 3 shaders and 3 textures, involving 3 renderpasses are much more than i expected. Finally my question: Is there an easier way to get "clean" results using this fake-hdr approach? Thanks in advance. regards, nakolium --------- Sorry for my bad english ;) My native language is German.

Share this post


Link to post
Share on other sites
Hi,
at some stage of your glow effect pipeline you should have a bright pass filter involved. This filter removes all dark areas from the picture and leaves bright areas in there.
I would first check out what this filter is doing before I would try to tweak the result.
Masake Kawase's Bright pass filter did something like:

RGBA * Luminance

you might check out the way you do luminance first. Try different values here. I think the book HIgh-Dynamic Range Rendering describes the constants that are good for the luminance calculation. I think Masake used

0.299f, 0.587f, 0.114f

- Wolf

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

Sign in to follow this