I have searched the net for resources related to rendering a bloom effect using GLSL, but haven't found anything. Although the tutorial at Philip Rideout's website is a good one, it performs very poorly on my Nvidia GPU.

Can anyone guide me as to how should I approach this problem and build a fairly efficient implementation of a bloom effect?

  • 1
    \$\begingroup\$ Ardor3d, an opensource java 3d engine, has a bloom shader implemented. Since it is opensource you can easily check that out (www.ardor3d.com). But basically, its just copying the framebuffer, downscale,blur,additive blending.. \$\endgroup\$
    – Pjotterke
    Oct 18 '11 at 14:39
  • 1
    \$\begingroup\$ What kind of GPU do you have? \$\endgroup\$
    – user1430
    Oct 18 '11 at 15:03
  • 1
    \$\begingroup\$ Very important to let us know what GPU / video card you have. +! @JoshPetrie \$\endgroup\$ Oct 18 '11 at 15:29
  • \$\begingroup\$ I have a Nvidia GeForce GT 230M graphic card on my laptop \$\endgroup\$
    – snape
    Oct 18 '11 at 15:35
  • 6
    \$\begingroup\$ @snape: How large a gaussian kernel are you using, and what is the resolution of your largest blurred FBO? The easiest way to improve performance is to use a smaller kernel and a smaller FBO. (In my stuff, I do my blurring inside a 512x512 resolution FBO, no matter the display resolution) \$\endgroup\$ Oct 18 '11 at 20:52

As Trevor mentioned in his comment, your only option might be to reduce the size of your kernel or to perform further downsampling .

But did you thoroughly read the tutorial you've linked to? There's a tip about exploiting hardware filtering, that the author calls the "sneaky" version. It's probably the best trick you can use to optimize you bloom effect without affecting its quality.

  • \$\begingroup\$ Yes, I read the tutorial thoroughly. I finally improved it's performance by using offline rendering and also I hadn't enabled hardware support for graphics application earlier. \$\endgroup\$
    – snape
    Apr 6 '12 at 16:14

I solved a very similar problem (blurring, but the bloom filter is bluring) with two passes.

In the first pass i blur in the X direction and in the second pass i blur in the Y direction.

I dunno from where i do have this trick but it lowers the time complexity from n² to 2n.

This works only for kernels which don't have any direction (so you can'T optimize a bokeh kernel this way).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.