POV-Ray : Newsgroups : povray.general : Spherical blob components render faster Server Time
5 Aug 2024 14:12:14 EDT (-0400)
  Spherical blob components render faster (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: Greg M  Johnson
Subject: Spherical blob components render faster
Date: 2 Nov 2002 13:28:50
Message: <3dc41962$1@news.povray.org>
Remco made me aware of this astonishing  fact in p.b.a.  Here is a scene
file that makes it obvious.

A compact stack of 250 cylinders renders in 73 seconds.
A compact stack of 250 spheres renders in 6 seconds.



// Persistence of Vision Ray Tracer Scene Description File
// File: ?.pov
// Vers: 3.5
// Desc: Basic Scene Example
// Date: mm/dd/yy
// Auth: ?
//

#version 3.5;

#include "colors.inc"

global_settings {
  assumed_gamma 1.0
}

// ----------------------------------------

camera {
  location  <0.0, 0.5, -4.0>
  direction 1.5*z
  right     x*image_width/image_height
  look_at   <0.0, 0.0,  0.0>
}

sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.0 rgb <0.6,0.7,1.0>]
      [0.7 rgb <0.0,0.1,0.8>]
    }
  }
}

light_source {
  <0, 0, 0>            // light's position (translated below)
  color rgb <1, 1, 1>  // light's color
  translate <-30, 30, -30>
}

// ----------------------------------------

plane {
  y, -1
  pigment { color rgb <0.7,0.5,0.3> }
}


blob{threshold 0.4

#declare n=0;
#while(n<250)
        sphere {0,.4,1 scale <1,0.1,1> translate 0.005*y*n-0.5*y }
        //cylinder {0,y,.4,1 scale <1,0.1,1> translate 0.005*y*n-0.5*y }
#declare n=n+1;
#end

  texture {
    pigment {
      radial
      frequency 8
      color_map {
        [0.00 color rgb <1.0,0.4,0.2> ]
        [0.33 color rgb <0.2,0.4,1.0> ]
        [0.66 color rgb <0.4,1.0,0.2> ]
        [1.00 color rgb <1.0,0.4,0.2> ]
      }
    }
    finish{
      specular 0.6
    }
  }
}


Post a reply to this message

From: Warp
Subject: Re: Spherical blob components render faster
Date: 2 Nov 2002 14:03:16
Message: <3dc42173@news.povray.org>
Greg M. Johnson <gregj:-)56590@ao:-)l.com> wrote:
> Remco made me aware of this astonishing  fact in p.b.a.  Here is a scene
> file that makes it obvious.

> A compact stack of 250 cylinders renders in 73 seconds.
> A compact stack of 250 spheres renders in 6 seconds.

  I don't see what's so astonishing in this. One would expect that a more
complicated shape would render slower than a simpler one, and that's what
happened.
  Of course the difference in speed is a bit large, but still not
astonishing...

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Christopher James Huff
Subject: Re: Spherical blob components render faster
Date: 2 Nov 2002 15:21:57
Message: <3dc433e5@news.povray.org>
"Greg M. Johnson" <gregj:-)56590@ao:-)l.com> wrote in message
news:3dc41962$1@news.povray.org...
> Remco made me aware of this astonishing  fact in p.b.a.  Here is a scene
> file that makes it obvious.
>
> A compact stack of 250 cylinders renders in 73 seconds.
> A compact stack of 250 spheres renders in 6 seconds.

Why is this astonishing? What did you expect?
Not only are cylinders harder to solve for, using more complex math, but
bounding is much less effective. An unscaled sphere always fills the
majority of its bounding box, a cylinder can fill a very small percentage.
And I think the blob components are sphere bounded, which would make
cylinders even less efficient. Of course they are slower...


Post a reply to this message

From: Ken
Subject: Re: Spherical blob components render faster
Date: 2 Nov 2002 16:01:32
Message: <3DC43D06.9B292E8@pacbell.net>
Christopher James Huff wrote:
> 
> "Greg M. Johnson" <gregj:-)56590@ao:-)l.com> wrote in message
> news:3dc41962$1@news.povray.org...
> > Remco made me aware of this astonishing  fact in p.b.a.  Here is a scene
> > file that makes it obvious.
> >
> > A compact stack of 250 cylinders renders in 73 seconds.
> > A compact stack of 250 spheres renders in 6 seconds.
> 
> Why is this astonishing? What did you expect?
> Not only are cylinders harder to solve for, using more complex math, but
> bounding is much less effective. An unscaled sphere always fills the
> majority of its bounding box, a cylinder can fill a very small percentage.
> And I think the blob components are sphere bounded, which would make
> cylinders even less efficient. Of course they are slower...

I think it would be astonishing to presume that the average user would
know the internal workings of POV-Ray enough to come to the same
conclusion :)

-- 
Ken Tyler


Post a reply to this message

