POV-Ray : Newsgroups : povray.beta-test : isosurface problem Server Time
1 Nov 2024 15:24:56 EDT (-0400)
  isosurface problem (Message 1 to 9 of 9)  
From: Christoph Hormann
Subject: isosurface problem
Date: 13 Apr 2002 12:52:49
Message: <3CB8625F.DB538EDE@gmx.de>
There seems to be a serious difference in render results of the linux and
the windows version in some situations.  Linux behavior is wrong IMO.  

When rendering the following scene the lower half of the picture is filled
with the isosurface object in WinPov while i only get a stripe at the
horizon in the Linux version.  It is not related to insufficient
max_gradient, i also tried with higher values with the same results.

Beta 16 (Linux/Windows), Athlon 1 GHz, 512 Mb

// CODE begin

// -w640 -h360       
// -w320 -h180

#version 3.5; 
          
global_settings {     
   max_trace_level 5
   assumed_gamma 1.0 
   noise_generator 2       
} 
  
#include "functions.inc" 
  
light_source {
  <-0.297, -0.929, 0.221>*10000         
  color rgb 2
} 
         
camera {
  location <8.483, 0.209, 0.595>   
  direction y
  sky       z
  up        z                
  right     (16/9)*x              
  look_at   <0.000, 0.000, 0.490>
  angle     35.2    
}  
   
#declare Seed=seed(23);                      

#declare Rand_Nbr01=int(rand(Seed)*10000);         
#declare Rand_Nbr02=int(rand(Seed)*10000); 
#declare Rand_Nbr03=int(rand(Seed)*10000); 
#declare Rand_Nbr04=int(rand(Seed)*10000);   
      
#declare fn_tor=     
function { 
  f_torus(x, z, y, 50, 21)
} 

#declare fn_Noise_a=function {
  pigment {
    granite
    poly_wave 3
    color_map {
      [0 rgb 0]
      [1 rgb 1]
    }         
    warp { turbulence 0.37 octaves 10 omega 0.54 lambda 2.3 }    
    scale 14       
  }
}

#declare fn_Noise=function { 
  fn_Noise_a(x, y, z*0.03).gray*(2.53111-(z^1.48893)+
    f_snoise3d(x/5, y/5, 0)*0.8)
}  
     
#declare fn_1=
   function {   
     (
       (1+0.01) 
      
         - (0.01^(fn_tor(x+f_snoise3d(x/7, y/7, Rand_Nbr01)*5, 
                         y+f_snoise3d(x/7, y/7, Rand_Nbr02)*5, 
                         z+20-f_snoise3d(x/7, y/7, Rand_Nbr03)*0.8))    
           )                  
         - (0.01^(z-f_noise3d(x/2, y/2, Rand_Nbr04)^2*0.6))
     ) 
     - fn_Noise(x, y, z) + 0.5
   }    

      
isosurface{
  function { fn_1(x, y, z) }          
  max_gradient 10 
  accuracy 0.005  
  contained_by{box{<-70, -70, -0.5>, <70, 70, 2>}}  
  texture {   
    pigment { color rgb <0.78, 0.58, 0.42> }  
    finish { ambient 0.15 diffuse 0.6 }      
  }              
}  

// CODE end

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 11 Apr. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: isosurface problem
Date: 13 Apr 2002 13:18:14
Message: <3cb86856$1@news.povray.org>
In article <3CB8625F.DB538EDE@gmx.de> , Christoph Hormann 
<chr### [at] gmxde>  wrote:

> There seems to be a serious difference in render results of the linux and
> the windows version in some situations.  Linux behavior is wrong IMO.
>
> When rendering the following scene the lower half of the picture is filled
> with the isosurface object in WinPov while i only get a stripe at the
> horizon in the Linux version.  It is not related to insufficient
> max_gradient, i also tried with higher values with the same results.

Do you get the stripe with both Windows versions?   On Mac OS I also only get
a stripe as well.

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Christoph Hormann
Subject: Re: isosurface problem
Date: 13 Apr 2002 13:54:51
Message: <3CB870EA.A5BF09CD@gmx.de>
Thorsten Froehlich wrote:
> 
> [...]
> > When rendering the following scene the lower half of the picture is filled
> > with the isosurface object in WinPov while i only get a stripe at the
> > horizon in the Linux version.  It is not related to insufficient
> > max_gradient, i also tried with higher values with the same results.
> 
> Do you get the stripe with both Windows versions?   On Mac OS I also only get
> a stripe as well.

I get a fully filled lower half with both windows versions (and also with
beta 15 BTW)

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 11 Apr. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: isosurface problem
Date: 13 Apr 2002 16:31:14
Message: <3cb89592@news.povray.org>
In article <3CB870EA.A5BF09CD@gmx.de> , Christoph Hormann 
<chr### [at] gmxde>  wrote:

