POV-Ray : Newsgroups : povray.newusers : Out of memory : Re: Out of memory Server Time
28 Apr 2024 05:22:17 EDT (-0400)
  Re: Out of memory  
From: Le Forgeron
Date: 1 Dec 2014 10:01:28
Message: <547c82c8$1@news.povray.org>
Le 01/12/2014 09:34, Thomas de Groot a écrit :
> 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.
> 

It would work with meshes, but referencing a true sphere just make a
copy of it (well, if the texture is the same, that might save you the
texture block, but the transformation will be duplicated anyway, or
rather overwritten on the copy).

Swapping memory is free... sort of, it comes at the cost of a crawling
system.

Now, I would call for a sanity check, because not all spheres and cones
are to be visible on a picture of less than 12 megapixels. You need at
least one pixel per object for such scene to be useful... or you expect
a lot of reflection & refraction.



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


-- 
Just because nobody complains does not mean all parachutes are perfect.


Post a reply to this message

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