Anti aliasing question, advices, councils...

Practical and theoretical implementation discussion.
spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

Anti aliasing question, advices, councils...

Post by spectral » Tue May 29, 2012 1:04 pm

Dear OMPF community,

I'm currently looking at some 'advanced' information regarding anti-aliasing problems we can face in a path tracer.
For now, I'm using a gaussian filter but does not feel satisfied with the result !

By example, if you take a look at the following image you will see some hard-egdes (too hard !!! even if hard edges are sometimes necessary).
rs8-antialiasing.png
rs8-antialiasing.png (698.14 KiB) Viewed 6537 times
I have see some peoples talking about rendering in a higher resolution, apply a triangle filter, tone-map then apply a box filter ! Of course, I have to try !
But maybe there are more advanced method... in fact I haven't found any new "research" about this subject (except in the game community) !

So, if you have some information, you're welcome

Thanks
Spectral
OMPF 2 global moderator

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

Re: Anti aliasing question, advices, councils...

Post by ingenious » Tue May 29, 2012 1:58 pm

The best solution I know is to perform filtering after tone mapping. This means that you should render in a higher resolution, tone-map the resulting image, and then scale down to obtain an anti-aliased result. This doesn't necessarily mean that the rendering has to become more expensive, due to the increased resolution. In fact, you can encapsulate this whole process in your frame buffer, where you store sub-pixel averages during rendering, and then tone map, scale down and spit out the result. However, this doesn't work when you want to output HDR images, since for them you don't do tone mapping. So I'd recommend to have two resolutions - one for rendering (used e.g. by camera, pixel sampler) and one for output. The frame buffer will be aware of both resolutions.

I'm interested how production renderers do it. And what filters should be used for the sub-pixel averaging and for the down-scaling afterwards.
Image Click here. You'll thank me later.

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

Re: Anti aliasing question, advices, councils...

Post by spectral » Tue May 29, 2012 2:50 pm

Thanks,

But what can I do when I have to output HDR... does applying a triangle filter on for each sub-pixel then a box-filter for the pixel will help too ?
Spectral
OMPF 2 global moderator

Geri
Posts: 146
Joined: Fri Mar 02, 2012 7:01 pm

Re: Anti aliasing question, advices, councils...

Post by Geri » Tue May 29, 2012 3:00 pm

a simple post process edge blur will do the trick.
Csontos kezünkbe a nyomor
Ezer év rúnáit véste

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

Re: Anti aliasing question, advices, councils...

Post by ingenious » Tue May 29, 2012 3:15 pm

spectral wrote:But what can I do when I have to output HDR... does applying a triangle filter on for each sub-pixel then a box-filter for the pixel will help too ?
Well, before you display the HDR image, you first tone-map and then down-scale. I'm not sure you can fix the problem in HDR robustly without introducing artifacts.
Geri wrote:a simple post process edge blur will do the trick.
On the tone-mapped image you mean? This could work, but depending on the filter and the tone mapping operator of course, it could be more expensive and less accurate then rendering in higher resolution and and down-scaling after tone mapping.
Image Click here. You'll thank me later.

Serendipity
Posts: 37
Joined: Mon Dec 19, 2011 9:50 pm

Re: Anti aliasing question, advices, councils...

Post by Serendipity » Tue May 29, 2012 3:18 pm

Geri wrote:a simple post process edge blur will do the trick.
I second that, especially since a real camera is sort of doing the same.
Also rendering large resolutions and scaling them down becomes very unusable once you want to render out 30k or higher print resolutions. And last but not least: There are HDR-Monitors out there as well....

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

Re: Anti aliasing question, advices, councils...

Post by spectral » Wed May 30, 2012 10:49 am

Thanks for all your answers,

I have do a try with the sub-pixel methods, but it seems that it produce exactly the same image !!!!

Here is what I do :
- The accumulation buffer is now an array of 3x3
- When I compute irradiance, I weight it with a triangle filter (based on the sub-pixel cell coordinate) and put it in the array (and accumulate the weight in weight)
- When I need to display, I do a simple average (box filter) of all the cells ! ie . p = (cell[1]+...+cel[9])/(weight[1]+...weight[9])

Also, on the GPU, due to slow memory access my rendering is 4x slower :-(
Spectral
OMPF 2 global moderator

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

Re: Anti aliasing question, advices, councils...

Post by ingenious » Wed May 30, 2012 11:40 am

And where in this pipeline do you perform tone mapping?
Image Click here. You'll thank me later.

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

Re: Anti aliasing question, advices, councils...

Post by spectral » Wed May 30, 2012 11:48 am

Just after ! I don't tone map each cell of the 3x3 grid !
Spectral
OMPF 2 global moderator

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

Re: Anti aliasing question, advices, councils...

Post by ingenious » Wed May 30, 2012 11:49 am

And what did we discuss above? :)
Image Click here. You'll thank me later.

Post Reply