POV-Ray : Newsgroups : povray.bugreports : Rendering is slow if scene contains lots large objects Server Time
22 Dec 2024 03:54:47 EST (-0500)
  Rendering is slow if scene contains lots large objects (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: Juce
Subject: Rendering is slow if scene contains lots large objects
Date: 10 Dec 2010 10:40:00
Message: <web.4d02479678703b77d816b68e0@news.povray.org>
// +W320 +H240

camera { location <0,50000,-100000> look_at <0,-10000,0> }
light_source { <-700000,1000000,-400000>, rgb <1,1,1> }
plane { y,0 pigment { color <0,.8,0> } }

#declare R = seed(0);
#declare Count=0;
#while (Count < 5000)

sphere {
        <0,1000,0>,
        1360  // 1350 works fast
        pigment { color <0,.5,0> }
        translate <(rand(R)-.5)*500000,0,(rand(R)-.5)*500000>
        }

#declare Count=Count+1;
#end


This takes over 4 minutes if the radius is 1360. If I change it to 1350 then
Render Time is just 1 or 2 seconds.

Tested with Athlon64 3200+, 3.7.0.beta.40 (Windows XP 32-bit) and 3.6.1 (Ubuntu
10.10 64-bit).


Post a reply to this message

From: Le Forgeron
Subject: Re: Rendering is slow if scene contains lots large objects
Date: 10 Dec 2010 11:56:25
Message: <4d025bb9$1@news.povray.org>
On 10/12/2010 16:36, Juce wrote:
> // +W320 +H240
>
> camera { location<0,50000,-100000>  look_at<0,-10000,0>  }
> light_source {<-700000,1000000,-400000>, rgb<1,1,1>  }
> plane { y,0 pigment { color<0,.8,0>  } }
>
> #declare R = seed(0);
> #declare Count=0;
> #while (Count<  5000)
>
> sphere {
>          <0,1000,0>,
>          1360  // 1350 works fast
>          pigment { color<0,.5,0>  }
>          translate<(rand(R)-.5)*500000,0,(rand(R)-.5)*500000>
>          }
>
> #declare Count=Count+1;
> #end
>
>
> This takes over 4 minutes if the radius is 1360. If I change it to 1350 then
> Render Time is just 1 or 2 seconds.
>
> Tested with Athlon64 3200+, 3.7.0.beta.40 (Windows XP 32-bit) and 3.6.1 (Ubuntu
> 10.10 64-bit).
>
>
Confirmed.

Look at the Render statistics : 1350 get an additional line, "Bounding Box"!


Post a reply to this message

From: clipka
Subject: Re: Rendering is slow if scene contains lots large objects
Date: 10 Dec 2010 12:07:14
Message: <4d025e42$1@news.povray.org>
Am 10.12.2010 17:56, schrieb Le Forgeron:

>> This takes over 4 minutes if the radius is 1360. If I change it to
>> 1350 then
>> Render Time is just 1 or 2 seconds.
>>
>> Tested with Athlon64 3200+, 3.7.0.beta.40 (Windows XP 32-bit) and
>> 3.6.1 (Ubuntu
>> 10.10 64-bit).
>>
>>
> Confirmed.
>
> Look at the Render statistics : 1350 get an additional line, "Bounding
> Box"!

There is a maximum coordinate value for bounding boxes; I'm just 
guessing here, but it might be that the scene touches this borderline.


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Rendering is slow if scene contains lots large objects
Date: 10 Dec 2010 13:19:09
Message: <4d026f1d$1@news.povray.org>
On 10.12.10 18:06, clipka wrote:
> Am 10.12.2010 17:56, schrieb Le Forgeron:
>
>>> This takes over 4 minutes if the radius is 1360. If I change it to
>>> 1350 then
>>> Render Time is just 1 or 2 seconds.
>>>
>>> Tested with Athlon64 3200+, 3.7.0.beta.40 (Windows XP 32-bit) and
>>> 3.6.1 (Ubuntu
>>> 10.10 64-bit).
>>>
>>>
>> Confirmed.
>>
>> Look at the Render statistics : 1350 get an additional line, "Bounding
>> Box"!
>
> There is a maximum coordinate value for bounding boxes; I'm just guessing
> here, but it might be that the scene touches this borderline.

Except that spheres do not get bounding boxes.

Thorsten


Post a reply to this message

From: clipka
Subject: Re: Rendering is slow if scene contains lots large objects
Date: 10 Dec 2010 13:21:16
Message: <4d026f9c$1@news.povray.org>
Am 10.12.2010 19:19, schrieb Thorsten Froehlich:
> On 10.12.10 18:06, clipka wrote:
>> Am 10.12.2010 17:56, schrieb Le Forgeron:
>>
>>>> This takes over 4 minutes if the radius is 1360. If I change it to
>>>> 1350 then
>>>> Render Time is just 1 or 2 seconds.
>>>>
>>>> Tested with Athlon64 3200+, 3.7.0.beta.40 (Windows XP 32-bit) and
>>>> 3.6.1 (Ubuntu
>>>> 10.10 64-bit).
>>>>
>>>>
>>> Confirmed.
>>>
>>> Look at the Render statistics : 1350 get an additional line, "Bounding
>>> Box"!
>>
>> There is a maximum coordinate value for bounding boxes; I'm just guessing
>> here, but it might be that the scene touches this borderline.
>
> Except that spheres do not get bounding boxes.

But I guess they are included in the bounding box tree, so they'd 
normally be bounded hierarchically if I understand the bounding 
mechanism correctly, right?


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Rendering is slow if scene contains lots large objects
Date: 10 Dec 2010 14:15:59
Message: <4d027c6f$1@news.povray.org>
On 10.12.10 19:20, clipka wrote:
>> Except that spheres do not get bounding boxes.
>
> But I guess they are included in the bounding box tree, so they'd normally
> be bounded hierarchically if I understand the bounding mechanism correctly,
> right?

IIRC yes.

	Thorsten


Post a reply to this message

From: Le Forgeron
Subject: Re: Rendering is slow if scene contains lots large objects
Date: 11 Dec 2010 07:54:50
Message: <4d03749a$1@news.povray.org>
On 10/12/2010 20:15, Thorsten Froehlich wrote:
> On 10.12.10 19:20, clipka wrote:
>>> Except that spheres do not get bounding boxes.
>>
>> But I guess they are included in the bounding box tree, so they'd
>> normally
>> be bounded hierarchically if I understand the bounding mechanism
>> correctly,
>> right?
>
> IIRC yes.
>
> Thorsten

Excepted that in source/backend/parser/parse.cpp, the volume of each 
bounding box is compared to INFINITE_VOLUME (aka BOUND_HUGE, i.e. 2.0e+10).
(even if sphere does not use bounding box for pruning intersections' 
computation, it got a bounding box which is use for the volume)


as infinite in parse.cpp, not entering the bounding tree.

I would ponder the usage of BOUNDS_HUGE as a criteria against a volume.

than (or equal) BOUNDS_HUGE) should still be infinite.

