POV-Ray : Newsgroups : povray.general : Out of memory errors : Re: Out of memory errors Server Time
7 Aug 2024 19:20:23 EDT (-0400)
  Re: Out of memory errors  
From: Warp
Date: 14 Jul 2001 17:11:05
Message: <3b50b569@news.povray.org>
Mike Metheny <lon### [at] vtedu> wrote:
: So the question is, how do I go about rendering something like this?  I'm
: quite upset with POV, it really really sucks up all resources, even in
: win2k, which has good memory management.

  "Good memory management" doesn't mean that there's more memory available.
In fact, win2k uses unbelievable amounts of memory for nothing. If you want
to get more memory available you should use an OS which isn't such a memory
hog.

  Anyways, your problem is probably that you are making too many instances
of a too large item. Specially if each sphere has its own texture, you are
just hogging the memory very effectively. If there are too many, no OS can
help if it fills physical memory and swap space.

  Whether or not you can optimize the scene to take less memory or not
depends on how the spheres are arranged.
  If the spheres are arranged totally randomly, without any repeating
patterns, there's little one can do (except not wasting memory by giving
each sphere its own texture).

  If some spheres form a group and this group is then copied several times
to form a larger structure, then you are in luck.
  If this is the case, the answer is making a mesh.
  POV-Ray is surprisingly efficient with meshes. I once made a test where
I made a mesh object with more than 100000 smooth triangles in it and then
copied it many times so that the total number of triangles in the scene was
more than 31 millions (about half of the triangles were visible in the image
in some way or another).
  POV-Ray reported a peak memory usage of only 20 Megs, and the scene
rendered (with three light sources) at 640x480 in just 1 minute.

  So if you have a (preferably big) group of spheres, what you should do is
to create the spheres with smooth triangles (you can use quite a lot triangles
to do it) and put them in a mesh. Then you can copy this mesh exactly as you
would do with a union of real spheres.
  Don't make the mistake of making a mesh with one sphere and copy this mesh,
because that will not help you at all. Only when you can group lots of spheres
inside the same mesh and then copy this bigger group is when you'll start
getting advantages.

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


Post a reply to this message

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