POV-Ray : Newsgroups : povray.general : Fast poligonal solids? : Re: Fast poligonal solids? Server Time
7 Aug 2024 23:22:51 EDT (-0400)
  Re: Fast poligonal solids?  
From: Mike Williams
Date: 2 May 2001 18:19:28
Message: <Cjf7FCALOB86Ewi4@econym.demon.co.uk>
Wasn't it Rich who wrote:
>  Has anyone come up with fast rendering solid poligonal shapes?  What I'm 
>looking for is the tetrahedron, octahedron, etc.  The ones in shapes2.inc 
>are SLOW, more than 15 times slower than a sphere, for instance.  I've 
>looked through the links on the POV server, but have yet to find anything I 
>can use.
>  The shapes need to be solid so I can CSG some numbers and/or letters into 
>the faces.  Even if the shapes are just a little faster than the ones in 
>shapes2.inc, I'd appreciate seeing them.  The picture I posted the other 
>day called GlassSpheres.jpg was rendered in a little over an hour; 
>replacing the 64 spheres with dodecahedrons and re-rendering took 17.5 
>hours!!
>

Try this:-

#include "shapes.inc"
#include "shapes2.inc"

#declare Bounded_Dodecahedron = object {Dodecahedron
   bounded_by {sphere {0,1.26}}
}



If you've got lots of small dodecahedrons in your scene, then these
Bounded_Dodecahedrons will render *much* faster.

The reason is that POV isn't smart enough to work out that the
intersection of the 12 planes that define the ordinary dodecahedron is
bounded, so automatic bounding slabs don't get generated. So, for every
ray, POV has to check the ray's intersection with 12 planes for each
dodecahedron.

When you manually apply bounds to the object, POV performs one sphere
intersection test for each bounding sphere, and then only goes on to
perform the 12 plane tests in the few cases where the bounds check
succeeds.

The speed improvement depends on how likely each ray is to miss each
dodecahedron. I'd guess that, for your image, Bounded_Dodecahedrons
would render in less than twice the time taken for spheres. In an image
with a few large dodecahedrons there wouldn't be much speed improvement.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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