Community
Arnold General Rendering Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How does the total ray depth setting work?

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
jhsu8888
1885 Views, 9 Replies

How does the total ray depth setting work?

In the help files it says "Diffuse + Transmission + Specular <= Total"

https://docs.arnoldrenderer.com/display/A5AFMUG/Ray+Depth

For example if I have ray depths set to Diffuse: 4, Transmission: 4, Specular: 4, Total: 10

4 + 4 + 4 = 12

I'm assuming that means 2 ray bounces get cut somewhere so that the total will equal 10? How is that determined? Will the scene be rendered at a diff:trans:spec ratio of 3:3:4 or 4:3:3 or 3:4:3 or something like that?

Tags (1)
Labels (1)
9 REPLIES 9
Message 2 of 10
Stephen.Blair
in reply to: jhsu8888

ray_depth is per ray, so it will depend on the path of the ray through the scene.



// Stephen Blair
// Arnold Renderer Support
Message 3 of 10
jhsu8888
in reply to: jhsu8888

@Stephen Blair This is not really helpful and doesn't explain anything. You basically just said it depends.

Do I understand correctly that setting the total ray depth determines some kind of overall threshold? How is it implemented? What's the algorithm? What's the process, the method, the idea behind how it limits ray depth?

Maybe try another example, if I set Diffuse: 4, Transmission: 4, Specular: 4, Total: 2, what happens there? Will there be 1 diffuse bounce and 1 transmission bounce and then no specular? Or 2 specular bounces and no diffuse or transmission rays?

If it depends, what does it depend on? Is there some kind of priority value given to those parameters? If there is a priority what is it? Do diffuse rays have higher priority than transmission? Or is there some other priority system for how ray bounces are evaluated?

Maybe this whole model I'm describing is incorrect and there is some way to evenly distribute ray bounces in fractions. Is it possible the render engine does something like evaluate 2/3 depth to diffuse, specular and transmission equally? I have no clue and the documentation doesn't explain it at all.

Message 4 of 10
maxtarpini
in reply to: jhsu8888

There isn’t too much to explain. There isn’t any algorithm or heuristic o whatever .. it depends on your scene (and also how generally things are traced). If you’re tracing a ray that goes through 4 layers of glass and hit a reflective surface where it can bounce further and let’s say you have a total trace depth of 5 you sure in any case already consumed 4 ray interactions and only 1 is left for reflections. If from the same camera a different ray hits first another reflective surface where it needs 2 bounces before hitting the gllass then you have left only 3 interactions and you won’t make it through the 4 layers of glass.

Message 5 of 10
jhsu8888
in reply to: jhsu8888

@Max Tarpini Okay this is a much better explanation, if I understand you correctly you are saying that the way the process works is dependent on the order in which any given ray hits a material. So if a single ray hits a diffuse surface first, it subtracts 1 from diffuse and 1 from the total, then if it hits a specular it subtracts 1 from specular and 1 from the total.

I appreciate greatly your explanation, but I would also like to point out what you are describing is in fact an order of operation, which is basically an algorithm.

I also respectfully disagree with the statement that there isn't too much to explain, because I didn't understand it until you explained it.

One more detail, if the number of bounces is subtracted from the total by order of what component the ray comes into contact first, if there is a material that has some transmission, some diffuse and some specular, and there is only 1 ray bounce left in the total, what uses up that last bounce?

I think they should take the time to explain it in the manual.

Thanks!

Message 6 of 10
maxtarpini
in reply to: jhsu8888

I was going to add exactly that question .. and it's the one for you ! Meaning it's implementation defined .. you can only test it yourself and see how it behaves.

Message 7 of 10
jhsu8888
in reply to: maxtarpini

Working on it, will post back when I have results!

Message 8 of 10
ben.fischler
in reply to: jhsu8888

@Jautodesk Hsu, regarding explanations of sampling in the Arnold documentation, I think this is a good place to start, hopefully it is helpful to you: https://docs.arnoldrenderer.com/pages/viewpage.action?pageId=40111301

Message 9 of 10
jhsu8888
in reply to: ben.fischler

@Ben Fischler Thanks for the input, I actually did read through it already. I was asking about ray depth and trying to understand exactly what the ray depth total does.

If you look at the manual for ray depth

https://docs.arnoldrenderer.com/display/A5AFMUG/Ray+Depth

It only provides this one sentence for the 'Total' setting:

"Specifies the total maximum recursion depth of any ray in the scene (Diffuse + Transmission + Specular <= Total)."

Which wasn't very clear to me.

Message 10 of 10
jhsu8888
in reply to: jhsu8888

After doing some experimenting, I realize the description in the documentation is misleading. It makes it sound like each individual channel is added together to determine the Total, but from what I have found the Total is more like a Max Threshold per channel.

Here are some test renders:

2593-ray-depth-total-6.jpg

2594-ray-depth-total-4.jpg

2595-ray-depth-total-2.jpg

At a Total of 2 you would expect there to be no bounces left over for Specular and Transmission because Diffuse would have already taken 2 bounces, rather it appears Arnold is giving 2 bounce per channel.

2597-ray-depth-comparison.jpg

In the comparison above, the Total Ray Depth is the same (Total-Diffuse-Specular-Transmission) but you would expect when the Diffuse and Transmission are set to 1, that would allow more bounces in the Specular, but as you can see in the reflections the bounces remain at 4 for both renders.

As far as I understand everyones' explanation was wrong and Total Ray Depth is actually a per channel max, not a sum total of the channels.

Which makes sense if you want to globally dial the max per channel down during preview rendering as a threshold, and then remove the threshold during final renders.

What Arnold is NOT doing, is counting ray bounces between channels, therefore it doesn't have to prioritize between Specular and Diffuse for example when it "runs out of bounces" as the description "Diffuse + Transmission + Specular <= Total" would suggest.

Ultimately I think the word "Total", and the description in the documentation are misleading. I would suggest using the word "Max" instead, and describe it as a threshold that limits each channel to the Max number of bounces.

If anybody thinks I have it wrong please let me know.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report