POV-Ray : Newsgroups : povray.general : CSG Union causes major slow-down Server Time
29 Oct 2024 23:56:34 EDT (-0400)
  CSG Union causes major slow-down (Message 1 to 10 of 26)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Dave Blandston
Subject: CSG Union causes major slow-down
Date: 20 May 2000 03:15:56
Message: <39263bac@news.povray.org>
I made a scene of a stone wall. The stones were created as individual
objects (a couple hundred of 'em), and the scene rendered properly in about
30 minutes at 1024x768 resolution. I decided to make a single "BrickWall"
object (using a macro) that was a union of all the individual stones, and
suddenly it took almost NINE HOURS to render the same scene, although it
looked the same! Did I do something wrong? Is there a solution to this
problem? I would like to keep the union so that I can easily manipulate
multiple stone walls in my scene.

Regards,
Dave


Post a reply to this message

From: Dave Blandston
Subject: Re: CSG Union causes major slow-down
Date: 20 May 2000 03:50:36
Message: <392643cc@news.povray.org>
BTW, I should have mentioned that peak memory used is only about 12MB with
the CSG Union version, and my computer has 128MB RAM. There's no disk
thrashing going on, but maybe this is a CPU cache issue?


Post a reply to this message

From: Peter Popov
Subject: Re: CSG Union causes major slow-down
Date: 20 May 2000 05:05:44
Message: <i1lciskkd7l89lm1gfa3ocom0298vrtu35@4ax.com>
On Sat, 20 May 2000 00:46:43 -0700, "Dave Blandston"
<gra### [at] earthlinknet> wrote:

>BTW, I should have mentioned that peak memory used is only about 12MB with
>the CSG Union version, and my computer has 128MB RAM. There's no disk
>thrashing going on, but maybe this is a CPU cache issue?

No, not at all. It's related to bounding. Are you using manual
bounding? Is automatic counding on? Most importantly, is union
splitting on? How about removing user bounds (if any)? Are vista and
light buffers on?

What is most probably happening is that for some reason (a bad
combination of settings) POV is checking each ray against all objects
in the scene. As a quick test, try these command line options:

+mb0 +ul +uv +ur +su

If this does not work, read the docs :) especially the chapter about
automatic bounding control and removing user bounds.

HTH


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


Post a reply to this message

From: Mick Hazelgrove
Subject: Re: CSG Union causes major slow-down
Date: 20 May 2000 10:58:42
Message: <3926a822$1@news.povray.org>
I have this problem rendering thousands of blades of grass, I've never found
a solution that really works, though Peter's suggestion sometimes has a
small effect.

Mick
"Peter Popov" <pet### [at] usanet> wrote in message
news:i1lciskkd7l89lm1gfa3ocom0298vrtu35@4ax.com...
> On Sat, 20 May 2000 00:46:43 -0700, "Dave Blandston"
> <gra### [at] earthlinknet> wrote:
>
> >BTW, I should have mentioned that peak memory used is only about 12MB
with
> >the CSG Union version, and my computer has 128MB RAM. There's no disk
> >thrashing going on, but maybe this is a CPU cache issue?
>
> No, not at all. It's related to bounding. Are you using manual
> bounding? Is automatic counding on? Most importantly, is union
> splitting on? How about removing user bounds (if any)? Are vista and
> light buffers on?
>
> What is most probably happening is that for some reason (a bad
> combination of settings) POV is checking each ray against all objects
> in the scene. As a quick test, try these command line options:
>
> +mb0 +ul +uv +ur +su
>
> If this does not work, read the docs :) especially the chapter about
> automatic bounding control and removing user bounds.
>
> HTH
>
>
> Peter Popov ICQ : 15002700
> Personal e-mail : pet### [at] usanet
> TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Dave Blandston
Subject: Re: CSG Union causes major slow-down
Date: 20 May 2000 11:17:30
Message: <3926ac8a$1@news.povray.org>
Thank you, sirs. At least it's nice to know what's going on now - I was
baffled - haven't even thought about bounding since version 2.

Regards,
Dave

