POV-Ray : Newsgroups : povray.beta-test : Source 3.7 Beta 31, Linux 64 bits - Bounding optimisation and contained_by sphere : Re: Source 3.7 Beta 31, Linux 64 bits - Bounding optimisation andcontained= Server Time
5 Oct 2024 15:42:29 EDT (-0400)
  Re: Source 3.7 Beta 31, Linux 64 bits - Bounding optimisation andcontained=  
From: Le Forgeron
Date: 13 Apr 2009 14:28:06
Message: <49e38436$1@news.povray.org>
Le 13.03.2009 02:58, Chris Cason nous fit lire :
> clipka wrote:
>> Confirmed the error - and found the culprit!
>>
>> Chris, there is a bug in the IsoSurface::All_Intersections() implementation -
>> and possibly a misconception about the RefPool:
> 
> Good work!:)

As Beta 32 is still displaying the issue, I would suggest the following correction
(on Beta 32 sources):

Poping the entry added locally, and leaving the remaining untouched.
Tested with the problematic scene of this thread, looks ok.

Not done: checking all other All_Intersection method to find if some are also using
that
lazy shortcut of pushing intersection and returning false. Left as an exercise for the
good people.

Not an optimal patch, as an optimal patch would have avoided, with less instructions,
to
push an intersection to pop it a fraction of second later. Not sure such optimal patch
might exist.

diff -r da476cece3cc source/backend/shape/isosurf.cpp
--- a/source/backend/shape/isosurf.cpp  Mon Apr 13 14:10:46 2009 +0200
+++ b/source/backend/shape/isosurf.cpp  Mon Apr 13 20:16:48 2009 +0200
@@ -277,5 +277,11 @@
                tmin = Depth1 = min(Depth2, Depth1);
                if((tmax - tmin) < accuracy)
-                       return (false);
+                {
+                   if (IFound==true)
+                   {
+                      Depth_Stack->pop();
+                   }
+                   return (false);
+                }
                Thread->Stats[Ray_IsoSurface_Tests]++;
                if((Depth1 < accuracy) && (Thread->isosurfaceData->Inv3 == 1))


Post a reply to this message

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