From: Christopher James Huff
Subject: Re: Spherical blob components render faster
Date: 2 Nov 2002 16:24:46
Message: <3dc4429e@news.povray.org>
"Ken" <tyl### [at] pacbellnet> wrote in message
news:3DC### [at] pacbellnet...
> I think it would be astonishing to presume that the average user would
> know the internal workings of POV-Ray enough to come to the same
> conclusion :)

OK, point taken, but even without all that, it seems like it should be
expected that a more complex shape is going to be slower. Being "astonished"
at it seems very strange...am I missing some meaning and reading things too
literally?


Post a reply to this message

From: Ken
Subject: Re: Spherical blob components render faster
Date: 2 Nov 2002 19:33:36
Message: <3DC46EBA.AC7C405A@pacbell.net>
Christopher James Huff wrote:
> 
> "Ken" <tyl### [at] pacbellnet> wrote in message
> news:3DC### [at] pacbellnet...
> > I think it would be astonishing to presume that the average user would
> > know the internal workings of POV-Ray enough to come to the same
> > conclusion :)
> 
> OK, point taken, but even without all that, it seems like it should be
> expected that a more complex shape is going to be slower. Being "astonished"
> at it seems very strange...am I missing some meaning and reading things too
> literally?

From the average user vantage point I fail to see where a blob constructed
from cylinders is any more complex than a blob constructed from spheres.
After all, they are both simple basic shapes, are they not?

-- 
Ken Tyler


Post a reply to this message

From: Gilles Tran
Subject: Re: Spherical blob components render faster
Date: 2 Nov 2002 20:09:05
Message: <3dc47731@news.povray.org>

de news: 3dc4429e@news.povray.org...
> "Ken" <tyl### [at] pacbellnet> wrote in message
> news:3DC### [at] pacbellnet...
> > I think it would be astonishing to presume that the average user would
> > know the internal workings of POV-Ray enough to come to the same
> > conclusion :)
>
> OK, point taken, but even without all that, it seems like it should be
> expected that a more complex shape is going to be slower. Being
"astonished"
> at it seems very strange...am I missing some meaning and reading things
too
> literally?

It's just that for the layman a cylinder is not a more complex shape than a
sphere. Even for a non-layman in fact... Both equations are very similar
after all. I don't dispute the fact that it's computationally more
expensive, but the difference in rendering time reported by Greg is really
big (x 10 !!!).

G.


--
**********************
http://www.oyonale.com
**********************
- Graphic experiments
- POV-Ray and Poser computer images
- Posters


Post a reply to this message

From: Greg M  Johnson
Subject: Re: Spherical blob components render faster
Date: 2 Nov 2002 22:34:57
Message: <3dc49961$1@news.povray.org>
"Ken" <tyl### [at] pacbellnet> wrote in message
news:3DC46EBA.AC7C405A@pacbell.net...

> From the average user vantage point I fail to see where a blob constructed
> from cylinders is any more complex than a blob constructed from spheres.
> After all, they are both simple basic shapes, are they not?
>

exactly.


Post a reply to this message

From: Christopher James Huff
Subject: Re: Spherical blob components render faster
Date: 2 Nov 2002 22:43:57
Message: <3dc49b7d@news.povray.org>
"Gilles Tran" <git### [at] wanadoofr> wrote in message
news:3dc47731@news.povray.org...
> It's just that for the layman a cylinder is not a more complex shape than
a
> sphere.

Hmm...maybe I'm just looking at it differently, but having two spherical
caps and a cylinderical section seems intuitively more complex than a
sphere.


> Even for a non-layman in fact... Both equations are very similar
> after all.

And for an isosurface function with axis-aligned cylinders, a cylinder
function is simpler...understandable confusion there. There are other
complications in the case of blob components which I don't expect "laymen"
to understand, but isosurfaces are more of an advanced user feature anyway.


> I don't dispute the fact that it's computationally more
> expensive, but the difference in rendering time reported by Greg is really
> big (x 10 !!!).

That did catch me off guard, it seemed suspicious until I took bounding into
account, which I don't expect the average user to think of. The fact that
one is slower than the other just seems pretty expected to me, I'd be very
surprised if any two primitives were exactly the same as far as speed, and
without looking at the math I'd guess that the cylinder is the slower one.

An idea: use "hierarchy off" and compare the speeds then...it should
eliminate the bounding differences, leaving only the blob calculation
differences. If my guess is right, the sphere component blobs will slow down
more than the cylinder component ones, bringing them closer to equal.


Post a reply to this message

From: Peter Popov
Subject: Re: Spherical blob components render faster
Date: 3 Nov 2002 06:00:38
Message: <4c0asug9885shf979rnrq15pmtksuj117g@4ax.com>
On Sun, 3 Nov 2002 10:47:49 -0500, "Christopher James Huff"
<cja### [at] earthlinknet> wrote:

>Hmm...maybe I'm just looking at it differently, but having two spherical
>caps and a cylinderical section seems intuitively more complex than a
>sphere.

It's not two caps and a cylinder, actually. It's just that the
distance function used computes the distance to a segment, 's all.


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

Goto Latest 10 Messages Next 5 Messages >>>

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