Bloom filter causes issues with edges of display

I’m using the bloom filter, and it causes some nasty effects on the edges of my window. They are clearly visible on most of the screenshots here:

Here is one of them that shows it well:

Here is another case:

I remember seeing this mentioned somewhere as being a mac issue related to the buffers not getting cleared or something like that. These were all taken on my mac with a Nvidia GeForce 9600m GT.

Does anyone know a solution for this, or can clarify if it actually is a mac only issue.


I’m guessing that it is related to the bloom shader sampling an area of the texture off the side of the window. With the texture being larger than the window, there would be an issue with that on 2 sides, which is what I’m seeing. In the I found:


If I remove these lines, I also see the issue on the bottom (and probably the left if I tied enough times).
I tried adding:


but it did not help as the clamping is happing at the texture edge which is well off screen.
I’ll work a bit more on this and see if I can figure it out.

I get this too. (Windows, Nvidia 6800 Ultra.) I think it’s an issue with edge clamping on the RenderTexture, but I haven’t investigated it yet. But some (not all) of my RenderTextures have repeated pixels that run along the top and right edge. At first I thought it might be an issue with the Bloom filter itself, but I started noticing unrelated RTs exhibiting the same issue.

I’m starting to think the issue is might be in both the bloom sampling, and the down sampling shaders.

Anyway, if I make my win 1024512, no problem. 1024513 produces lots of noise on the top edge. Really does seem to have to do with the non power of 2 screen size. Maybe fixing the padding (setPadSize) somewhere might fix it.

Hrrm, seeing the same thing here. Main window 1024x1024 = all RTs that are built based on Win size are no longer exhibiting the extra rows/columns of pixels.

I also checked my other RTs, and found that the ones exhibiting the extra lines were non-pow2.

was this filed as a bug?
pro-rsoft: could we get file a bug link on the site?

I looked through the bug list, and I didn’t see it. I guess I should file it then.

And FenrirWolf, what do you mean by “RTs”?

Sorry, offscreen buffers that are all RenderTexture targets.

And yes, go ahead and file it. :slight_smile:

Well, I made an account and filed a bug report,
I hope I did that right.

Oh, I think I figured out what the problem is. Panda pads the buffer with some extra space in the case of a non-power-of-two window size, and when it samples the corner pixels in the screen (with Linear mode) it also samples into the padded area of the buffer.

Enabling glClear for the filter quad render would help a bit, although it would make the border black. Hm, this is gonna require some thought.

Thats what I came to, though you put it much better. The majority of the effect in my case though I think is from the bloom filter sampling the padding in the 2 blur shaders.

This could possibly be resolved by passing in the window size to the shaders and doing a min(winSizex,x) type thing in all the texture samples to clamp to the smaller size. There may be some other way to get it to clamp to the smaller window size.

It’s not as easy as that. The sampling area should be right.
It’s the linear filter that is the issue, I think. (Does setting the filtering mode to nearest help, by the way?)