POV-Ray : Newsgroups : povray.general : Quickest way for cubes Server Time
9 Aug 2024 01:24:02 EDT (-0400)
  Quickest way for cubes (Message 1 to 6 of 6)  
From: Greg M  Johnson
Subject: Quickest way for cubes
Date: 21 Sep 2000 09:28:03
Message: <39CA0BA5.887B468D@my-dejanews.com>
Say I want to have a solid 3D object made up of thousands of cubes.

Is the best way to do this with 12 meshes, a cube, or what?

Just how worse are the superellipsoids, and how much better are the
improvements to them?


Post a reply to this message

From: Warp
Subject: Re: Quickest way for cubes
Date: 21 Sep 2000 09:41:45
Message: <39ca1019@news.povray.org>
Greg M. Johnson <gre### [at] my-dejanewscom> wrote:
: Say I want to have a solid 3D object made up of thousands of cubes.

: Is the best way to do this with 12 meshes, a cube, or what?

  You mean 12 triangles?

  As far as I know the most efficient way is to create all the triangles
into one mesh (I mean that if you want 1000 cubes you don't make a mesh
made of 12 triangles and then copy it 1000 times, but instead you put
all the 12*1000 triangles into one mesh).
  You will be surprised how fast this mesh renders, no matter if it has
12*1000 triangles or 12*1000000 triangles (well, the parsing time gets
longer, of course, but that's not so important here; the parsing time
gets longer anyways, no matter what method you use).

  If the mesh must be solid (ie. useable in CSG) you'll have to use MegaPov
for that.

: Just how worse are the superellipsoids, and how much better are the
: improvements to them?

  Superellipsoids are very slow. I don't know if megapov has any
improvements in its speed, but it's always very slow (much slower than
a box and very much slower than a mesh if you have a lot of copies of it).

-- 
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

From: Greg M  Johnson
Subject: Re: Quickest way for cubes
Date: 21 Sep 2000 09:57:32
Message: <39CA1289.419800F2@my-dejanews.com>
Thanks, my render is now up to 14 minutes per 320 x 240 frame and I probably
have less than 8000 cubes so far...

I vaguely remember posting about how people had improved the superellipsoid,
hoping they'd made it as fast as a cube! Perhaps with about 40-200  triangles I
could make a sort of rounded-cube approximation.

(BTW--did you see my old reply to you re: computing volume?)

Warp wrote:

> Greg M. Johnson <gre### [at] my-dejanewscom> wrote:
> : Say I want to have a solid 3D object made up of thousands of cubes.
>
> : Is the best way to do this with 12 meshes, a cube, or what?
>
>   You mean 12 triangles?
>
>   As far as I know the most efficient way is to create all the triangles
> into one mesh (I mean that if you want 1000 cubes you don't make a mesh
> made of 12 triangles and then copy it 1000 times, but instead you put
> all the 12*1000 triangles into one mesh).
>   You will be surprised how fast this mesh renders, no matter if it has
> 12*1000 triangles or 12*1000000 triangles (well, the parsing time gets
> longer, of course, but that's not so important here; the parsing time
> gets longer anyways, no matter what method you use).
>
>   If the mesh must be solid (ie. useable in CSG) you'll have to use MegaPov
> for that.
>
> : Just how worse are the superellipsoids, and how much better are the
> : improvements to them?
>
>   Superellipsoids are very slow. I don't know if megapov has any
> improvements in its speed, but it's always very slow (much slower than
> a box and very much slower than a mesh if you have a lot of copies of it).
>
> --
> 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

From: Mark Wagner
Subject: Re: Quickest way for cubes
Date: 22 Sep 2000 02:52:36
Message: <39cb01b4@news.povray.org>
Greg M. Johnson wrote in message <39CA1289.419800F2@my-dejanews.com>...
>I vaguely remember posting about how people had improved the
superellipsoid,
>hoping they'd made it as fast as a cube! Perhaps with about 40-200
triangles I
>could make a sort of rounded-cube approximation.


A superellipsoid will never render as fast as a cube.  The fastest primitive
to render is an axis-aligned box, with non-axis-aligned boxes, spheres, and
meshes also being very fast.

Mark


Post a reply to this message

From: Matt Giwer
Subject: Re: Quickest way for cubes
Date: 27 Sep 2000 21:07:41
Message: <39D299E8.FF75A250@ij.net>
"Greg M. Johnson" wrote:
> 
> Say I want to have a solid 3D object made up of thousands of cubes.
> 
> Is the best way to do this with 12 meshes, a cube, or what?
> 
> Just how worse are the superellipsoids, and how much better are the
> improvements to them?

	Try them and compare. Superels definitely take longer to render even if
you set the varibles to make them perfect cubes. BTW: Wouldn't a cube be
six meshes? Off hand, a cube is a simple, well-defined shape that traces
quickly so I'd guess that would be quickest. 

-- 
If you quit smoking now you can live long enough
to get Altzheimer's. 
           -- The Iron Webmaster, 24


Post a reply to this message

From: Matt Giwer
Subject: Re: Quickest way for cubes
Date: 27 Sep 2000 21:17:10
Message: <39D29C21.110CB83E@ij.net>
"Greg M. Johnson" wrote:
> 
> Thanks, my render is now up to 14 minutes per 320 x 240 frame and I probably
> have less than 8000 cubes so far...
> 
> I vaguely remember posting about how people had improved the superellipsoid,
> hoping they'd made it as fast as a cube! Perhaps with about 40-200  triangles I
> could make a sort of rounded-cube approximation.

	As it is defined as a superel each point must be evaluated with the
squares of the point and solved for the normal and such. A cube is just
a plane not needing the extra steps.  There is your time difference. You
can't beat that except by pretesting for the unexpected condition that
the constants make it a cube and then treating it as a cube. So making
it a cube in the first place is expected of the user. 

-- 
Modern superstition: If we forget the horrors of the Nazis
they will rise again. 
	-- The Iron Webmaster, 135


Post a reply to this message

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