POV-Ray : Newsgroups : povray.programming : sphere memory : Re: sphere memory Server Time
28 Jul 2024 08:36:15 EDT (-0400)
  Re: sphere memory  
From: Niki Estner
Date: 29 Aug 2002 17:57:49
Message: <3d6e98dd@news.povray.org>
I guess this is the wrong newsgroup then, but if you would like to answer,
I'd be pleased anyway. Otherwise I'd post to the advanced-users group.

Posting the whole scene doesn't make much sense since it contains some
height fields, image maps... Too large to post.

But if I create another scene which contains not much more than:

union {

#declare i=0;

#while (i<500000)

sphere { <i*0.01,i*0.02,i*0.03>, 0.04 scale <0.5,0.6,0.7> rotate
<i,i*2,i*3> }

#declare i=i+1;

#end

pigment { colour Red }

}

memory is full as well. I didn't wait for the parser to finish, but with
100,000 spheres, povray needs about 100 MB of memory! (measured with the
physical memory indicator of the W2K task manager).

Is there something wrong with that code? I thought putting the spheres into
a union was a good idea, so they all share one pigment. Also, the texture is
quite simple, as you can see.

Niki

"Niki Estner" <nik### [at] freenetde> schrieb im Newsbeitrag
news:3d6c8f20@news.povray.org...
> Hi there,
>
> For the images I am making I need lots of tiny, simple objects: grass,
hair,
> particle systems can be simulated with these.
> Unfortunately, if I have 500,000 spheres or more, main memory seams to be
> completely full, and PovRay is constantly swapping during the render (and
it
> takes about 30 min to get to the first pixel - I didn't even wait for the
> second). I got 256 mb of main memory, and I think 500,000 spheres should
fit
> in there. (of course there are other objects too in the scene, but then,
> what's a sphere in bytes?)
> I tried to use triangle meshes: these do use less memory, but they take
much
> longer to render, which is, essentially, the point.
> Anyway my idea was to make something like a "sphere mesh": a thing that
does
> the same as a union of spheres, but with less memory used. I think I need
> only 12*8 bytes per sphere (transformation matrix plus translation
vector).
> My question is: Do you think this is a good idea? If yes, why hasn't
anyone
> done it before? If not, well, why not?
> Has anybody tried anything similar? Any advices? I would just have
analyzed
> what a union of spheres does (maybe with the debugger) and tried to do the
> same with a different memory layout, and without virtual functions...
>
> Niki
>
>


Post a reply to this message

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