POV-Ray : Newsgroups : povray.advanced-users : Reducing Memory load?? Server Time
29 Jul 2024 08:18:18 EDT (-0400)
  Reducing Memory load?? (Message 1 to 10 of 10)  
From: Obliterous
Subject: Reducing Memory load??
Date: 3 Oct 2002 19:05:09
Message: <web.3d9ccbcc2b42ab93a2104d940@news.povray.org>
I'm runing imto a problem... Mot enough Memory in My system...SO..

Is there a way to load a triangle-mesh object only once, and be able to use
it repeatedly, without the massive increase on memory costs that would be
associated with this example??

object {
#include "plant07.inc"
translate <10,6,32>
scale <1,2,1>
}


I need close to a hundred of these object, and the memory overhead is
cripling My scene....


Please, I need help here....

Also, please copy/paste replies to My E-mail... obl### [at] hotmailcom


Post a reply to this message

From: Slime
Subject: Re: Reducing Memory load??
Date: 3 Oct 2002 19:06:55
Message: <3d9ccd8f$1@news.povray.org>
#declare myplant = object{#include "plant07.inc"};

object{myplant}
object{myplant}
object{myplant}
object{myplant}
...

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


Post a reply to this message

From: Warp
Subject: Re: Reducing Memory load??
Date: 4 Oct 2002 07:52:41
Message: <3d9d8108@news.povray.org>
Slime <slm### [at] slimelandcom> wrote:
> #declare myplant = object{#include "plant07.inc"};

> object{myplant}

  Note that this will work (for saving memory) only if "plant07.inc" has
a mesh. If it has a union of triangles (as some older programs create),
it won't help.
  Fortunately if this is the case, you can usually replace the word 'union'
with 'mesh' and that's it.

-- 
#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: Tom Melly
Subject: Re: Reducing Memory load??
Date: 4 Oct 2002 09:50:03
Message: <3d9d9c8b@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message news:3d9d8108@news.povray.org...
>
>   Note that this will work (for saving memory) only if "plant07.inc" has
> a mesh. If it has a union of triangles (as some older programs create),
> it won't help.
>   Fortunately if this is the case, you can usually replace the word 'union'
> with 'mesh' and that's it.
>

Killing cats time - why can't the memory optimisation used for meshes be applied
to repeat use of all unions in general?


Post a reply to this message

From: Micha Riser
Subject: Re: Reducing Memory load??
Date: 4 Oct 2002 10:02:01
Message: <3d9d9f57@news.povray.org>
Tom Melly wrote:

> 
> Killing cats time - why can't the memory optimisation used for meshes be
> applied to repeat use of all unions in general?

AFAIR this has already been discussed - search a bit through old news. 
While this would certainly been possible, it is probably is difficult to 
add this to the current pov code (AFAIK somebody already tried it). E.g. 
consider that meshs have their own internal boundingbox hirarchy. If you 
still would have a boundingbox for each primitive the memory saving would 
not be big.

So we can hope for POV 4.0

-- 
objects.povworld.org - The POV-Ray Objects Collection
book.povworld.org    - The POV-Ray Book Project


Post a reply to this message

From: Warp
Subject: Re: Reducing Memory load??
Date: 4 Oct 2002 10:09:20
Message: <3d9da110@news.povray.org>
Tom Melly <tom### [at] tomandlucouk> wrote:
> Killing cats time - why can't the memory optimisation used for meshes be applied
> to repeat use of all unions in general?

  Good question.
  AFAIK the answer is: Partly due to speed optimizations, partly due to
historic issues.

  The optimizations are related to transformations. For example, if you
have a union of spheres and you translate it by some amount, then instead
of adding a transformation matrix to the union, what povray does is to
modify the center of each sphere according to the translation. This
optimizes the rendering speed, as the need for using a transformation
matrix is eliminated in this case.
  Now suppose that you have declared a union of spheres and make two
instances of it, translating each one with a different amount. If the
two instances referenced the same data, it would go horribly wrong,
naturally: The translate in the first instantiation would modify the
center vectors, and then the translate of the second instantiation would
modify the same center vectors. Thus you will end up having both instances
of the union of spheres at the same place.

  Implementing the same referencing system as the one used in meshes would
disallow using this optimization and thus even the simplest transformations
would always need a transformation matrix to be created for each instance
(as is the case with meshes).
  I don't know, however, *how* much this would slow down in the average.
I would guess that it would not slow down the rendering almost at all
(it might even speed up the rendering due to less memory usage).

  Thus I think that this optimization could be dropped in favor of having
the memory usage optimization instead.

  And this is where the historic issues kick in: Since the core code of
POV-Ray has always worked this way, it would be somewhat laborious modifying
it.
  Perhaps pov4 will do differently.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Tom Melly
Subject: Re: Reducing Memory load??
Date: 4 Oct 2002 12:14:33
Message: <3d9dbe69@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message news:3d9da110@news.povray.org...

<snip>

Many thanks...

BTW as a point of netiquette, if all one wants to do is say "many thanks", do
you do it, or just not reply and hope that the poster realises that your
gratitude is boundless?

Silly question, I know, but it always seems so lame - one up from "me too", but
only just...


Post a reply to this message

From: Christopher James Huff
Subject: Re: Reducing Memory load??
Date: 4 Oct 2002 13:58:13
Message: <chrishuff-B261F0.13545304102002@netplex.aussie.org>
In article <3d9d9c8b@news.povray.org>, "Tom Melly" <tom### [at] tomandlucouk> 
wrote:

> Killing cats time - why can't the memory optimisation used for meshes be 
> applied to repeat use of all unions in general?

The way it is implemented for meshes is very specific to meshes. It 
wasn't implemented more generally because it wasn't as necessary for 
other objects, the biggest improvement came for meshes. It hasn't been 
added because doing so would be quite difficult with the existing source 
code.
It could easily be added in a redesign and rewrite, though. Such a 
rewrite is planned for 4.0.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Warp
Subject: Re: Reducing Memory load??
Date: 4 Oct 2002 15:38:53
Message: <3d9dee4d@news.povray.org>
Tom Melly <tom### [at] tomandlucouk> wrote:
> BTW as a point of netiquette, if all one wants to do is say "many thanks", do
> you do it, or just not reply and hope that the poster realises that your
> gratitude is boundless?

  IMHO it's always ok to thank someone. :)

-- 
#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: ABX
Subject: Re: Reducing Memory load??
Date: 7 Oct 2002 07:39:32
Message: <7np2qu02gv5q0u1p7u5obkpc0cvcpj31u5@4ax.com>
On Fri, 4 Oct 2002 14:50:03 +0100, "Tom Melly" <tom### [at] tomandlucouk> wrote:
> Killing cats time - why can't the memory optimisation used for meshes be applied
> to repeat use of all unions in general?

I have tried it once but found some limitations. It was a little slower so I
dropped that solution temporary but it is one of patches I still plan to
implement in 3.5.

ABX


Post a reply to this message

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