POV-Ray : Newsgroups : povray.newusers : CSG shape with many 'holes' takes *forever* to render! Server Time
31 Jul 2024 02:25:33 EDT (-0400)
  CSG shape with many 'holes' takes *forever* to render! (Message 11 to 12 of 12)  
<<< Previous 10 Messages Goto Initial 10 Messages
From:
Subject: Re: CSG shape with many 'holes' takes *forever* to render!
Date: 1 Aug 2003 11:43:52
Message: <3f2a8ab8$1@news.povray.org>
Hi Fuzzy

> shadows I did notice were rough... as for 'deep' holes, I'm not sure I know
> what you mean, as I mapped my texture to an outer cylinder and to an inner
> one, the holes gained depth from the distance between the two cylinders.

> When I tried the CSG without assigning a texture to the cylinders making the
> holes the holes just turned out black, so I assigned rgbt <1,1,1,1> to the
> smaller cylinders... and since I'm using Polished_Chrome on the main
> cylinder... this might not be a good idea.

A very bad idea:
- Your holes have no walls (like the yellow parts in my example code)
- You can look between inner and outer cylinder and will see the inside of
  the outer cylinder and the outside of the inner cylinder through the
  hole. There will be unexpected shadows and reflections due to the missing
  walls.
- With a highly reflective texture, some rays will be reflected (almost)
  endlessly between inner and outer cylinder.

> What I'll try first, as someone suggested, is to have shorter cylinders that
> ONLY punch out the hole, and that don't cross over in the middle to punch
> out the opposing hole on the other side too - my guess is that the crossing
> over of them is throwing things off somewhere...

NoNoNo! My example renders in 2 min 18 sec with crossed cylinders, but
needs more than *twice* the time (4 min 39 sec) with one cylinder per hole!

> >    FIVE THOUSAND holes. They required less than 26 MINUTES for 640*480
>
> then it's obvious that I'm doing something very wrong (hopefully) :)

It works, so it's not wrong. But it's bad and can be done better: play
with my code (my complete last post is a ready-to-go POV-Ray scene)!

> *looks around at the POVray swimming pool... maybe I should have tried to
> climb in down at the shallow end instead of jumping in here... ah well...
> too late now* ;)

... you can't (learn to) swim at the shallow side ...


   Sputnik


Post a reply to this message

From: Mike Williams
Subject: Re: CSG shape with many 'holes' takes *forever* to render!
Date: 2 Aug 2003 03:14:39
Message: <uQnHqDAKS2K$EwxA@econym.demon.co.uk>
Just for fun, here's a completely different approach to a cylinder with
holes in it. It only works if you can find a good mathematical
description for the pattern for the holes. It runs surprisingly quickly,
and the speed stays pretty much the same however many holes there are.

With these settings, a 640*480 render (without AA) takes under a minute
on my old 850MHz machine, and generates something like 5000 holes.


#declare D=60;    // controls the density of the holes 
                  // larger value gives more holes
#declare S = 0.1; // Controls the size of the holes
                  // relative to the spacing between them
                  // larger value gives smaller holes

#declare R1=0.9;  // Radius of outer cylinder
#declare R2=0.7;  // Radius of inner cylinder
#declare H=4;     // Height of the cylinder

#include "functions.inc"

light_source {<100,200,-100> colour rgb 1}
light_source {<-100,-200,-100> colour rgb 0.5}

isosurface {
   function {
     max (                              // intersection
       (-x*x - z*z + R2*R2),            // of inverted inner cylinder
       max (                                   // with intersection
         (f_leopard(D*f_th(x,y,z),0,D*y) -S),     // of inverted holes
         (x*x + z*z - R1*R1)                      // with outer cylinder
       )
     )
   }
   max_gradient 10
   contained_by{box {-<R1,0,R1>,<R1,H,R1>}}
   pigment {rgb 1}
}
      
camera { location  <0, 7, -9> look_at <0, H/2, 0> angle 30}


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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