POV-Ray : Newsgroups : povray.newusers : tranparent objects : Re: tranparent objects Server Time
6 Sep 2024 12:12:40 EDT (-0400)
  Re: tranparent objects  
From: Nieminen Mika
Date: 5 Jun 1998 14:26:53
Message: <6l9d9d$7m8$1@oz.aussie.org>
Lothar Esser <ess### [at] chopswmededu> wrote:
:   I am planning to use povray to render a transparent object which 
:   may contain several thousands of round ended cylinders. I noticed 
:   that it is very slow and I am wondering if a change in the way
:   I generate the object might speed povray up.

  You don't tell in your article if your object is reflecting. If so, it's
normal that the rendering times are extremely high. Also refraction may
slow down the rendering.
  If the object is just transparent (ie. it have filter or transmit greater
than 0, but not reflection or refraction) it's faster, but since there are
thousands of objects, it's slow. Although the objects are merged, all the
surfaces are there (they are just ignored), so it takes time to calculate
all the surfaces (but it's just as fast as union, don't believe that guy
who said merge is terribly slow; actually merge is faster than union, I just
made a test: 20 spheres of radius 2 in the z-axis located at 0, z, z*2, z*3,
and so on, and semitransparent, and the camera at -z*10; with union it took
2min 3sec to render and with merge (all the inner surfaces disappeared of
course) it took 45 seconds to render!).

:   So I wonder if something like this is faster :

:    #declare round_ended_cylinder = 
:    merge { cylinder { <0,0,0>,<1,0,0>,1 }
:             sphere {<0,0,0>,1}
:             sphere {<1,0,0>,1}
:    }

:    merge {
:       object {round_ended_cylinder 

  Nope. That ends up to be the same as the first code. Think about the
declared identifier as if the code is just copied in the place of the
identifier (I think that's exactly what povray does).
  Maybe you should try to put all the objects into one single merge body,
although I don't think that will help. Like

merge
{ cylinder { ... }
  sphere { ... }
  sphere { ... } 
  cylinder { ... }
  sphere { ... }
  sphere { ... }
  ...
}

  Why transparent objects are so slow? That's because povray has to made many
many calculations. Each time a ray hits an object, it tests if it's transparent
or reflecting. If so, it send another ray (or two rays if it was both trans-
parent and reflecting), and when it hits another surface, the same again and
again. With thousands of surfaces for every pixel it's understandable that it
takes time to calculate.

-- 
                                                              - Warp. -


Post a reply to this message

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