[Radiance-general] Deterministic calculations with Radiance

Gregory J. Ward gregoryjward at gmail.com
Thu Feb 3 15:53:14 CET 2005


Say you are tracing your 10,000,000 rays to generate a test image that 
you hope to compare to the official result for Radiance 3.6.1.  
Somewhere in the middle of your image (more likely the beginning), you 
hit some surface deep in the ray tree after 4 or 5 reflections, and 
Radiance makes the following test:

	if (r->rweight < minweight)
		return(0);			/* don't trace this ray */

where minweight is set by the -lw option to rpict.  Well, it just so 
happens that r->rweight is almost exactly equal to minweight at this 
point in the calculation.  On one machine, the statement will evaluate 
to true, and on another machine architecture, it evaluates to false.  
Big deal.  You've just altered the result by maybe 1e-3, which is 
within the tolerance of your image comparison metric.

However, since you've decided not to trace that ray and all the rays 
that spawn from it, let's say that's 12 calls to random() that you 
won't be making during this rendering.  (It doesn't matter how many 
calls it is you miss -- one is enough.)  All your subsequent calls to 
random() will therefore be completely different from what they were on 
that other machine, even using the exact same implementation of 
random().

How likely is the above scenario?  Nearly 100%, because in 10,000,000 
rays you are bound to find some threshold test somewhere in the code 
that can go one way or another.  Setting -lw 0 is only a partial 
solution, because there are other floating point tests and thresholds 
that can't be altered or avoided within the code.  Welcome to the 
vaguaries of floating-point calculations.

-Greg

> From: Christopher Kings-Lynne <chriskl at familyhealth.com.au>
> Date: February 3, 2005 2:20:25 AM PST
>
> Hmmm, I guess I still don't quite get it...
>
> You are using many calls to random() or something.  If you srandom a 
> certain seed, why is it not possible to get the same output every 
> time?
>
> Sorry...
>
> Chris




More information about the Radiance-general mailing list