Author Topic: Path tracing samples VS passes  (Read 14109 times)

2013-10-17, 20:38:19

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 8612
  • Marcin
    • View Profile
In Corona, when using using pt+pt or pt+hd, you have two main parameters responsible for image quality: "path tracing samples" and "passes". Generally, we can say that total number of samples used to render each pixel is PTS*passes. We know that each pass consists of sending a primary ray and then calculating secondary rays. That's why rendering an image with such settings: PTS: 100, passes: 1 will be faster than rendering an image like this: PTS: 1, passes: 100. Probably there won't be much difference in GI noise because number of used samples will be the same (100) but there will be significant difference in quality of geometry edges, thin lines, textures, generally antialiasing. So passes work basically like supersampling in conventional renderers. Each pixel is sampled with and averaged, this works like "subdividing" a pixel X times and averaging the output. So here is my question: does it make sense to render a final image with more than 16-32 passes? I know it depends on what kind of scene you have and what resolution you are rendering at. But generally, isn't rendering with 100 or more passes an overkill? The less passes you use, the faster the rendering will finish with the same GI quality, right? We want as little passes as possible. So here is my workflow:

1. I saved the HD cache solution to have the same results all the time. Then I determined (more or less, this is just a test ;) ) how many samples are required to render the GI noiseless - I set passes to 1 and increased PTS until the noise was acceptable. This time I decided it was 2048, but  it would really require even more.

2048 PTS x 1 PASS - time: 21:31:


2. Ok, so total 2048 samples are required to render nice cleanGI. Now - how much pixel subdivision is required for noisy edges to look nice? I did some test while still maintaining 2048 total samples. I increased passes (2, 4, 8, etc) and divided PTS by them (2048/2=1024, 2048/4=512, 2048/8=256 etc) so the GI quality was the same and antialiasing better. I found out that 16 passes are enough for very thin elements to look ok:

128 PTS x 16 passes - time: 24:40:


So in this case this is the optimal value. Increasing passes and decreasing PTS wouldn't increase quality, only time.

You can see that rendering the same image with 16PTS x 128 passes produces a very similar result but takes more time to render:

16 PTS x 128 passes - time: 28:50:


Hope it makes sense and maybe clarifies some Corona settings to new users.
Of course I encourage everybody to argue with me, shout at me and even disagree. ;)

2013-10-17, 20:57:44
Reply #1

DeadClown

  • Global Moderator
  • Active Users
  • ****
  • Posts: 1435
    • View Profile
    • racoon-artworks
Yes, it's pretty much the way I do my renderings.

Btw, you can easily explain it when you compare it to vray...
Let's say you used to render your images with 1:10 min:max adaptive DMC image sampler. Now you just need to do the square of your max dmc to have the "maximum passes rendered" in vray 10^2 = 100 passes), the maximum amount of eye-rays Vray will do to render your image. Now imagine that the brute force subdivision, reflection subdivisions and light sudivisions are divided by the number of max DMC subdivs and work as multipliers just like it is in corona (it's not that way in reality but pretty similar). If you set a maximum of 100 passes you will just have to calculate your sampling-multipliers for lt and pt the way you did it. Less wasting time for unnecessary AA, more time for gi and light sampling :)
Any sufficiently advanced bug is indistinguishable from a feature.

2013-10-17, 20:58:57
Reply #2

Juraj Talcik

  • Active Users
  • **
  • Posts: 3425
  • Tinkering away
    • View Profile
    • studio website
This thing was quite dilemma for me. Now, for average picture I do, with no DOF I set the PT samples at 32 but it easily goes over 100 passes eventually. Now you made me double think if I should not consider raising the PT even higher (64) if I have enough space for long renders (I do, as each picture renders full night) in some occasions, as it's really just GI that needs to clear out in my scenes, not AA.

Do you guys think it's worth adjusting Light Samples concerning pure HDR lighting inside Environment slot ? Only IBL for scene.
« Last Edit: 2013-10-17, 21:10:15 by Juraj_Talcik »
talcikdemovicova.com  Website and blog
be.net/jurajtalcik    My Behance portfolio
lysfaere.com   Something new

2013-10-17, 21:18:07
Reply #3

DeadClown

  • Global Moderator
  • Active Users
  • ****
  • Posts: 1435
    • View Profile
    • racoon-artworks
Btw, I found the balance between lights multiplier and pt samples way more important than passes vs. sampling level (especially for interiors with hdcache), That's one of the reasons why I was begging for separate lighting and gi render elements - to be able to see each of them ;)

I have some scenes where it's necessary to set both pt and lt samples to equal values around 20 or more to get a good balance of both elements. It's actually pretty simple: if you have a lot small windows it can be way more complicated to calculate direct light (bright sky, hdri, ...) than the actual GI with pt+hdcache. Both types are shooting rays without bounces; lt at lightsources and environment and pt at the geometry which is mapped with the hdcache. So, sometimes, it's way harder to render the direct lighting than the gi and that should be taken into account when you set your lt/pt values.

