POV-Ray : Newsgroups : povray.advanced-users : :O I broke it. : Re: :O I broke it. Server Time
5 May 2024 19:27:36 EDT (-0400)
  Re: :O I broke it.  
From: clipka
Date: 13 Aug 2016 17:24:57
Message: <57af9029$1@news.povray.org>
Am 13.08.2016 um 19:02 schrieb Bald Eagle:
> clipka <ano### [at] anonymousorg> wrote:
>> Am 13.08.2016 um 02:46 schrieb Bald Eagle:
>>> This fixes it.
>>> Hmmm.
>>>
>>> #declare Step = 0.49 / ((2*pi/0.1)*(pi/0.2));
>>>
>>> {notice additional brackets}
>>
>> I interpret that as "nevermind, please disregard my earlier post".
>> If that interpretation is incorrect, let me know.
> 
> Wellllll....   it's ok in the short term I guess,
> Though it doesn't explain the error - which seems like it may be some sort of
> bug.
> I don't see any recursion occurring, or limit to be reached.
> 
> So, I guess it's up to you to decide   ;)

My guess would be "camera inside too many spheres at once".

Note that you're increasing the radius of the sphere, `r`, by `Step`
about (pi/0.2) times per inner loop, and do this (2*pi/0.1) times per
outer loop, for a total of about 1000 times.

With your fixed version,

    #declare Step = 0.49 / ((2*pi/0.1)*(pi/0.2));

you get a `Step` value of around 0.00049; Throughout the loops, this
adds about 0.49 to `r`, for a final radius of about 0.59. Since the
position of the sphere is off the center by R=2, the farthest point of
the largest sphere is about 2.59 off the center -- at <5,1,-20> the
camera is way outside that range.

With the bugged version however,

    #declare Step = 0.49 / (2*pi/0.1)*(pi/0.2);

you get a `Step` value of exactly 0.49, which causes `r` to grow to the
distance to the camera (ca. 20.6) in just about 42 steps. So the camera
is inside approximately 950 spheres.

Compiled with the default settings, POV-Ray can cope with a ray being
inside up to 512 overlapping objects, then it raises the white flag.


This is one of the very few fixed-size data structures still present in
POV-Ray, and it is instantiated at each reflection and refraction, so
although it would be possible to increase the limit, that would mean
increasing memory consumption during each and every render, no matter
whether the limit is ever even remotely approached, and you'd still have
/some/ hard limit anyway.

Also, although it would theoretically be possible to replace the data
structure with a variable-sized one, any attempts at doing so have so
far resulted in severely degraded performance.


Post a reply to this message

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