POV-Ray : Newsgroups : povray.beta-test : Isosurface cache bug Server Time
31 Oct 2024 16:16:38 EDT (-0400)
  Isosurface cache bug (Message 1 to 4 of 4)  
From: Lukas Winter
Subject: Isosurface cache bug
Date: 27 Feb 2008 14:23:34
Message: <47c5b8b6$1@news.povray.org>
Hello,
I have encountered a bug that causes random (but in a reproducable way) 
render blocks to "see through" through a reflective isosurface, when 
there is also a second isosurface in the scene. (A lot of preconditions) 
This is definitely not connected to a wrong max_gradient. When I 
commented out the code responsible for the isosurface caching, the 
isosurface rendered correctly. It seems as if povray thinks there was a 
cache hit, when there was actually none.
Test scene:

#include "colors.inc"
#include "functions.inc"

camera
{
  location <-.02,  .54,- .65>
  look_at  <-.07, 0   ,- .16>
}

#declare f_decocube=function(x,y,z,a,b){

   (pow(x*x+y*y-a*a,2)+pow(z*z-1,2))

  *(pow(y*y+z*z-a*a,2)+pow(x*x-1,2))

  *(pow(z*z+x*x-a*a,2)+pow(y*y-1,2))

  -b

}
isosurface
{

  function { f_decocube(x,y,z,0.95,0.011) }

  evaluate 194 * .25, 1.3, .8

  contained_by{sphere {0,1.5}}
  accuracy 0.001
  pigment { Blue }
  translate y*1.06
  scale .05
  translate <-.8, 0, .28>

}
isosurface
{
  function { f_sphere(x, y, z, 1) }
  contained_by { sphere { 0, 1.0001 } }
  max_gradient 1.322
  accuracy 0.004
  pigment { Red }
  finish { reflection 0.5 }
  scale .04
  rotate <-5, 0, 15>
  translate <-.4, .04, -.2>
}
light_source
{
  <-200, 103, 95> * 10000
  color <1, .95, .75> * 2.4
}


Post a reply to this message

From: Lukas Winter
Subject: Re: Isosurface cache bug
Date: 27 Feb 2008 14:49:41
Message: <47c5bed5@news.povray.org>
Proposed fix for this bug:
in isosurf.cpp:
line 297: remove "Thread->isosurfaceData->current = this;"
line 1047: add "itd.current = this;"


Post a reply to this message

From: Lukas Winter
Subject: Re: Isosurface cache bug
Date: 27 Feb 2008 14:56:32
Message: <47c5c070$1@news.povray.org>
The lines in my previous post are wrong. I don't know the correct line 
anymore, so I just post the context:

isosurface.cpp
"
    /* change the sign and go into the isosurface */
    }
  }
 
  //remove this line:
  //Thread->isosurfaceData->current = this;
  Thread->isosurfaceData->ctx = Thread->functionContext;

  for (; itrace < max_trace; itrace++)
  {
"
and later on:
"
else if(!in_shadow_test)
{
  itd.cache = true;
  VEvaluateRay(itd.Pglobal, PP, EP1.t, DD);
  VEvaluateRay(itd.Dglobal, PP, EP2.t, DD);
  //add this line:
  itd.current = this;
    
  return false;
}


Post a reply to this message

From: Chris Cason
Subject: Re: Isosurface cache bug
Date: 4 Mar 2008 05:45:14
Message: <47cd283a$1@news.povray.org>
Lukas Winter wrote:
> The lines in my previous post are wrong. I don't know the correct line 
> anymore, so I just post the context:
> 
> isosurface.cpp
> "
>     /* change the sign and go into the isosurface */
>     }
>   }
>  
>   //remove this line:
>   //Thread->isosurfaceData->current = this;
>   Thread->isosurfaceData->ctx = Thread->functionContext;
> 
>   for (; itrace < max_trace; itrace++)
>   {
> "
> and later on:
> "
> else if(!in_shadow_test)
> {
>   itd.cache = true;
>   VEvaluateRay(itd.Pglobal, PP, EP1.t, DD);
>   VEvaluateRay(itd.Dglobal, PP, EP2.t, DD);
>   //add this line:
>   itd.current = this;
>     
>   return false;
> }

Thanks for this (and good work in finding it!)

I've not looked at it closely but provided it has no unexpected side-
effects we'll apply the fix to the source.

regards,

-- Chris


Post a reply to this message

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