[Edit] Hahaha, Juraj_Talcik, that's timing ;)
Any sufficiently advanced bug is indistinguishable from a feature.

2013-10-17, 21:22:12
Reply #4

VadoZe

  • Active Users
  • **
  • Posts: 30
    • View Profile
So as DeadClown said: Passes are analogue of Vray DMC image samples, and PT samples - VRay material subdivs?
Means Passes response for AA, MBlur, DOF, and PTs - noise!
!Do your Best!

2013-10-17, 21:27:06
Reply #5

Juraj Talcik

  • Active Users
  • **
  • Posts: 3425
  • Tinkering away
    • View Profile
    • studio website
I see, thanks for insight DeadClown ! The Light samples is something I struggle to evaluate properly, even with tests, I sometimes see very little difference to judge.
How do unbiased renderes (like Maxwell), go around this ? What is the universal solution ? I just kept it at default 2 so far, and had no trouble, but I rarely use artificial lighting.
talcikdemovicova.com  Website and blog
be.net/jurajtalcik    My Behance portfolio
lysfaere.com   Something new

2013-10-17, 21:29:53
Reply #6

DeadClown

  • Global Moderator
  • Active Users
  • ****
  • Posts: 1435
    • View Profile
    • racoon-artworks
So as DeadClown said: Passes are analogue of Vray DMC image samples, and PT samples - VRay material subdivs?
Means Passes response for AA, MBlur, DOF, and PTs - noise!

You can't compare it "directly" since Vray is more complicated than Corona in that sense.
You just have a lighting multiplier and a pathtracing multiplier in corona. Lighting = everything actually illuminating the scene (lightsources, environment map, ...) and pathtracing = Global illumination, light bouncing from objects.

You don't have "separate" subdivisions like vray for reflections or lightsources - corona actually has "reflections from lighting" and "reflections from GI" (which you can see if you check the render elements, you have have both separately).

The rest - the passes - are just the number of times an eye ray (sample from the camera shooting through the pixel into the scene) is shot per pixel. If you render 100 passes in corona it is the same thing as rendering 10 subdivisions with Vray's fixed image sampler
« Last Edit: 2013-10-17, 21:36:50 by DeadClown »
Any sufficiently advanced bug is indistinguishable from a feature.

2013-10-17, 21:34:52
Reply #7

DeadClown

  • Global Moderator
  • Active Users
  • ****
  • Posts: 1435
    • View Profile
    • racoon-artworks
I see, thanks for insight DeadClown ! The Light samples is something I struggle to evaluate properly, even with tests, I sometimes see very little difference to judge.
How do unbiased renderes (like Maxwell), go around this ? What is the universal solution ? I just kept it at default 2 so far, and had no trouble, but I rarely use artificial lighting.

If you don't see any difference you should leave it as it is :) It's just a good idea to check the direct lighting render element if you got some noise in the scene which is not clearing up - it might be direct light noise not GI noise. If your light is coming through big windows or you're doing an exterior it's likely that 2 subdivisions are completely sufficient.

Unfortunately I don't know how maxwell does it, but small openings are a problem for them too (I talked to a next limit guy about that ;) ) . Btw, Corona "can" be unbiased too if you want it, just render pt+pt and set msi to 0 ;)
Any sufficiently advanced bug is indistinguishable from a feature.

2013-10-17, 21:54:12
Reply #8

Juraj Talcik

  • Active Users
  • **
  • Posts: 3425
  • Tinkering away
    • View Profile
    • studio website
I see, thanks for insight DeadClown ! The Light samples is something I struggle to evaluate properly, even with tests, I sometimes see very little difference to judge.
How do unbiased renderes (like Maxwell), go around this ? What is the universal solution ? I just kept it at default 2 so far, and had no trouble, but I rarely use artificial lighting.


Btw, Corona "can" be unbiased too if you want it, just render pt+pt and set msi to 0 ;)

True, Keymaster told me that half a year ago but I got to use it just few times :- ). But once I do that, I can still set PT and Light Samples, which is what differentiates it heavily from classic unbiased packages, which (to my knowledge only...atleast Maxwell) don't let you do, so I wondered what do they use internally presumably ? This leads me to thought, that there must be certain "pretty" universal settings, that foremost works for most scenarios. And where would this value be in Corona concerning Pt and Lt samples.

Because I know there are "tinkerers" (and tinker-experts, like you :- ) ..) who like to adjust settings, but I would wager to say, 98perc. of people including me, do not. So as long as there is "stupid-proof" settings, that will work out "eventually" any "not too unusual" scene, I am all for it. Eventually, there could be some default presets later on with Corona, even Vray3.0 will have that, albeit rought, but I welcome that.

