POV-Ray : Newsgroups : povray.advanced-users : Memory questions... Server Time
29 Jul 2024 14:14:41 EDT (-0400)
  Memory questions... (Message 1 to 8 of 8)  
From: Tim Nikias
Subject: Memory questions...
Date: 28 Mar 2002 16:50:52
Message: <3CA39043.4D0DF734@gmx.de>
So, when using meshes in unions, how efficiently are they saved?
How do unions save anyway?

How are scaled instances of meshes handled?
When putting a union around 2000 spheres and cylinders,
does it make a difference when using instances of that
union-object, or when rather placing several of those
2000 spheres and cylinders directly?

Just some "trivia" for memory stuff I would like to know
for some macros and file-output etc. Anything related to
the questions may be mentioned as well, I'm really interested!

--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html


Post a reply to this message

From: Christopher James Huff
Subject: Re: Memory questions...
Date: 28 Mar 2002 17:30:37
Message: <chrishuff-4E37BC.17312228032002@netplex.aussie.org>
In article <3CA39043.4D0DF734@gmx.de>, Tim Nikias <tim### [at] gmxde> 
wrote:

> So, when using meshes in unions, how efficiently are they saved?

A copy of a union containing a mesh will get a copy of the mesh, but 
that mesh copy will only contain a reference to the original data, just 
like ordinary mesh copies. (I'm making an assumption here, I haven't 
tested this...but if it does something different it is probably a bug)


> How do unions save anyway?

They generally don't. They are intended to make manipulating shapes more 
convenient. They are also useful because they can help you set up a 
bounding tree to speed tracing, but they don't help memory use at all.


> How are scaled instances of meshes handled?

The transformations are stored separately from the mesh data. Scaling a 
mesh doesn't affect the data.


> When putting a union around 2000 spheres and cylinders,
> does it make a difference when using instances of that
> union-object, or when rather placing several of those
> 2000 spheres and cylinders directly?

No substantial difference. If you make a union, POV obviously has to 
store the union itself, but that doesn't take much space. If you are 
asking if unions also use the shared data method meshes use, the answer 
is no.

-- 
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/


Post a reply to this message

From: Tim Nikias
Subject: Re: Memory questions...
Date: 28 Mar 2002 18:48:42
Message: <3CA3ABE1.C494E997@gmx.de>
Ah, some insights! Thank you very much!

If anyone else has some more related insights tucked
up in their brains somewhere... I'm listening!


--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html


Post a reply to this message

From: Warp
Subject: Re: Memory questions...
Date: 28 Mar 2002 21:37:35
Message: <3ca3d36f@news.povray.org>
Christopher James Huff <chr### [at] maccom> wrote:
>> So, when using meshes in unions, how efficiently are they saved?

> A copy of a union containing a mesh will get a copy of the mesh, but 
> that mesh copy will only contain a reference to the original data, just 
> like ordinary mesh copies. (I'm making an assumption here, I haven't 
> tested this...but if it does something different it is probably a bug)

  However, you should note that using a sphere-shaped mesh and copying
this mesh many times will not save any considerable amount of memory
compared to using just regular spheres.

  You will start saving substantial amounts of memory if you make a mesh
with many spherical shapes (eg. tens or hundreds of spheres) and copy this
mesh. Of course it is only possible if there are big groups of spheres which
can be copied as is.
  That is, it's important to make 1 mesh with many spheres in it, and then
copy that mesh (if it's possible in the used model), not making a mesh
with 1 sphere and copying that.
  (Of course I used "sphere" as an example shape. You can, of course, use
any shapes you like.)

-- 
#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: John VanSickle
Subject: Re: Memory questions...
Date: 29 Mar 2002 13:16:08
Message: <3CA4B073.401F524B@hotmail.com>
Christopher James Huff wrote:
> 
> > How do unions save anyway?
> 
> They generally don't. They are intended to make manipulating shapes
> more convenient. They are also useful because they can help you set up
> a bounding tree to speed tracing, but they don't help memory use at
> all.

Exception:  If all of the objects in a union will have the same
texture, apply the texture to the union.  That saves memory.

-- 
Rusty is rendering!


Post a reply to this message

From: Felix Wiemann
Subject: Re: Memory questions...
Date: 29 Mar 2002 13:52:24
Message: <mbd28a.q82.ln@linux.local>
Christopher James Huff wrote:
> If you are asking if unions also use the shared data method meshes
> use, the answer is no.
Why isn't that possible? Where is the difference to storing mesh data? 
(This is not a feature request, just a question :) )
Felix Wiemann


Post a reply to this message

From: Christopher James Huff
Subject: Re: Memory questions...
Date: 29 Mar 2002 15:43:56
Message: <chrishuff-F31D9C.15444729032002@netplex.aussie.org>
In article <mbd### [at] linuxlocal>,
 Felix Wiemann <Fel### [at] gmxnet> wrote:

> Why isn't that possible? Where is the difference to storing mesh data? 
> (This is not a feature request, just a question :) )

It is possible, it would just require redesigning and rewriting the 
code. Since a rewrite is planned already for POV-Ray 4.0, there isn't 
much point in doing it for 3.5.
One of the possible problems is that the parts of a union are 
individually transformable objects, while mesh data is a bunch of points 
that are never changed. When transforming a union, I think the current 
version of POV transforms the individual objects contained in it. 
Storing a reference to the data would mean no union could modify the 
data, so would have to store its own transforms. Slightly slower.
A better solution might be a proxy or clone object that is simply a 
wrapper for a pointer to another object and some object-specific 
information. That way, you could use this object to get 
copy-by-reference when necessary without the speed penalty for normal 
use.

-- 
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/


Post a reply to this message

From: Warp
Subject: Re: Memory questions...
Date: 29 Mar 2002 17:35:01
Message: <3ca4ec15@news.povray.org>
Christopher James Huff <chr### [at] maccom> wrote:
> When transforming a union, I think the current 
> version of POV transforms the individual objects contained in it. 

  Note that this transformation is optimized for many primitives.
For example, translating, rotating or scaling uniformly a sphere does not
add a transformation matrix to the sphere, but just modifies its center
point and radius as needed.

-- 
#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

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