"Mick Hazelgrove" <mha### [at] redhotantcom> wrote in message
news:3926a822$1@news.povray.org...
> I have this problem rendering thousands of blades of grass, I've never
found
> a solution that really works, though Peter's suggestion sometimes has a
> small effect.
>
> Mick
> "Peter Popov" <pet### [at] usanet> wrote in message
> news:i1lciskkd7l89lm1gfa3ocom0298vrtu35@4ax.com...
> > On Sat, 20 May 2000 00:46:43 -0700, "Dave Blandston"
> > <gra### [at] earthlinknet> wrote:
> >
> > >BTW, I should have mentioned that peak memory used is only about 12MB
> with
> > >the CSG Union version, and my computer has 128MB RAM. There's no disk
> > >thrashing going on, but maybe this is a CPU cache issue?
> >
> > No, not at all. It's related to bounding. Are you using manual
> > bounding? Is automatic counding on? Most importantly, is union
> > splitting on? How about removing user bounds (if any)? Are vista and
> > light buffers on?
> >
> > What is most probably happening is that for some reason (a bad
> > combination of settings) POV is checking each ray against all objects
> > in the scene. As a quick test, try these command line options:
> >
> > +mb0 +ul +uv +ur +su
> >
> > If this does not work, read the docs :) especially the chapter about
> > automatic bounding control and removing user bounds.
> >
> > HTH
> >
> >
> > Peter Popov ICQ : 15002700
> > Personal e-mail : pet### [at] usanet
> > TAG      e-mail : pet### [at] tagpovrayorg
>
>


Post a reply to this message

From: Fabien Hénon
Subject: Re: CSG Union causes major slow-down
Date: 20 May 2000 12:05:13
Message: <3926B770.3CD55E5E@club-internet.fr>
I have had this problem once.

Use 'merge' instead of 'union' and manually bound it with a bounded_by { sphere
or box } as closely as possible.

POV will consider your wall as a single block and not as thousand of bricks.

It worked when I had thousands of spheres to render. Hope it will for you too.






> I made a scene of a stone wall. The stones were created as individual
> objects (a couple hundred of 'em), and the scene rendered properly in about
> 30 minutes at 1024x768 resolution. I decided to make a single "BrickWall"
> object (using a macro) that was a union of all the individual stones, and
> suddenly it took almost NINE HOURS to render the same scene, although it
> looked the same! Did I do something wrong? Is there a solution to this
> problem? I would like to keep the union so that I can easily manipulate
> multiple stone walls in my scene.
>
> Regards,
> Dave


Post a reply to this message

From: Dave Blandston
Subject: Re: CSG Union causes major slow-down
Date: 20 May 2000 13:21:43
Message: <3926c9a7@news.povray.org>
I'm not sure I follow you. Do you mean that you bounded the entire merge
object? I tried that (with the "-ur" switch), and didn't see a noticeable
change in render speed.

BTW, I posted a picture of the brick wall on p.b.i.

Regards,
Dave


news:3926B770.3CD55E5E@club-internet.fr...
> I have had this problem once.
>
> Use 'merge' instead of 'union' and manually bound it with a bounded_by
 sphere
> or box } as closely as possible.
>
> POV will consider your wall as a single block and not as thousand of
bricks.
>
> It worked when I had thousands of spheres to render. Hope it will for you
too.
>

>
>

