POV-Ray : Newsgroups : povray.general : ray intersection speed-up question Server Time
1 Nov 2024 08:11:57 EDT (-0400)
  ray intersection speed-up question (Message 1 to 2 of 2)  
From: Abe Heckenbach
Subject: ray intersection speed-up question
Date: 16 Aug 2000 21:32:50
Message: <399B455E.B8090FE5@vrml.k12.la.us>
hey, how is all today?  

could someone tell me how much faster the different speed-up techniques
are that are used by pov-ray for ray intersection calc., in comparison
to a ray tracer not using ANY speed-up techniques. (could you please
tell me for each method seperatly!)I realize this is dependent on the
specific scene being traced, but either an average, worst/best case
senerios, or citing a specific scene would help) Is there not any
websites that have this kind of info???

also, besides for 1st hit speed-ups, and light buffers for point light
sources, are there any methods used in pov-ray besides just progressing
through a obj. tree??

thanx HUGE amounts on any replies,

	Abe H. (abe### [at] vrmlk12laus)


Post a reply to this message

From: Warp
Subject: Re: ray intersection speed-up question
Date: 17 Aug 2000 08:48:11
Message: <399bdf0b@news.povray.org>
In povray.general Abe Heckenbach <abe### [at] vrmlk12laus> wrote:
: could someone tell me how much faster the different speed-up techniques
: are that are used by pov-ray for ray intersection calc., in comparison
: to a ray tracer not using ANY speed-up techniques.

  If you have many objects (hundreds, thousands, more...) in the scene, the
speed difference can be drastical.

  You can test how speed optimizations affect the rendering of an image.
Make a triangle mesh with 10 triangles (eg. a spherical shape) and look the
rendering time. Now make the same shape with 100 triangles and measure. Then
1000 triangles, then 10000 triangles.
  You will notice that the parse time increases (logically), but the rendering
time stays approximately the same! Yes, the higher triangle count causes
a bit longer rendering time, but it's incredibly minimal compared to the
increase in the triangle count.
  If there was no optimization at all, the rendering time would grow linearly
with the number of triangles, so if you put 10 times more triangles, the
rendering time will be approx. 10 times longer (supposing the mesh occupies
the entire screen).

  Triangle meshes have a highly optimized algorithm and that's why even
a HUGE mesh is quite fast to render. As far as I know, povray uses a kind
of octree for the optimization.

  Now think about an object that consists of hundreds of primitives (eg.
spheres, boxes and so on). Put this kind of object in front of the camera
so that it doesn't take too much of the screen space (ie. it's quite small
in the final image) and measure the rendering time. Then put two of these
objects in front of the camera and measure. One could think that the rendering
time doubles, but no, the rendering time is only minimally higher. Put 10
objects; again, the rendering time gets a bit higher, but not even near
10 times (probably not even 2 times).
  Again, if there was no optimization at all, the rendering time would grow
linearly with the number of objects.

  The optimization used here is the so-called bounding box hierarcy. The
object consisting of hundreds of primitives is surrounded with an
"invisible" bounding object (usually a box). When a ray is shot, it's first
tested against this bounding box; if it doesn't hit it, there's no need to
test against all those hundreds of primitives because we know that it will
not hit them anyways. Only when the ray hits the bounding box it is tested
against the primitives.
  Now, depending on the structure of the primitives inside the big object,
groups of them can have their own bounding boxes, thus speeding up even when
the ray is tested against the object. And these groups can have smaller
groups with bounding boxes and so on (hence the word "hierarchy").

  There are other optimizations as well, such as vista buffers and light
buffers. I don't know much about these.

  Some objects have specific optimizations, one good example being the
triangle mesh, as described above. Another one is the heightfield object.
A heighfield is nothing more than a triangle mesh. However, it renders
faster than a regular mesh because it has its own optimizations (the
optimizations take into account that the x and z coordinates of all
the triangles are at certain fixed locations).

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

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