POV-Ray : Newsgroups : povray.general : Mesh2 instancing? Server Time
2 Aug 2024 04:25:32 EDT (-0400)
  Mesh2 instancing? (Message 1 to 3 of 3)  
From: Tim Nikias
Subject: Mesh2 instancing?
Date: 23 Jan 2005 11:34:40
Message: <41f3d220@news.povray.org>
So, I know that POV-Ray will, when declaring a mesh and re-using it several
times over, not create several copies of the mesh in the memory, but rather
create one mesh and just store pointers to it for further instances.

Does that still hold true when the mesh2 is saved within an array? I've got
a 2D-Array which stores several mesh2 objects, which I reuse several
thousand times to create hair/fur. Now, memory consumption doesn't look like
it's just placing pointers, unless these pointers are rather large to carry
all kinds of informations...

My "furry fellow" image in p.b.i. used 74 hairs to place 5300 hairs, and it
used 18MB peak memory. The latest test place 30.000 hairs using those same
74 base-hairs, and I had 70MB peak memory. That'd be roughly 50MB additional
data for 25.000 hairs. The hairs are placed in a union and that union gets a
texture, so as I understand it, the texure-information shouldn't be saved
for each hair, but I'm no expert on POV-Ray's mechanics. Any clues?

Of course, if the mesh2-pointer/instancing-thingy doesn't work when used
with arrays, the entire work is only a speed-up on the parsing (no need to
parse 30.000 individual hairs), but not on the memory, which was the main
goal...

Thanks in advance for any insight someone can give,
Tim

-- 
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message

From: Slime
Subject: Re: Mesh2 instancing?
Date: 23 Jan 2005 13:37:37
Message: <41f3eef1$1@news.povray.org>
> My "furry fellow" image in p.b.i. used 74 hairs to place 5300 hairs, and
it
> used 18MB peak memory. The latest test place 30.000 hairs using those same
> 74 base-hairs, and I had 70MB peak memory. That'd be roughly 50MB
additional
> data for 25.000 hairs.

Well, there is, of course, a *little* additional memory usage for copying a
mesh. To see if the entire mesh data is being recopied, try greatly
increasing the mesh complexity and then running your experiment again, and
see if it increases the peak memory proportionally or only by a little.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Tim Nikias
Subject: Re: Mesh2 instancing?
Date: 23 Jan 2005 16:06:09
Message: <41f411c1$1@news.povray.org>
> Well, there is, of course, a *little* additional memory usage for copying
a
> mesh. To see if the entire mesh data is being recopied, try greatly
> increasing the mesh complexity and then running your experiment again, and
> see if it increases the peak memory proportionally or only by a little.

I've just checked and placed 30.000 individual hairs. That used 254 MB and a
few seconds less rendering time, so it seems to work... I guess there's just
more data to be saved (matrix transformations, maybe the texture, some other
overhead stuff because it's in a union?) than I anticipated.

If someone with technical insight could clarify this (because I'm curious)
and, if possible, tell me the memory-wise best solution (e.g. placing the
hairs in a union and texturing that, or texturing the hair right when it's
declared, or placing the hairs outside of a union, etc), I'd appreciate it!

Regards,
Tim

-- 
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message

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