POV-Ray : Newsgroups : povray.programming : sphere memory : Re: sphere memory Server Time
28 Jul 2024 08:27:26 EDT (-0400)
  Re: sphere memory  
From: William F  Pokorny
Date: 30 Aug 2002 03:29:33
Message: <3D6F1EDD.815584CB@attglobal.net>
Mark & Niki,
I am sure some of the developers better know the numbers, but if you are willing
to listen to a relative newbie, here is how I see it.

I believe Pov-Ray uses a 4 by 4 matrix of doubles internally for each transform
of anything.  This would account for 16 x 16 = 256 bytes of what you see for
each sphere.  Guessing a little, but automatic bounds,  the light buffers and
vista buffers for half a million objects has to be pushing 256 bytes per object
- this you could actually test by turning these options off. If you try it, I
would not bother completing the render as the performance will be awful.  Just
those things  get us to 512 bytes per sphere.  Then we have the sphere itself at
4 x 16 = 64 bytes.  Probably at least 4 pointers at 4 bytes is another 16 bytes
a sphere. Let see that gets us to 592 bytes per sphere. Just to store the
calculated image for say an 800 x 600 render (Internally 3 x 16 bytes a pixel)
is about 46 bytes per sphere and there is bound to be pointers from each of
those screen locations to something for another 4 bytes per sphere.  That gets
us to 642 bytes a sphere.  I myself cannot account for the remaining 80 bytes
per sphere, but I would make a bet there are people here who know.

Mark, I think the doubling you saw when you individually textured is simply
because instead of storing one texture for all spheres you must now  store
500,000 and these texture structures. Even when textures are very, basic they
are not small and each will most probably be themselves transformed which means
pointers at the very least.

I guess I don't see this amount of storage as being that out of line - if
performance and reasonable accuracy are you goals.  I expect it is possible to
more compactly represent this data, but likely only at some performance expense
and code complexity.  Someone, in one of the Pov-Ray news groups, mentioned the
idea of an option to use floats everywhere instead of doubles to reduce storage.
Pov-Ray would run this way, but I doubt you would like the inaccuracies which
would be apparent in all but the simplest images.

Memory is reasonably priced these days - perhaps Pov-Ray costs something after
all! :-)
Bill P.


Post a reply to this message

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