POV-Ray : Newsgroups : povray.general : Optimizing objects Server Time
23 Dec 2024 22:43:19 EST (-0500)
  Optimizing objects (Message 3 to 12 of 12)  
<<< Previous 2 Messages Goto Initial 10 Messages
From: Ross Litscher
Subject: Re: Optimizing objects
Date: 18 Mar 2003 13:44:21
Message: <3e776905$1@news.povray.org>
Fabien Mosen <fab### [at] skynetbe> wrote in message
news:3e773099$1@news.povray.org...

>
> > If object is made using CSG and boxes then is it true that avoiding
> > intersection and difference speeds up rendering?
>
> Yes.
>
> > Can I speed up rendering using meshes if object is constructed flat
> > surfaces?
>
> Yes.
>
> Fabien.
>
>

Why?


Post a reply to this message

From: Tim Nikias v2 0
Subject: Re: Optimizing objects
Date: 18 Mar 2003 13:46:55
Message: <3e77699f@news.povray.org>
intersection & differences:
Needs to compute insides and outsides of objects, and
needs to determine in which order the objects appeared to
know which are subtracted.

meshes:
have low overhead and use optimization trees (AFAIK)


--
Tim Nikias v2.0
Homepage: http://www.digitaltwilight.de/no_lights
Email: Tim### [at] gmxde


Post a reply to this message

From: ABX
Subject: Re: Optimizing objects
Date: 18 Mar 2003 13:51:23
Message: <vbqe7vgc8b4rl0sulko312m0jq8ujd8rlb@4ax.com>
On Tue, 18 Mar 2003 12:52:11 -0500, "Ross Litscher" <lit### [at] osuedu> wrote:
> > > If object is made using CSG and boxes then is it true that avoiding
> > > intersection and difference speeds up rendering?
> > Yes.
> > > Can I speed up rendering using meshes if object is constructed flat
> > > surfaces?
> > Yes.
> Why?

Because both solutions are internally optimized and more effective.
Union-only CSG is splitted into separated objects with vista buffer and other
goodies. Copied mesh use less memory and its intersection test is fast.

ABX


Post a reply to this message

From: Mike Williams
Subject: Re: Optimizing objects
Date: 18 Mar 2003 14:43:02
Message: <JopK2DARl2d+Ewqy@econym.demon.co.uk>
Wasn't it Matti Karnaattu who wrote:
>If object is made using CSG and boxes then is it true that avoiding
>intersection and difference speeds up rendering?

Yes, but in many cases you can get most of the speed back if you can
apply tight manual bounding. POV can't work out, in advance, which parts
of the objects remain after some bits are removed, so it creates an
automatic bounding box that contains the union of the objects.

>Can I speed up rendering using meshes if object is constructed flat
>surfaces?

Rewriting the entire structure as a single mesh2 object will usually be
the fastest way to render complex structures

It's also worth considering breaking your structure into smaller boxes
and unioning them back together. The intersections and differences of a
set of boxes can always be described as the union of a set of smaller
boxes. Unless you've got thousands of boxes, the speed isn't going to be
much slower than a mesh2.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: gonzo
Subject: Re: Optimizing objects
Date: 18 Mar 2003 17:10:03
Message: <web.3e779859e1b5231ea0c272b50@news.povray.org>
ABX wrote:

> Copied mesh use less memory and its intersection test is fast.

Does copied CSG use more memory?

For example, if I have a macro that constructs a CSG object, which would use
less memory: to call the macro once, then use 20 copies of that object, or
to call the macro 20 times?

RG


Post a reply to this message

From: Tim Nikias v2 0
Subject: Re: Optimizing objects
Date: 18 Mar 2003 17:20:17
Message: <3e779ba1$1@news.povray.org>
I guess it'd be 20 copies of the object. Thus, the macro-parsing is
saved. But CSG-Objects aren't saved like meshes, where the mesh
is loaded into the memory once, and then simply referenced. You
will have 20*CSG objects loaded into memory, no matter how you
do it (via macro or just copying), but macros create overhead.

