Pixel filters with negative weights - is there a solution?

Practical and theoretical implementation discussion.
ingenious
Posts: 282
Joined: Mon Nov 28, 2011 11:11 pm
Location: London, UK
Contact:

Pixel filters with negative weights - is there a solution?

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
Attachments
gama_decor_millenium_sanitary_07_06_10.jpg (85.73 KiB) Viewed 7355 times
gama_decor_newyork_negromax_sanitary_07_06_10.jpg (133.02 KiB) Viewed 7355 times

davepermen
Posts: 48
Joined: Fri Dec 02, 2011 12:21 pm

Re: Pixel filters with negative weights - is there a solutio

looking at the pictures, I see a much bigger problem: I don't see the pictures.

ingenious
Posts: 282
Joined: Mon Nov 28, 2011 11:11 pm
Location: London, UK
Contact:

Re: Pixel filters with negative weights - is there a solutio

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.. Anyway, now you don't have an excuse any more.

Posts: 1
Joined: Thu May 03, 2012 8:05 pm

Re: Pixel filters with negative weights - is there a solutio

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.

spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

Re: Pixel filters with negative weights - is there a solutio

Which filter do you use ? Maybe some code too ?
I don't remember but I can check....
Spectral
OMPF 2 global moderator

Posts: 206
Joined: Fri Dec 02, 2011 8:00 am

Re: Pixel filters with negative weights - is there a solutio

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:

http://src.luxrender.net/lux/file/f92f2 ... mitchell.h
http://src.luxrender.net/lux/file/f92f2 ... tchell.cpp

spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

Re: Pixel filters with negative weights - is there a solutio

Why not rejecting the sample ?
Spectral
OMPF 2 global moderator

spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

Re: Pixel filters with negative weights - is there a solutio

Spectral
OMPF 2 global moderator

ingenious
Posts: 282
Joined: Mon Nov 28, 2011 11:11 pm
Location: London, UK
Contact:

Re: Pixel filters with negative weights - is there a solutio

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 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?