PDA

View Full Version : Improvements for the efficiency of Adaptive AA in LW 11.x +



Thomas Helzle
05-26-2013, 09:32 AM
Hey,

I just answered to a thread about best render settings and found myself typing a wish for the AAA that should better go here:


I am not really convinced by the new adaptive sampling approach in LW 11.x.
While LW 9/10 introduced a form of adaptive rendering that was very hard to understand and control, it had one point going for it that the new one is missing IMO: It did multiple passes at once after each contrast test AFAIK.
The new AAA does test the contrast after each and every pass, which is very wasteful in my opinion or at least could use another optional setting.

Why?
Contrasty regions in most situations don't change that fast, what needs refinement after 5 passes usually needs still refinement after 6, so it is my impression that the new AAA is actually way too fine grained, while the older version did more sub-passes before testing for contrast again.
What I refer to is especially important in the DOF scenario: you can easily end up needing 1024 or more passes for the max AA setting and it is pretty much useless to check for contrast 1024 times. Instead, I think it would be great to have a kind of adaptive adaptiveness (AAAA TM ;-) ).

This is how AAAA (TM) could work: After the first pass (or min passes), contrast is tested. Then (at least) twice as much samples are rendered, then contrast test again, then twice as much samples again and so on. The reason behind this is, that it is my impression that a lot of time is wasted on those 1024 contrast tests where usually render engines can be optimized much better when more samples are shot at the same time, since you don't have to go through all pixels every time, and more data will be still in the cache (being more "local").

A setting could be introduced for the definition of the steps.
It would be interesting to see if it would make sense to make those a multiple of the min setting or leave it independent of it.
A setting of 1 could mean test after each pass, a setting of 2 test after 2, 4, 8, 16 etc.

The reason for this idea is, that AA is something that is changing less drastic the more samples are involved:
The first sample (if you only take one) defines a pixel 100%
The second sample makes that 50:50, the third 33:33:33, the fourth 25:25:25:25
If you take 1024 samples, one individual sample is down to adding 0.09765625% to the result or if you think in 0 to 1 terms, 0,0009765625 of the final pixel...
(This is way below meaningful contrast settings for adaptive AA!!! So the contrast CAN'T even change enough between those steps to make it worthwhile.)

So the higher the max samples is set, the less change each pass will create.
And while I welcome the basic idea of the new AAA, which is way more understandable and controllable than the LW 9.x/10.x one, I think it overshot it's goal by quite a margin.

Take for example Mental Ray (which I don't like but they have AAA nailed down pretty well IMO).
MR uses sampling in exponential steps, where 0 means one sample per pixel, 1 means 4, 2 means 16 and 3 means 64. Which is basically what I am talking about above. They know that the difference between 63 and 64 samples is completely meaningless in reality and their AAA is optimized for this kind of setup, so rays can be shot very efficiently and if I set max AA to 3, contrast is only tested 3 times.

For normal images I don't find this to be much of a problem, but when I tried some images with strong DOF and/or MB lately, I found it VERY hard to get smooth results, 1024 max samples wasn't enough but was very slow to render already, and I think this is related to all the contrast testing and it's drawbacks discussed above.
It is my impression that LW 9.6/10 did better in that case.

So I hope we will see some more development in this area.

Cheers and thanks a lot for considering this idea! :bowdown:

Tom

geo_n
05-26-2013, 10:27 AM
The AA and AS setting in lw is a bit hard to nail down for every situation. I usually use AA min5 max10, AS .03 for speed and quality ratio. But some people have success with low AA pass and cleaning it all up with AS. Or more AA pass with .07- .1 AS. Depends on the scene and needs testing for every scene which settings work.

In vray its common for people to use Adaptive DMC in most situations. Set the min max and thats it. Higher min max value equals high quality render but longer render time. There's less fiddling with image sampling settings like AA and AS.

Thomas Helzle
05-26-2013, 10:49 AM
Yeah, I used a lot of different render engines in my life, from Cinema 4Ds internal renderer to Mental Ray, Arnold, Vray, modos internal renderer, Fprime and all the LW versions since 5.5 (not counting all the unbiased and otherwise different render engines). Some of them have AA down pat, others make it relatively hard for the user.

But that isn't really my point here with this FR, but I would like to see the way AAA works being improved, which also should result in faster rendertimes.

In one sentence: Don't compare the contrast after each and every sampling step, that's a waste of time.

Cheers,

Tom

geo_n
05-26-2013, 11:21 AM
But isnt that more to do with AS than AA?

Thomas Helzle
05-26-2013, 11:31 AM
Call it whatever makes you happy ;-)

I call it Adaptive AA.

Cheers,

Tom

Elmar Moelzer
05-28-2013, 06:50 PM
I prefer the new setting. It gives you more fine control over the rendertimes. The noise check does not really cost any time anyway.

Thomas Helzle
05-29-2013, 07:25 AM
I prefer the new settings too.

Otherwise I'm happy to disagree with you ;-)

The noise check has an impact with the high maximum levels needed for strong DOF and simply makes zero sense.

Cheers,

Tom

vncnt
05-30-2013, 10:08 AM
I think itīs worth a try. Or at least as an option.

Oh, and another issue: if I provide a background image that has the exact size of the Camera frame size it shouldnīt be necessary (in most cases) to sample those images parts. That could speed-up the process too (without compositing in another program, generating more huge files).

Thomas Helzle
05-30-2013, 11:18 AM
Thanks vncnt! :-)

That is what I would think as well.
I simply can't imagine that doing thousands of contrast checks has NO impact at all, not to speak about more localized sampling vs. re-rendering the whole image area - I'm sure that could be used for further optimizations.

If my idea above doesn't provide an improvement or doesn't fit into the bigger concept, then at least it would be good to have a specific sampling factor for DOF and Motion Blur like for Shading and Lighting.

Cheers,

Tom