POV-Ray : Newsgroups : povray.general : Possible bug with (only?) simple objects and large values Server Time
5 Aug 2024 06:15:49 EDT (-0400)
  Possible bug with (only?) simple objects and large values (Message 1 to 9 of 9)  
From:
Subject: Possible bug with (only?) simple objects and large values
Date: 30 Nov 2002 03:12:55
Message: <3de87307$1@news.povray.org>
I am using numbers with solar-system sized values eg. 2x10^8.
I have just noticed what seems to be a bug with some solids
(code attached).

I have a sphere at the origin and a differenced cylinder
bracketing it. When the camera moves from a distance of
10 million to 11 million units the sphere disappears, but the
cylinder remains.

Additionally a torus at 152 million units disappears, whilst another
differentiated cylinder further out is visible in the same view,
in fact in another view the torus suddenly ends for no apparent
reason.

I would like to know if others who run this code see the same
issues, or if it is just platform specific...

The following code illustrates this bug, change the camera
statement from camera1 to camera2 to see the first bug,
set it at camera4 to see the second bug.

I am running PoV3.5  under windows95 with a P4 1.2GHz and
512Mb of memory.

If the items uniformly disappeared I would think it was a
floating overflow or something, however only certain items
seem to disappear, and not necessarily the furthest.

On my machine the system seems to have about 17 digits
of precision for floats as I am only using 9 this should not be
an issue (I determined this by doubling a float in a loop and
printing the results and marking where the least significant
digit started to become in error):

#declare cnt=0;
#declare value=1;

#while (cnt < 70)
        #declare value=value*2;
        #debug concat("Value is:",str(cnt,0,-1)," total is
       ",str(value,0,-1),"\n")
        #declare cnt=cnt+1;
#end

	-Dan

----- Problem pov file ------

// Disappearing item bug

#include "colors.inc"

#declare camera1=camera { // sun not visible
	location <100,1000000,-11000000>
	look_at <0,0,0>
	angle 35
}

#declare camera2=camera { // sun visible
	location <100,1000000,-10000000>
	look_at <0,0,0>
	angle 35
}

#declare camera4=camera {
	location <  0,  1200000, -153568000>
	look_at  <10000000, -100000, -151000000>
	angle 35
}

#declare camera7=camera { // Top View
	location <     0,500000000,0>
	look_at <0,0,0>
	angle 45
}

camera {camera1}

sphere { //sun
         <0,0,0>, 679948
         pigment {Yellow}
         finish {ambient .7} }

light_source { <0,0,-156000000> colour White }

object { // Sun indicator
	difference {
		cylinder { <0,35000000,0>, <0,-35000000,0>, 900000 }
		cylinder { <0,800000,0>, <0,-800000,0>, 910000 }
	}
	pigment { colour Blue }
	finish { ambient 1 }
}

object {
         torus { 152000000, 400000 }

	pigment { colour Green }
	finish { ambient 1 }
}


object { // Ring
	difference {
		cylinder { <0,-1000000,0>, <0,1000000,0>, 153570000 }
		cylinder { <0,-1000001,0>, <0,1000001,0>, 153567000 }
	    }
	pigment { colour White }
	finish { ambient .7 }
}


Post a reply to this message

From: Micha Riser
Subject: Re: Possible bug with (only?) simple objects and large values
Date: 30 Nov 2002 03:42:28
Message: <3de879f4@news.povray.org>
wrote:
> 
> If the items uniformly disappeared I would think it was a
> floating overflow or something, however only certain items
> seem to disappear, and not necessarily the furthest.
> 
> On my machine the system seems to have about 17 digits
> of precision for floats as I am only using 9 this should not be
> an issue (I determined this by doubling a float in a loop and
> printing the results and marking where the least significant
> digit started to become in error):
> 

Floating point error analysis is a bit more complicated than you seem to 
think. For intersections calculations a ray-tracer needs to do a sequence 
of calculations and the error which is produced by the limitation of 
floating point precision is propagted. As there are different calculations 
done for each primitives it is natural that the floating point error 
effects are also different for each primitive. In short: What you are 
seeing is definitely an effect of FP precision.

- Micha

-- 
objects.povworld.org - The POV-Ray Objects Collection
book.povworld.org    - The POV-Ray Book Project


Post a reply to this message

From: ingo
Subject: Doc request (was: Possible bug with (only?) simple objects and large values)
Date: 30 Nov 2002 04:20:53
Message: <Xns92D66A28F1E57seed7@povray.org>
in news:3de87307$1@news.povray.org  wrote:

> I am using numbers with solar-system sized values eg. 2x10^8.
> 

Questions about this come up every now and then. Can somebody write a 
piece for the documentation on "the limits of POV-Ray", maybe as a 
subsection of "6.1.3.1  Float Literals".

Or is it something for the FAQ?

Thanks,

Ingo


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Possible bug with (only?) simple objects and large values
Date: 30 Nov 2002 04:27:15
Message: <3de88473@news.povray.org>
In article <3de879f4@news.povray.org> , Micha Riser <mri### [at] gmxnet>  wrote:

> Floating point error analysis is a bit more complicated than you seem to
> think. For intersections calculations a ray-tracer needs to do a sequence
> of calculations and the error which is produced by the limitation of
> floating point precision is propagted. As there are different calculations
> done for each primitives it is natural that the floating point error
> effects are also different for each primitive. In short: What you are
> seeing is definitely an effect of FP precision.

