POV-Ray : Newsgroups : povray.general : max_trace_level and objects with ior=1 : Re: max_trace_level and objects with ior=1 Server Time
3 Aug 2024 04:18:28 EDT (-0400)
  Re: max_trace_level and objects with ior=1  
From: Christopher James Huff
Date: 24 May 2004 13:33:55
Message: <cjameshuff-37F73B.12342224052004@news.povray.org>
In article <40b1f367@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

>   Does it do that already? If yes, I don't understand why. POV-Ray only
> uses the closest intersection so why would it need to keep in memory
> all the intersections?

No, it doesn't keep all the intersections...that's the point: it 
currently throws them away when they could still be useful.


>   If no, then how would this kind of optimization affect memory consumption
> and speed? After all, a ray can intersect the scene in thousand and
> thousands of places...

Leading to a few thousand intersections, which really isn't that much 
memory. And that's if you don't limit the length of the list.
As for speed...the list can be built in logarithmic time. Repeatedly 
doing the intersection tests increases in quadratic time. For 10 
surfaces, the last surface is tested 10 times, the one before it 9 
times, the one before that 8...if they are all stored in a list, they 
are all tested once. And note that the list only has to go up to the 
first refracting or opaque intersection, any intersections past that can 
be thrown away immediately.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

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