POV-Ray : Newsgroups : povray.programming : sphere memory : Re: sphere memory Server Time
28 Jul 2024 08:23:33 EDT (-0400)
  Re: sphere memory  
From: Niki Estner
Date: 30 Aug 2002 04:17:56
Message: <3d6f2a34@news.povray.org>
This question may be dumb, but why does a sphere need a bounding box? It
isn't used during rendering, is it?
Also, why does an ellipsoid need a center and a readius? The light ray must
be transformed into "sphere space"
anyway, couldn't center and radius be done right with that, too
(scale+translate of unity sphere)? If I say all my spheres share one
texture, couldn't I save some of the pointers for texture, interior,...?
That was basically the idea when I started to think about my "sphere_mesh".
I began to implement it, it needs one transformation per sphere (as already
said, 2x4x4x8 bytes). Unfortunately, my spheres don't use e
vista/light-buffer anymore of course, which makes them quite slow. I read
(in the vlbuffer comments) that the triangle-mesh and blob objects have
their own "vista-buffering-like" optimizations. Both objects are too slow
for me, but I'll take a deep look at the mesh-bounding-trees, I guess.
Now, finally, the last dumb question: All matrices are 4x4, while only 4x3
is needed (3x3 transformation matrix plus 3x1 translation vector). Couldn't
I store the matrices in 4x3 format, "unpacking" them when needed (64 bytes
per sphere)? Also, I could try to store the matrix with floats instead of
doubles (another 96 bytes).

All this doesn't make nice code, and it's no fun doing it anyway, so if
anyone got any better ideas for me, please tell me so.

Niki

"ABX" <abx### [at] abxartpl> schrieb im Newsbeitrag
news:uf3umuo52v40rumoc9smuvfnhr3lfim85r@4ax.com...
> On Fri, 30 Aug 2002 01:21:32 -0400, Mark Wagner <mar### [at] gtenet>
wrote:
> > or about 720 bytes per sphere.
>
> whole sphere structure in discussed example cause at least:
> - 11 pointers
> - 1 int
> - 1 unsigned long
> - 7 single float
> - 34 double float
>
> and it contains:
> - pointer to sphere and pointers to local structures
> - transformation
> - center and radius
> - bounding box vectors
> - other parameters
>
> I don't know how much of memory use vista buffer.
> I don't know how much of memory use other structures required for
rendering.
>
> ABX


Post a reply to this message

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