POV-Ray : Newsgroups : povray.off-topic : 99 lines of C++ for an unbiased ray tracer : Re: 99 lines of C++ for an unbiased ray tracer Server Time
4 Sep 2024 21:23:38 EDT (-0400)
  Re: 99 lines of C++ for an unbiased ray tracer  
From: Invisible
Date: 14 Jan 2010 08:27:24
Message: <4b4f1bbc$1@news.povray.org>
Vincent Le Chevalier wrote:

> if (++depth>5) {if (erand48(Xi)<p) f=f*(1/p); else return obj.e;}

Ouch. This isn't going to be pretty...

> I think it's part of the Russian Roulette method (which is what the 
> comment R.R. stands for I suppose). I don't remember the details but you 
> can probably look it up by yourself...

Clearly it flips a coin to decide whether to process further [all of the 
code paths beyond this point involve sending out a new ray] or just stop 
here. However, "f" is the object colour, and I have absolutely no idea 
why it's being scaled by the reciprocol of the brightest component...


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.