POV-Ray : Newsgroups : povray.general : Floating point precision : Re: Floating point precision Server Time
2 Aug 2024 02:24:43 EDT (-0400)
  Re: Floating point precision  
From: Alain
Date: 3 Feb 2005 18:59:35
Message: <4202bae7$1@news.povray.org>
Tim Nikias nous apporta ses lumieres en ce 2005-02-03 13:08:
> I've got a question in regard to the floating point precision. I've got a
> saved amount positions and mesh2 objects, and I place these mesh2-objects
> onto the positions. The length of these mesh2-objects was originally deriven
> by the position itself. So I *do* unterstand that floating point precision
> could lead to results in which the length of the mesh2-object differs
> slightly. As I'm picking between set lengths, this difference can be quite
> obvious when comparing two images, but doesn't matter that much as it won't
> be used in animations (at least it's not designed for it, and this precision
> problem actually makes it impossible, at least if I want to combine both
> steps, generation and placement).
> 
> Anyways, what's interesting though is that the mesh2-objects get colored
> according to a function which derives a color from the bozo-pattern using
> the position. The colors are slightly different too! So either the objects
> don't get placed at the exact same location, or at least the function comes
> up with a slightly different result, even though the same pattern and
> position is used.
> 
> So, my question is, can this be due to different calculations applied in
> either scene? Where the first render generates all the data, the second does
> less work and just includes the objects that have been written to disk.
> Placing and selection is done with the same routines, which make use of lots
> of dividing and such, so the precision could add up in such areas, but then
> again, both use the same selection routines, they're not different.
> 
> It's slightly confusing as I don't see a reason for this to happen. It's
> like POV-Ray is switching back and forth between a very low-value switch of
> rounding up or done or such.
> 
> The scene (and macros) itself are far too big to post here, but I was
> wondering if anyone could give some insight. Is it possible for a
> calculation to differ slighty when other calculations have come before? The
> technical side in me says "No, not possible" and I'm thinking that maybe the
> calculations I'm doing add the precision problems to a degree where it gets
> noticable when some parts are left out. I'll investigate, but any replies
> appreciated!
> 
> Regards,
> Tim
> 
When you save your data to a file, you may loose some digit, truncating or choping off
the last 
digits. Try adjusting the number of digit writen. When you evaluate the pigment, you
are using the 
raw data from the FPU and are geting the full acuracy.
The result is that the saved data is no longer the same as it was, and is now
diverging from the 
pigment.

Alain


Post a reply to this message

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