--
Tim Nikias v2.0
Homepage: http://www.digitaltwilight.de/no_lights
Email: Tim### [at] gmxde

>
> > Copied mesh use less memory and its intersection test is fast.
>
> Does copied CSG use more memory?
>
> For example, if I have a macro that constructs a CSG object, which would
use
> less memory: to call the macro once, then use 20 copies of that object, or
> to call the macro 20 times?
>
> RG
>


Post a reply to this message

From: ABX
Subject: Re: Optimizing objects
Date: 19 Mar 2003 01:42:46
Message: <ps3g7vstlu2d00i5gi64chgfajivg3g5j3@4ax.com>
On Tue, 18 Mar 2003 17:06:18 EST, "gonzo" <rgo### [at] lansetcom> wrote:
> Does copied CSG use more memory?

yes

> For example, if I have a macro that constructs a CSG object, which would use
> less memory: to call the macro once, then use 20 copies of that object, or
> to call the macro 20 times?

Considering there are no #declarations of objects inside macro then
one call + 20 copies of identifier will use in memory 21 objects
while macro called 20 times will use 20 objects in memory.

Considering that macro internally use #declarations of local objects then macro
will take more memory.

Macro is always less or more slower than assignment from predeclared identifier.

As long as you not make complicated CSGs like trees there should no problem with
hundreds of megabytes.

ABX


Post a reply to this message

From: Tom Melly
Subject: Re: Optimizing objects
Date: 19 Mar 2003 04:43:57
Message: <3e783bdd@news.povray.org>
"Mike Williams" <mik### [at] econymdemoncouk> wrote in message
news:JopK2DARl2d+Ewq### [at] econymdemoncouk...
> Wasn't it Matti Karnaattu who wrote:
> >If object is made using CSG and boxes then is it true that avoiding
> >intersection and difference speeds up rendering?
>
> Yes, but in many cases you can get most of the speed back if you can
> apply tight manual bounding. POV can't work out, in advance, which parts
> of the objects remain after some bits are removed, so it creates an
> automatic bounding box that contains the union of the objects.
>

Is this right?

Surely with:

difference{
    object{A}
    object{B}
}

and

intersection{
    object{A}
    object{B}
}

They could be bound by the object{A} bounding box, rather than the bounding box
of the union of A and B?

In the case of the intersection, you could also switch to the bounding box of B
if that was smaller than A's.

I thought that that was what happened (although I don't know if the final
paragraph is implemented).

Actually, what *DOES* happen with intersections? Does POV look for the smallest
bounding-box, or does it just use the box of the first object in the list? If
the latter, then it would presumably make sense to list your smallest object
first.


Post a reply to this message

From: Warp
Subject: Re: Optimizing objects
Date: 19 Mar 2003 05:31:34
Message: <3e784706@news.povray.org>
Tom Melly <tom### [at] tomandlucouk> wrote:
> They could be bound by the object{A} bounding box, rather than the bounding box
> of the union of A and B?

  True, but as far as I know, for some reason POV-Ray does not do this.
I don't know why.

-- 
#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: Mark Weyer
Subject: Re: Optimizing objects
Date: 19 Mar 2003 05:32:36
Message: <3E784A6E.6020003@informatik.uni-freiburg.de>
> In the case of the intersection, you could also switch to the bounding box of B
> if that was smaller than A's.

The intersection of the participating bounding boxes suffices.


-- 
merge{#local i=-11;#while(i<11)#local
i=i+.1;sphere{<i*(i*i*(.05-i*i*(4e-7*i*i+3e-4))-3)10*sin(i)30>.5}#end
pigment{rgbt 1}interior{media{emission x}}hollow}//  Mark Weyer


Post a reply to this message

<<< Previous 2 Messages Goto Initial 10 Messages

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