• Advertisement
Sign in to follow this  

Luminance extraction for bloom effect

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

I'm working on a typical full-screen bloom effect and am looking for some good reading on various ways to determine the bright areas of the screen (so as to bloom only the bright spots). A previous post on this forum suggested dotting by (0.3, 0.3, 0.3), which works okay for me, but if anyone could point me to some further info, I'd appreciate it much. Thanks, Benny

Share this post


Link to post
Share on other sites
Advertisement
Luminance blooms are fun. I don't know how well versed you are in shaders. But there's a great article here on gamedev about HDR rendering, which has luminance bloom. It requires multiple render passes.

http://www.gamedev.net/columns/hardcore/hdrrendering/

Once you figured that all out, for a guassian blur weights equation here it is:
http://www.cee.hw.ac.uk/hipr/html/gsmooth.html

Share this post


Link to post
Share on other sites
The DX SDK sample HDRLighting does this by simply subtracting a constant value from the color and then clamping negative values to zero:
color = max(color - BRIGHT_PASS_THRESHOLD, 0.0f);

Share this post


Link to post
Share on other sites
I'm not on my development machine right now, so I can't quote the details (I can post those later tonight if you want). For my HDR Demo sample I experimented with 6 (or was it 7?) different luminance calculations; for the most part they all give similar results.

I made a post in this very forum with some of the results. It should give you some ideas [grin]

The average value (dot(color,float3(0.33,0.34,0.33))) can look a bit odd if you have a single particularly bright channel - say dark red/green but bright blue. There are a better set of values to dot against (they're in the SDK's HDRLighting demo) based on the light wavelength properties (iirc).

Another couple of ways to consider are by converting to HSL/HSV and taking the L or V component as the brightness.

Apologies for the lack of details!
Jack

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement