POV-Ray : Newsgroups : moray.win : Bounding box? : Re: Bounding box? Server Time
29 Jul 2024 08:15:28 EDT (-0400)
  Re: Bounding box?  
From: Rudy Velthuis
Date: 12 Mar 1999 07:08:13
Message: <36e903ad.0@news.povray.org>
Ken schrieb in Nachricht <36E88AE9.B9A07A1D@pacbell.net>...

>  That is not quite correct. Think of it this way. A box has 6 faces and
>12 edges. When pov shoots rays in to the scene to see what they rays strike
>it will have to account for the bouncing of the rays from the different
>faces and edges that the rays encounter. When you have multiple objects
>used in a csg operation, the objects, even though some of the edges are
>missing from being in a csg, are still intact from the point of view of
>the ray calculation process. What the bounding box does is confine the
>shape of the object as a single entity instead of a group of objects
>joined together. This speeds up rendering because it doesn't have to
>calculate all of the interior edges that have been removed by the csg
>operation. In other words it's no longer a group of primitives it is a
>new primitive with a unique shape.
>
>  As to whether this may be allowed with media and if it would make a
>difference is something of a different matter. I just did a simple test
>using one of the example files that comes with Pov and it took 2 sec.
>longer with a bounding object. It appears that the benefits are 0.
>The extra two second were probably the added time it took to issue the
>warning that the sphere I bounded was unnecessarily bounded.


The way I understand it (and would implement it myself), bounding boxes are
used by POV-Ray to determine if a ray could hit a complex object at all. If
the bounding box is not hit, the object can be disregarded by this
particular ray. So bounding boxes divide the scene into a few simpler
sub-scenes. If the bounding box is hit, you must still do a hit test for the
real object(s) in the box. That's why your sphere took longer, and even a
complex CSG will take a bit longer. But the scene outside the bounding box
will (propably) be faster. So the overall render time *could* be shorter,
and for complex scenes propably will be.

To clarify: If there are two complex CSGs, both made out of some 30 objects,
then the ray will first test the two bounding boxes. If it hits one of the
CSG, it will test all objects in this CSG, but not the objects in the other
CSG, and vice versa. If there were no bounding boxes, the ray would always
have to test all 60 objects in the scene.

Boxes are, as you mentioned, not the best kind of objects to test
intersections on, unless they are all orthogonal and not rotated - so the
vertices all ly on one of the axes. Then just a simple test on the
coordinates could already be a simple hit test. So I assume bounding boxes
are like that.

--
Rudy Velthuis


Post a reply to this message

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