## Russian roulette in a white cornell box

### Russian roulette in a white cornell box

Hi All,

I'm just experimenting some stuffs...

Imagine I have a 'closed' cornell box where all the materials are diffuse and white (reflectance = 1).

If I use a simple Russian Roulette, then the stop condition is : RND() > BSDF.Reflectance()

But the reflectance is 1 and so the RR will never stop the random walk ! At the end my path will be infinite !

Do you have a solution (I don't play with max-path-length) ?

Thx

I'm just experimenting some stuffs...

Imagine I have a 'closed' cornell box where all the materials are diffuse and white (reflectance = 1).

If I use a simple Russian Roulette, then the stop condition is : RND() > BSDF.Reflectance()

But the reflectance is 1 and so the RR will never stop the random walk ! At the end my path will be infinite !

Do you have a solution (I don't play with max-path-length) ?

Thx

**Spectral**

**OMPF 2 global moderator**

### Re: Russian roulette in a white cornell box

The solution is simple - make the scene physically plausible by putting materials with albedo less than one

And yes, you

And yes, you

*have*to have a max path length! What if your number generator goes crazy? What if you use some deterministic sequence that will always choose to continue the path, even if all materials have albedo in the open range (0.5, 0.9)? Has happened to me with Halton sequences!**Click here.**You'll thank me later.

### Re: Russian roulette in a white cornell box

Sure, the albedo has to be plausible

But does someone has an idea of the maximum value of "max-depth" that should be allowed ? 100 seems enough to me ! Not sure that I will face some scenes with more !

BTW, it seems to me that a default max-depth can be between 10 and 15, right ?

Thx

But does someone has an idea of the maximum value of "max-depth" that should be allowed ? 100 seems enough to me ! Not sure that I will face some scenes with more !

BTW, it seems to me that a default max-depth can be between 10 and 15, right ?

Thx

**Spectral**

**OMPF 2 global moderator**

### Re: Russian roulette in a white cornell box

It depends on the scene, of course. I think most people/renderers use max path length of about 25. But I'm not 100% sure. Anyone?

**Click here.**You'll thank me later.

### Re: Russian roulette in a white cornell box

I think I use 10000 (need to check again at home), mostly just to ensure that it'll stop bouncing at some point for anomalous paths (like ingenious mentioned this can happen with qmc). Then again, I'm a bit OCD with the correctness thing, I want to allow all sorts of path lengths. Btw, I haven't seen this impacting performance all that much.

@spectral

You can model your RR probabililties pretty much any way you want, just make sure that you weigh your paths correctly just as usual. You could base it on the luminance of the color, on the max component, the average , the accumulated path throughput or simply just use a constant termination probability that you start applying after a couple of bounces, like 0.5. Experiment! All these methods differ from each other and some of them produce more noise than others.

Btw, I remember someone doing a survey on different rr methods and posting the resulting images and error images but I can't seem to find it on google. I think the scene was two reflective spheres and a box, in a cornell box. Does anyone know where to find it or have the link? It was interesting because it also include the "Efficiency-optimized Russian roulette" method proposed by Veach.

@spectral

You can model your RR probabililties pretty much any way you want, just make sure that you weigh your paths correctly just as usual. You could base it on the luminance of the color, on the max component, the average , the accumulated path throughput or simply just use a constant termination probability that you start applying after a couple of bounces, like 0.5. Experiment! All these methods differ from each other and some of them produce more noise than others.

Btw, I remember someone doing a survey on different rr methods and posting the resulting images and error images but I can't seem to find it on google. I think the scene was two reflective spheres and a box, in a cornell box. Does anyone know where to find it or have the link? It was interesting because it also include the "Efficiency-optimized Russian roulette" method proposed by Veach.

### Re: Russian roulette in a white cornell box

Thanks

A question about SmallVCM, in the vertexcm.hxx line 775, you compute lightCont for the Russian Roulette.

You include this probability in the pdf wrt dA... and finally you compute the contribution.

But, is it enough to include the RR method and avoiding to trace too much shadow rays ?

Thx

A question about SmallVCM, in the vertexcm.hxx line 775, you compute lightCont for the Russian Roulette.

You include this probability in the pdf wrt dA... and finally you compute the contribution.

But, is it enough to include the RR method and avoiding to trace too much shadow rays ?

Thx

**Spectral**

**OMPF 2 global moderator**

### Re: Russian roulette in a white cornell box

I don't understand the connection you're making between the RR probability in the MIS weights and avoiding tracing shadow rays...

**Click here.**You'll thank me later.

### Re: Russian roulette in a white cornell box

Right, it has no relation with the shadow ray ! Sorry, I haven't read the code correctly

At first time I have think it was your implementation of "Reducing the number of shadow rays in bidirectional path tracing" : http://www.researchgate.net/publication ... th_Tracing

BTW: I don't talk about RR in case of a SSS material or volume rendering of course... theses are handled another way

At first time I have think it was your implementation of "Reducing the number of shadow rays in bidirectional path tracing" : http://www.researchgate.net/publication ... th_Tracing

BTW: I don't talk about RR in case of a SSS material or volume rendering of course... theses are handled another way

**Spectral**

**OMPF 2 global moderator**