>> Do you get the stripe with both Windows versions?   On Mac OS I also only get
>> a stripe as well.
>
> I get a fully filled lower half with both windows versions (and also with
> beta 15 BTW)

Well, if it is with both versions it then suggests it is some math library
difference (in the pow C library function).  Given that gcc on Linux and
CodeWarrior on Mac OS use two completely different math libraries but the one
used by for the Windows compiles is probably the same it may well be a bug or
non-standard implementation.  Probably some testing on other platforms is
necessary to verify this...

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Christoph Hormann
Subject: Re: isosurface problem
Date: 13 Apr 2002 17:34:57
Message: <3CB8A47F.40E4D194@gmx.de>
Thorsten Froehlich wrote:
> 
> [...]
> Well, if it is with both versions it then suggests it is some math library
> difference (in the pow C library function).  Given that gcc on Linux and
> CodeWarrior on Mac OS use two completely different math libraries but the one
> used by for the Windows compiles is probably the same it may well be a bug or
> non-standard implementation.  Probably some testing on other platforms is
> necessary to verify this...
> 

The pow() function indeed seem to be the reason, replacing

z^1.48893

with

abs(z)^1.48893

leads to identical results in both Windows and Linux version.  Results
with negative base and non integer exponent are not defined, i suppose you
would have to catch this case inside Povray to make sure to get identical
results in all versions.

If this is not handled inside Povray i think it should be mentioned in the
docs (for example at the pow() function description), especially in
isosurface you do not necessarily recognize this at the first glance.

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 11 Apr. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: isosurface problem
Date: 13 Apr 2002 18:11:57
Message: <3cb8ad2d$1@news.povray.org>
In article <3CB8A47F.40E4D194@gmx.de> , Christoph Hormann 
<chr### [at] gmxde>  wrote:

> Results
> with negative base and non integer exponent are not defined, i suppose you
> would have to catch this case inside Povray to make sure to get identical
> results in all versions.

No, it cannot efficiently without needless penalty for all platforms.  The
error is in the Visual C library because (even the ancient 1989 version of)
the C standard specifies pow to return NaN* in this case and to (optionally)
issue an exception/signal.  Unfortunately the Visual C library apparently
fails to do either :-(


    Thorsten


* Actually, it says this will only be the case if the implementation also
complies to IEC 60559:1989 which is basically IEEE 754-1985, aka "THE
floating-point number standard".  Intel FPUs comply to this standard like all
processors available today, so the compiler is outdated or intentionally
breaking the standard to preserve some backward compatibility as M$ usually
calls these bugs :-(

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Christoph Hormann
Subject: Re: isosurface problem
Date: 14 Apr 2002 06:08:40
Message: <3CB95526.85275E5@gmx.de>
Thorsten Froehlich wrote:
> 
> No, it cannot efficiently without needless penalty for all platforms.  The
> error is in the Visual C library because (even the ancient 1989 version of)
> the C standard specifies pow to return NaN* in this case and to (optionally)
> issue an exception/signal.  Unfortunately the Visual C library apparently
> fails to do either :-(

All right, then i would suggest adding something like the following to the
pow() documentation (section 6.1.3.6):

"pow(A,B) Exponentiation. Returns the value of A raised to the power B.
Alternatively the hat operator can be used A^B.  For negative A and
non-integer B the function has no defined return value, the result then
may depend on the platform POV-Ray is compiled on."


Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 11 Apr. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: ingo
Subject: Re: isosurface problem
Date: 14 Apr 2002 07:06:33
Message: <Xns91F085C816EFDseed7@povray.org>
in news:3CB### [at] gmxde Christoph Hormann wrote:

> All right, then i would suggest adding something like the following
> to the pow() documentation (section 6.1.3.6):
> 

OK,

Ingo


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: isosurface problem
Date: 14 Apr 2002 09:06:07
Message: <3cb97ebf@news.povray.org>
In article <3CB### [at] gmxde> , Christoph Hormann 
<chr### [at] gmxde>  wrote:

> All right, then i would suggest adding something like the following to the
> pow() documentation (section 6.1.3.6):
>
> "pow(A,B) Exponentiation. Returns the value of A raised to the power B.
> Alternatively the hat operator can be used A^B.  For negative A and
> non-integer B the function has no defined return value, the result then
> may depend on the platform POV-Ray is compiled on."

Sounds like a good addition as it also covers other possibly defective
platforms.  Nevertheless, if fixing the Visual C library is possible, this
will of course be the preferred fix of this problem in the official version.

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

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