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:17:30 EDT (-0400)
  Re: 99 lines of C++ for an unbiased ray tracer  
From: Invisible
Date: 14 Jan 2010 09:01:09
Message: <4b4f23a5$1@news.povray.org>
>>> if (++depth>5) {if (erand48(Xi)<p) f=f*(1/p); else return obj.e;}
>>
>> Ouch. This isn't going to be pretty...
> 
> What do you mean?

I mean implementing this in a language where the else-part is 
*mandatory* for all if-blocks makes this slightly tricky to do. (But not 
as tricky as I thought; I've found a clean way to do it.)

>> However, "f" is the object colour, and I have 
>> absolutely no idea why it's being scaled by the reciprocol of the 
>> brightest component...
> 
> I think that it's the part that makes the method unbiased. You have to 
> scale the rays that you keep in order to account for the fact that you 
> don't keep them all, or something like that.

Well, we'll see I guess...


Post a reply to this message

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