|
![](/i/fill.gif) |
Wasn't it marabou who wrote:
>hello all!
>
>my rendertime with povray is fine.
>but if i try to render a pillar consisting of a many cylinders with spheres
>at its ends as difference from a cylinder then rendertime is far above 2
>min.
>the scene is only this white cylinder and four black planes.
>the cylinder ist 1 high only.
>is there any way to accelerate?
>
>thanks
What happens is that when you render without the difference, POV can put
a tight bounding box around each cylinder and sphere, so for each ray it
only has to perform cylinder tests for the few cylinders that that
particular ray comes close to.
When you do a difference, POV can't use the bounding boxes in the same
way. For each ray it ends up performing cylinder tests for every single
cylinder and sphere. You can see the effects of this if you look at the
stats in the message window. You'll find that there are a *huge* number
of cylinder and sphere tests, of which only a very small percentage
were successful. Whereas a render without the difference has about the
same number of successful tests but a much lower number of unsuccessful
ones.
I did a scene a while ago with hundreds of small cylindrical holes in a
flat slab and experimented with cutting the slab into smaller pieces
with just a few holes in each piece. It turned out that the rendering
was fastest when each piece was so small that it contained only one
hole.
The following one large slab took 62 times as long to render as 400
pieces with one hole in each.
#declare N = 20;
// One large slab with N*N holes
#declare Slab1 = difference
{
box {<-0.5,-0.5,-0.5>,<N-0.5,N-0.5,0.5>}
#declare xx = 0;
#while (xx < N)
#declare yy = 0;
#while (yy < N)
cylinder {<xx,yy,-1>,<xx,yy,1>,0.3}
#declare yy = yy+1;
#end
#declare xx=xx+1;
#end
}
// Declare a small box with one hole
#declare Box = difference
{
box {<-0.5,-0.5,-0.5>,<0.5,0.5,0.5>}
cylinder {<0,0,-1>,<0,0,1>,0.3}
}
// Glue together N*N boxes into one slab
// so it looks like one slab with N*N holes
#declare Slab = union {
#declare xx=0;
#while (xx < N)
#declare yy = 0;
#while (yy < N)
object {Box translate <xx,yy,0>}
#declare yy = yy + 1;
#end
#declare xx=xx+1;
#end
}
The one-large-slab version made over 70 million cylinder tests of which
0.4% were successful. The 400-small-pieces version made 27 thousand
cylinder tests of which 31% were successful.
The resulting images are identical.
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
![](/i/fill.gif) |