While the idea of comparing GI vs Directlight might be logical and flexible, it feels unnatural to me as need to make changes that have consequence against each other. Sliding bars high (Vray, Arnold,etc..) or keeping it high (Maxwell,etc.) is something my simple mind goes around more easily.
« Last Edit: 2013-10-17, 22:05:29 by Juraj_Talcik »
talcikdemovicova.com  Website and blog
be.net/jurajtalcik    My Behance portfolio
lysfaere.com   Something new

2013-10-17, 22:10:19
Reply #9

DeadClown

  • Global Moderator
  • Active Users
  • ****
  • Posts: 1435
    • View Profile
    • racoon-artworks
Because I know there are "tinkerers" (and tinker-experts, like you :- ) ..) who like to adjust settings, but I would wager to say, 98perc. of people including me, do not. So as long as there is "stupid-proof" settings, that will work out "eventually" any "not too unusual" scene, I am all for it. Eventually, there could be some default presets later on with Corona, even Vray3.0 will have that, albeit rought, but I welcome that.

Actually this whole thread is just about optimizing and "getting the best quality/time ratio". For most of the people here (and I share your opinion about the 98%) the defaults work pretty well - they may not be the fastest settings but they work. You don't need to change anything if you're happy with your results after some hours rendering.
The problem is that it's a lot more difficult to render animations with corona, and if you want to render some hundreds of frames you want to get the best rendertimes possible. I agree that it might be useful to create exterior and interior presets in the future (like, exterior, interior (small windows), interior (open and bright)).
Any sufficiently advanced bug is indistinguishable from a feature.

2013-10-17, 22:14:05
Reply #10

Juraj Talcik

  • Active Users
  • **
  • Posts: 3425
  • Tinkering away
    • View Profile
    • studio website
Yea, sorry, I get sidetracked easily :- ) Not much of a concentrated person..

The animation is my current dilemma, I got so spoiled with Corona, I even feel slightly negative opening Vray at the moment, which is funny, because I always laugh at people who get emotionally attached to anything.
talcikdemovicova.com  Website and blog
be.net/jurajtalcik    My Behance portfolio
lysfaere.com   Something new

2013-10-17, 22:34:29
Reply #11

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 8612
  • Marcin
    • View Profile
It's late and my brain is on stand-by so I won't be able to answer to every post here but I just wanted to write that setting LSM to 1,0 usually pays off because in the same time given same amount of samples will be devoted to direct light and GI. When you raise LSM you make GI refine slower.

Raising LSM would be very useful if adaptivity worked efficiently - instead of checking neighbouring pixels' colour difference it would have to check pixel colour difference between given amount of passes - then after only a few passes, if there are no differences, direct light areas wouldn't be rendered at all and more cpu power would be devoted to GI. At least I think so.

I'd also like to see adaptivity in progressive mode working like in bucket mode - that some pixels are NOT RENDERED AT ALL if the threshold is fulfilled.

I got so spoiled with Corona, I even feel slightly negative opening Vray at the moment, which is funny, because I always laugh at people who get emotionally attached to anything.
Yeah, Corona is so adorable. Last time I had this with Brazil but it was some 10 years ago so I bet it was just a crush.

2013-10-17, 22:36:44
Reply #12

VadoZe

  • Active Users
  • **
  • Posts: 30
    • View Profile
Thank You, Maru) Your examples helps me a lot now!!!!
!Do your Best!

2013-10-17, 22:40:16
Reply #13

DeadClown

  • Global Moderator
  • Active Users
  • ****
  • Posts: 1435
    • View Profile
    • racoon-artworks
Yea, sorry, I get sidetracked easily :- ) Not much of a concentrated person..

The animation is my current dilemma, I got so spoiled with Corona, I even feel slightly negative opening Vray at the moment, which is funny, because I always laugh at people who get emotionally attached to anything.

No worries :D I'm not very concentrated either, but I know that most of the corona users here do not want to get in touch with the settings too much and those people might get a little bit nervous when they have a look at this thread ;)

The problem with people getting emotionally attached to something is the lack of objectivity - which is the problem of the majority of Vray fanboys :P I like Vray, and I still use it every day (at work), but I'm a very goal-oriented guy and if something can do specific jobs better I use it. Currently Corona is not able to fulfill all the requirements so I have to use Vray for most of my non-private stuff.


It's late and my brain is on stand-by so I won't be able to answer to every post here but I just wanted to write that setting LSM to 1,0 usually pays off because in the same time given same amount of samples will be devoted to direct light and GI. When you raise LSM you make GI refine slower.

That may be true for most of the exteriors and product shots without much shadow casting but may be fatal in interiors - it depends, as I wrote some posts earlier.
« Last Edit: 2013-10-17, 22:48:02 by DeadClown »
Any sufficiently advanced bug is indistinguishable from a feature.

2013-10-17, 22:46:50
Reply #14

rafpug

  • Active Users
  • **
  • Posts: 721
    • View Profile
magical maru  ^__^