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:19:39 EDT (-0400)
  Re: 99 lines of C++ for an unbiased ray tracer  
From: Vincent Le Chevalier
Date: 14 Jan 2010 08:14:58
Message: <4b4f18d2$1@news.povray.org>
Invisible wrote:
> I can't decide which "if" the "else" belongs to. o_O

The else always belongs to the closest if at the same scope level... 
Which means it's:
if (++depth>5) {if (erand48(Xi)<p) f=f*(1/p); else return obj.e;}

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...

-- 
Vincent


Post a reply to this message

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