Bloom is creating saturated squares

I’m trying to apply bloom to an HDR rendered scene that has extreme light highlights (intensities over 10 in some cases). This is necessary given the nature of the application.

I’m finding that areas of extreme highlight are blowing out to saturated squares:

Is there a way to fix this? Is this a limitation of traditional bloom techniques hitting an extreme case that is my scene?

If we step farther back, we can see this artifacting beginning in the blur iterations:
3313264--257515--Blur Iteration.PNG

Is this a byproduct of putting my bloom passes before my tonemapping pass?

Edit: After some more digging, I’m finding that the output of the bloom shader is producing fragments that are infinitely bright.

I have an image effect right after bloom that writes a white pixel if the input value is over a certain value:

        maxChannelValue *= 0.000001;
        if (maxChannelValue > _BlowoutThresholdMin)
        {
            return float4(1, 1, 1, 1);
        }
        else
        {
            return float4(0, 0, 0, 0);
        }

Even if I set _BlowoutThresholdMin to some crazy high value like 99999999999999, the fragment output is still white.

If a fragment goes beyond the limits of a half4 (which could be happening in the bloom shader), does it get treated like an infinite value or something?

Solved it,

The material I’m rendering there wasn’t normalizing a normal I interpolated in a shader. This caused the specular to get powered to an insanely high number when added with 10 or more lights, which caused the rendered fragment to be infinitely bright. Since it’s one isolated fragment in most cases, you’d never notice without the bloom issue.

When doing the blur sampling for the bloom, it was multiplying an infinite value by the sample weight, which is infinite. So the blur sample area got rendered out as infinitely bright.

Ensuring that my material shader was correctly normalizing any generated normals fixed it.

2 Likes

Wow! This was some interestingly informative info.
I’m bookmarking this topic, in case I one day, run into this same problem.

This has been happening to me on my 1050 Ti and yet it’s not happening on my intel integrated graphics. Very odd, I’m not exactly sure how to implement the fixes you’ve stated.