« The Churn Continues | Main | Gameplay Footage »

Fullscreen Glow

I added support for fullscreen glow to my renderer yesterday and overall I am happy with the results. While this effect is not full blown HDR color correction/bloom/etc., it gives the scene a softer look while making the luminous colors brighter and providing some anti-aliasing on the side. I realize some people feel these type of post-processing effects are overused, but I like it. If you disagree, it will be one of the detail settings in the game that you can turn off.

WARNING: What follows is graphics nerd speak...

Here's the rundown on my implementation:

  1. If glow is on, we render the scene (minus UI) to an offscreen rendertarget, otherwise proceed as normal while rendering to the backbuffer.

  2. When we're done rendering the scene, switch the rendertarget over to one that is 1/4 the size. This fraction can be larger or smaller, but I made the performance/quality tradeoff at 1/4.

  3. Set the full-size offscreen rendertarget as a source texture.

  4. Set a fullscreen quad as the vertex source.

  5. Sample from the offscreen RT now... we are effectively downsampling the original result.

  6. The output of this stage is this sample, with the alpha channel containing the luminosity (or grayscale) of the color.

  7. Set the alpha blending mode to additive.

  8. Set the rendertarget to the backbuffer and another source texture to the downsampled luminosity RT.

  9. For this pass, sample the downsampled luminosity texture with a 3x3 gaussian blur kernel. Again, the size of the blur can be larger or it can be a box filter. This is also a performance/quality tradeoff.

  10. Add the blurred luminosity value to the sample for the scene texture.

Here's what the final result looked like:


Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>