I am playing around with the bloom shader from the XNA sample page, to do some glow shading. I am rendering primitive vector-ish squares of linelists/linestrips, on a background. However, I am facing a few problems.

With a black background and white squares, I can actually see the squares. However, with a white background and black squares, I can't see them at all.

Why is this happening, and is there any way of me fixing it?

Can I modify my bloom shader to also "glow" dark elements, if that's what is causing it?

  • 6
    \$\begingroup\$ Screenshots would help. \$\endgroup\$
    – Tetrad
    Jun 19, 2011 at 22:45
  • 3
    \$\begingroup\$ ...as would the shader code or a link to it. \$\endgroup\$ Jun 19, 2011 at 23:30
  • \$\begingroup\$ Could it be that the squares are small and bloom is turned up so high that it's covering the squares completely? \$\endgroup\$ Jun 19, 2011 at 23:31

1 Answer 1


The function of a bloom filter:

  • Apply a threshold to the source image to extract bright colours.

  • Blur the result.

  • Composite the blurred effect over the source image.

Your problem is that the shader targets bright colours (greater than the threshold) when it ought to target dark colours (less than the threshold). As a result, the dark shapes are being covered by the blur effect on the white background. Solution: change the direction (> vs. <) of the test.

If you want bloom on shadows as well as lights, try:

(Colour < Shadow Threshold || Colour > Highlight Threshold)

But it probably won't look great.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .