Pixel filters with negative weights - is there a solution? back

Board: Home Board index Raytracing General Development

(L) [2012/05/06] [ost by ingenious] [Pixel filters with negative weights - is there a solution?] Wayback!

Look at the images below, and particularly on the light sources. See the black outlines? This is a result of a pixel filter with negative weights. The problem with these filters is that at certain pixels a very large amount of energy is weighted negatively, resulting in a negative pixel estimate, which is then clamped to zero. The neighboring pixel is on the other hand very bright, because this same energy is weighed positively. This problem has been discussed on OMPF before. Is there any existing solution to this particular problem? Well, other than the trivial not to use such a filter in the first place [SMILEY :)]
(L) [2012/05/07] [ost by davepermen] [Pixel filters with negative weights - is there a solution?] Wayback!

looking at the pictures, I see a much bigger problem: I don't see the pictures. [SMILEY :)]
(L) [2012/05/07] [ost by ingenious] [Pixel filters with negative weights - is there a solution?] Wayback!

>> davepermen wrote:looking at the pictures, I see a much bigger problem: I don't see the pictures.
So you need the visuals, eh? Lazy generation..  [SMILEY :P]  Anyway, now you don't have an excuse any more.  [SMILEY ;)]
(L) [2012/05/08] [ost by adh] [Pixel filters with negative weights - is there a solution?] Wayback!

We encountered this issue in modo when we added support for Mitchell-Netravali and Catmull-Rom filters.  But even if you don't use a filter with negative weights, you can still end up with jaggies along the sharp edges of very bright objects, since the edge pixels are antialiased in a high dynamic range sense but not when viewed on a low dynamic range monitor.

The main solution we offer for both problems is an option to clamp individual sample values (with a user-adjustable upper limit) before filtering.  This works great as long as you don't need to change the exposure setting very much after the render.  Another option is to add a bloom effect, essentially spreading out pixel values that are brighter than a user-adjustable threshold, thus softening the harsh edges.
(L) [2012/05/08] [ost by spectral] [Pixel filters with negative weights - is there a solution?] Wayback!

Which filter do you use ? Maybe some code too ?
I don't remember but I can check....
(L) [2012/05/08] [ost by Dade] [Pixel filters with negative weights - is there a solution?] Wayback!

>> spectral wrote:Which filter do you use ? Maybe some code too ?
I don't remember but I can check....
I guess a Mitchell filter, the light black halo is a very common problem with this kind of filter. Jeanphi added to LuxRender a "Supersampling" option in order to alleviate the problem. I don't remember exactly how the "Supersampling" option is implemented but the sources are available here:

[LINK http://src.luxrender.net/lux/file/f92f2202d1c4/filters/mitchell.h]
[LINK http://src.luxrender.net/lux/file/f92f2202d1c4/filters/mitchell.cpp]
(L) [2012/05/08] [ost by spectral] [Pixel filters with negative weights - is there a solution?] Wayback!

Why not rejecting the sample ?
(L) [2012/05/08] [ost by spectral] [Pixel filters with negative weights - is there a solution?] Wayback!

Have you try theses ones :

[LINK http://renderspud.blogspot.com/2011/01/metropolis-light-transport-mlt-fixed.html]
[LINK http://www.hackchina.com/en/r/149042/MitchellFilter.java__html]
(L) [2012/05/08] [ost by ingenious] [Pixel filters with negative weights - is there a solution?] Wayback!

Thanks for the many replies! So there are two problems with the bright image spots indeed - the pixel aliasing and the negative pixel values resulting from negative-weight filtering. As far as I know, the first one is best fought against via rendering in a higher resolution, tone mapping and then scaling down the image. This has been discussed in the old OMPF forum. I was asking about the second problem: What's the best known way to avoid these ugly black halos around light sources when using a negative-weight filter? Which particular filter is used, e.g. Mitchel ot Lanszos, shouldn't matter much - as long as it has negative weights, the problem will occur.
 >> Dade wrote:I guess a Mitchell filter, the light black halo is a very common problem with this kind of filter. Jeanphi added to LuxRender a "Supersampling" option in order to alleviate the problem. I don't remember exactly how the "Supersampling" option is implemented but the sources are available...
Hm, looks like some black magic [SMILEY :)] Will have to ask on the Lux forum. Do you have any experience with this mod? Does it help with the black halos, while still preserving the sharpness advantages of the filter?
(L) [2012/05/08] [ost by spectral] [Pixel filters with negative weights - is there a solution?] Wayback!

Have you try to "reject" the sample, instead of clamping the color ?

Honnestly I don't understand the meaning of a negative weight !

back