>
> > I made a scene of a stone wall. The stones were created as individual
> > objects (a couple hundred of 'em), and the scene rendered properly in
about
> > 30 minutes at 1024x768 resolution. I decided to make a single
"BrickWall"
> > object (using a macro) that was a union of all the individual stones,
and
> > suddenly it took almost NINE HOURS to render the same scene, although it
> > looked the same! Did I do something wrong? Is there a solution to this
> > problem? I would like to keep the union so that I can easily manipulate
> > multiple stone walls in my scene.
> >
> > Regards,
> > Dave
>


Post a reply to this message

From: Peter Popov
Subject: Re: CSG Union causes major slow-down
Date: 21 May 2000 04:02:42
Message: <dn5fisgoep4af6t4kirl1398iuq92fj07r@4ax.com>

<ffj### [at] club-internetfr> wrote:

>Use 'merge' instead of 'union' and manually bound it with a bounded_by { sphere
>or box } as closely as possible.

Merge is internally represented as a complex CSG. It takes more memory
and generally takes longer to render than the equivalent union. This
is not true in some special cases but this shouldn't be one of them.

>POV will consider your wall as a single block and not as thousand of bricks.

Wrong (I think). It just represents it as a complex CSG to remove the
inner surfaces.

>It worked when I had thousands of spheres to render. Hope it will for you too.

If the spheres were transparent and stacked, maybe. I doubt it will
help in the stones macro case.


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


Post a reply to this message

From: Fabien Hénon
Subject: Re: CSG Union causes major slow-down
Date: 21 May 2000 17:03:26
Message: <39284ED4.87CC92A0@club-internet.fr>
I tried on my side with a test scene with 1000 spheres..., but I have not seen
any changes either.
Sorry about that.
I guess the solution I suggested only works with a previous version of POV 3.0
or 2.2 ( I forgot, it was a long time ago).





> I'm not sure I follow you. Do you mean that you bounded the entire merge
> object? I tried that (with the "-ur" switch), and didn't see a noticeable
> change in render speed.
>
> BTW, I posted a picture of the brick wall on p.b.i.
>
> Regards,
> Dave
>

> news:3926B770.3CD55E5E@club-internet.fr...
> > I have had this problem once.
> >
> > Use 'merge' instead of 'union' and manually bound it with a bounded_by
>  sphere
> > or box } as closely as possible.
> >
> > POV will consider your wall as a single block and not as thousand of
> bricks.
> >
> > It worked when I had thousands of spheres to render. Hope it will for you
> too.
> >

> >
> >

> >
> > > I made a scene of a stone wall. The stones were created as individual
> > > objects (a couple hundred of 'em), and the scene rendered properly in
> about
> > > 30 minutes at 1024x768 resolution. I decided to make a single
> "BrickWall"
> > > object (using a macro) that was a union of all the individual stones,
> and
> > > suddenly it took almost NINE HOURS to render the same scene, although it
> > > looked the same! Did I do something wrong? Is there a solution to this
> > > problem? I would like to keep the union so that I can easily manipulate
> > > multiple stone walls in my scene.
> > >
> > > Regards,
> > > Dave
> >


Post a reply to this message

From: Peter Popov
Subject: Re: CSG Union causes major slow-down
Date: 21 May 2000 18:35:18
Message: <5dogis0qqnuaig9coemjn6vu6kdm80ribn@4ax.com>
On Sat, 20 May 2000 00:12:07 -0700, "Dave Blandston"
<gra### [at] earthlinknet> wrote:

>I made a scene of a stone wall. The stones were created as individual
>objects (a couple hundred of 'em), and the scene rendered properly in about
>30 minutes at 1024x768 resolution. I decided to make a single "BrickWall"
>object (using a macro) that was a union of all the individual stones, and
>suddenly it took almost NINE HOURS to render the same scene, although it
>looked the same! Did I do something wrong? Is there a solution to this
>problem? I would like to keep the union so that I can easily manipulate
>multiple stone walls in my scene.

Dave,

I didn't have much time to test your code but here's the little I have
found so far:

1. Antialiasing slows it down immensely
2. Manuallly bounding each NewBrick object in a unit box gives a
10-20% speedup

POV reports 2 frame level objects and these are the two walls. I
haven't ventured deep in your code (though, I must admit, it is among
the top five I've seen, style-wise) but I found that a wall is a CSG
intersection of a box and the union of the mortar and bricks. This
makes it one object in terms of bounding so even with the vista buffer
on POV has to test 30% of the images on the screen against all stones,
which are CGSs of superellipsoids and height fields. I am pretty sure
that if, instead of intersecting above box with the union of the
bricks, you make a union of the intersections of this box with every
single brick, it will speed up the render considerably, because every
brick will then be bounded individually and rays will only be tested
against it when necessary.

There might be other optimisations to make, like using clipped_by
instead of intersection etc. but if what I propose works as I hope it
would, you'll have more time to experiment with extra speedup tweaks.

Hope it works...


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


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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