POV-Ray : Newsgroups : povray.advanced-users : Povtree macro (mesh created at parsing whith loops) seems to waste memory : Re: Povtree macro (mesh created at parsing whith loops) seems to waste memory Server Time
24 Apr 2024 22:22:52 EDT (-0400)
  Re: Povtree macro (mesh created at parsing whith loops) seems to waste memory  
From: clipka
Date: 19 Jul 2018 15:46:03
Message: <5b50ea7b$1@news.povray.org>
I'm not sure I understand your explanation of what you're doing, so
here's my understanding of it, so that you can correct me if I'm wrong:

- You have a scene that "plants" trees using `object{TREE...}` in a loop.

- Previously, `TREE` was defined as a single `mesh` or `mesh2`,
generated by an external tool, and all was reasonably well.

- Now, you have changed the definition of `TREE` to... something else.

Here's where my understanding falters, but judging from snippets of your
explanation and most of all the symptoms I'm going out on a limb here:
Your new definition is /not/ a single `mesh` or `mesh2` object, but a
CSG compound object, right?


Now here's the catch: When you instantiate any primitive or compound
object in POV-Ray using `object{FOO}`, POV-Ray creates a COPY of the
object in question.

For most primitives and compound objects, this means the memory
requirements are doubled.

Only a handful of inherently memory-intensive primitives - such as
meshes, blobs and height fields - share their bulk data among copies,
thus allowing for a reduced memory footprint despite high number of
copies. Unions and other CSG compounds - although potentially
memory-intensive as well, depending on their complexity - do not fall
into this category.


So the exceptional thing here is not the new memory-heavy version, but
rather the old memory-lean version. And that is simply due to the copied
object happening to be a mesh there.


Post a reply to this message

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