No, this is wrong.

There is a very simple answer and I am sure there is some FAQ about it
somewhere as this question comes up every now and then.  The maximum
distance for which an intersection is calculated in POV-Ray is limited.  If
you want to create the solar system, you cannot use 1 unit = 1 m.  use
something like 1 unit = 1000 km and you should be fine.

    Thorsten

____________________________________________________
Thorsten Froehlich
e-mail: mac### [at] povrayorg

I am a member of the POV-Ray Team.
Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Christoph Hormann
Subject: Re: Doc request (was: Possible bug with (only?) simple objects and large values)
Date: 30 Nov 2002 04:27:16
Message: <3DE88474.56FD07E0@gmx.de>
ingo wrote:
> 
> Questions about this come up every now and then. Can somebody write a
> piece for the documentation on "the limits of POV-Ray", maybe as a
> subsection of "6.1.3.1  Float Literals".
> 
> Or is it something for the FAQ?
> 

There already are a few words on this in the FAQ in:

http://www.students.tut.fi/~warp/povQandT/misconceptions.html#simulatingsun

but i agree something more specific would be good.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 15 Nov. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Micha Riser
Subject: Re: Possible bug with (only?) simple objects and large values
Date: 30 Nov 2002 06:45:45
Message: <3de8a4e9@news.povray.org>
Thorsten Froehlich wrote:

> In article <3de879f4@news.povray.org> , Micha Riser <mri### [at] gmxnet> 
> wrote:
> 
>> Floating point error analysis is a bit more complicated than you seem to
>> think. For intersections calculations a ray-tracer needs to do a sequence
>> of calculations and the error which is produced by the limitation of
>> floating point precision is propagted. As there are different
>> calculations done for each primitives it is natural that the floating
>> point error effects are also different for each primitive. In short: What
>> you are seeing is definitely an effect of FP precision.
> 
> No, this is wrong.
> 
> There is a very simple answer and I am sure there is some FAQ about it
> somewhere as this question comes up every now and then.  The maximum
> distance for which an intersection is calculated in POV-Ray is limited. 

But if the max intersection distance (which is 10^7 according to frame.h) 
would be the issue here shouldn't all objects dissapear at the same 
distance then? And even if it is max distance that does it, the reason why 
there is a limit to the intersection distance is certainly to avoid 
floating point precision error.

- Micha

-- 
objects.povworld.org - The POV-Ray Objects Collection
book.povworld.org    - The POV-Ray Book Project


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Possible bug with (only?) simple objects and large values
Date: 30 Nov 2002 07:15:27
Message: <3de8abdf$1@news.povray.org>
In article <3de8a4e9@news.povray.org> , Micha Riser <mri### [at] gmxnet>  wrote:

> But if the max intersection distance (which is 10^7 according to frame.h)
> would be the issue here shouldn't all objects dissapear at the same
> distance then?

Not really, the issue is a bit more complex.  To simplify it, think of it as
if there is just no guarantee made that any object placed more than 10^7
away from the camera will behave as expected.

    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: Warp
Subject: Re: Possible bug with (only?) simple objects and large values
Date: 30 Nov 2002 08:21:35
Message: <3de8bb5f@news.povray.org>
wrote:

> I am using numbers with solar-system sized values eg. 2x10^8.

  Please don't.

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From:
Subject: Re: Possible bug with (only?) simple objects and large values
Date: 30 Nov 2002 12:10:00
Message: <3de8f0e8$1@news.povray.org>
On 30-Nov-2002, "Thorsten Froehlich" <tho### [at] trfde> wrote:

> > But if the max intersection distance (which is 10^7 according to
> > frame.h)
> > would be the issue here shouldn't all objects dissapear at the same
> > distance then?
>
> Not really, the issue is a bit more complex.  To simplify it, think of it
> as
> if there is just no guarantee made that any object placed more than 10^7
> away from the camera will behave as expected.

So I moved the decimal place over 3 locations (I was using 1unit=1Km) and
the problem with disappering items goes away. This hard-coded limitation
should defintely be described somewhere. (I know the documentation does
not talk about computational limits, as they would be machine specific).

The whole Idea behind floats is that the magnitude is really irrelevant,
only
the number of digits of accuracy should be a constraint, I am still getting
artifacting at the 7th digit of accuracy and that just seems to be a
limitation
of the system and is not good, but can be managed.

So searching for other hard-coded limits in the program I downloading the
source.
There I notice a value "small tolerance" of 0.001 is this another limit of
the program
that people have to be aware of?
If I have scene do I have to keep all my values above this number as well?

I also see that someone has defined pi to 22 digits of accuracy obviously
all of
these digits are not used.

Bounding boxes only use single floats rather than double I can't imagine
why this is so, or what effects this will have on code.

Also the mesh functions seem to use singles, I don't know if this would
cause
issues depending on the size/accuracy of the scene objects, perhaps someone
more knowledgable could comment on this.

All of these need to be definitely documented somewhere in the help files /
FAQ.

My problem is that I wanted to create an animation zooming in from
extra-solar
system to close earth orbit, so I will have to probably break it up into
several parts
with increasing accuracy in each source file in order to get PoV to perform
this task.

	-Dan


Post a reply to this message

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