POV-Ray : Newsgroups : povray.newusers : Out of memory : Re: Out of memory Server Time
28 Apr 2024 00:04:30 EDT (-0400)
  Re: Out of memory  
From: Thomas de Groot
Date: 1 Dec 2014 03:34:38
Message: <547c281e$1@news.povray.org>
On 1-12-2014 2:17, zoli0726 wrote:
> Hi!
>
> I could appreciate some help, because im stuck.
>
> I want to render about 2 million spheres and about 10 million cone-s which
> connecting them on a scene, but the parser fills all of my memory (16gb). I have
> every sphere individually in the pov file, because their coordinate and color
> are different. It doesnt matter which quality im using because i cant even pass
> the parsing.
> Is there any good method to reduce memory usage, or the only option is more
> memory?
>
> Thanks.
>
>

If all the sphere and cone definitions are also written individually, 
that is overkill. Better define one single sphere and one single cone at 
the origin, and make instances of them, only reading locations and 
colours sequentially from the file. That way POV-Ray only needs to keep 
one single object in memory. However, you would then need also some 
scale and rotation values in your file for connecting the instances. 
Still, that is the best solution to my mind.

Short example (without the needed scale and rotation parameters):

//start code
#declare MySphere = sphere {<0,0,0>, 1}
#declare MyCone = cone {<0,0,0>, 1, <0,1,0>, 0.5}

#fopen MyFile "SphereAndCone.inc" read

#while (defined (MyFile))
   #read {MyFile, Spherelocation, Spherecolour, ConeLocation, ConeColour)
   object {MySphere pigment {SphereColour} translate SphereLocation}
   object {MyCone pigment {ConeColour} translate ConeLocation}
#end

#fclose MyFile
//end code

Thomas


Post a reply to this message

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