What about comparing each dimension of the bounding box instead ?
(if it's bigger in at least one dimension, it's infinite, otherwise it 
stay finite)

volume computation has issue with very large & very thin bounding box: a 
larger thin object might be more finite than a smaller but thicker one 
(who could be tagged if infinite).

E.g: bbox of size <1e+7, 1e+7,1e-4> is finite.
      bbox of size <1e+6, 1e+6, 1> is infinite.


Your thought ?


Post a reply to this message

From: clipka
Subject: Re: Rendering is slow if scene contains lots large objects
Date: 11 Dec 2010 14:53:27
Message: <4d03d6b7$1@news.povray.org>
Am 11.12.2010 13:54, schrieb Le Forgeron:
> On 10/12/2010 20:15, Thorsten Froehlich wrote:
>> On 10.12.10 19:20, clipka wrote:
>>>> Except that spheres do not get bounding boxes.
>>>
>>> But I guess they are included in the bounding box tree, so they'd
>>> normally
>>> be bounded hierarchically if I understand the bounding mechanism
>>> correctly,
>>> right?
>>
>> IIRC yes.
>>
>> Thorsten
>
> Excepted that in source/backend/parser/parse.cpp, the volume of each
> bounding box is compared to INFINITE_VOLUME (aka BOUND_HUGE, i.e. 2.0e+10).
> (even if sphere does not use bounding box for pruning intersections'
> computation, it got a bounding box which is use for the volume)
>

> as infinite in parse.cpp, not entering the bounding tree.
>
> I would ponder the usage of BOUNDS_HUGE as a criteria against a volume.

> than (or equal) BOUNDS_HUGE) should still be infinite.
>
> What about comparing each dimension of the bounding box instead ?
> (if it's bigger in at least one dimension, it's infinite, otherwise it
> stay finite)
>
> volume computation has issue with very large & very thin bounding box: a
> larger thin object might be more finite than a smaller but thicker one
> (who could be tagged if infinite).
>
> E.g: bbox of size <1e+7, 1e+7,1e-4> is finite.
> bbox of size <1e+6, 1e+6, 1> is infinite.
>
>
> Your thought ?

I guess the idea behind this mechanism was, "if the bbox covers a lot of 
volume, it will cover a lot of visible area, so we can just as well 
presume we'll get a bounding box hit in virtually every direction anyway".

The flaw with this idea, which shows in this particular scene, is that 
in reality the visible area covered will not only depend on the object's 
volume, but also on its distance to the camera.

Maybe a good idea would be to test the volume in relation to the 
distance to the camera:

   if ((a*b*c) / pow(dist_to_camera,3) >= INFINITE_VOLUME) ...


Post a reply to this message

From: Le Forgeron
Subject: Re: Rendering is slow if scene contains lots large objects
Date: 11 Dec 2010 15:24:51
Message: <4d03de13@news.povray.org>
On 11/12/2010 20:53, clipka wrote:

> Maybe a good idea would be to test the volume in relation to the
> distance to the camera:
>
> if ((a*b*c) / pow(dist_to_camera,3) >= INFINITE_VOLUME) ...

I would stand by the code in the bounding box: when one dimension is big 
enough, assume infinite (well, it's the opposite way: infinite object 
set the bounding box to huge bound value in 3 dimensions...)

Or we can do like my national postal service: if the sum of the 3 
dimensions is more than 1m, it's a non standard parcel... with added 
price on the stamp.


Post a reply to this message

From: clipka
Subject: Re: Rendering is slow if scene contains lots large objects
Date: 11 Dec 2010 16:02:38
Message: <4d03e6ee$1@news.povray.org>
Am 11.12.2010 21:24, schrieb Le Forgeron:

> Or we can do like my national postal service: if the sum of the 3
> dimensions is more than 1m, it's a non standard parcel... with added
> price on the stamp.

What if I define the parcel using

   box { <2,-1,-1>,<0,1,1> }

Do I get money back? :-P


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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