POV-Ray : Newsgroups : povray.advanced-users : Reducing Memory load?? : Re: Reducing Memory load?? Server Time
29 Jul 2024 06:26:37 EDT (-0400)
  Re: Reducing Memory load??  
From: Warp
Date: 4 Oct 2002 10:09:20
Message: <3d9da110@news.povray.org>
Tom Melly <tom### [at] tomandlucouk> wrote:
> Killing cats time - why can't the memory optimisation used for meshes be applied
> to repeat use of all unions in general?

  Good question.
  AFAIK the answer is: Partly due to speed optimizations, partly due to
historic issues.

  The optimizations are related to transformations. For example, if you
have a union of spheres and you translate it by some amount, then instead
of adding a transformation matrix to the union, what povray does is to
modify the center of each sphere according to the translation. This
optimizes the rendering speed, as the need for using a transformation
matrix is eliminated in this case.
  Now suppose that you have declared a union of spheres and make two
instances of it, translating each one with a different amount. If the
two instances referenced the same data, it would go horribly wrong,
naturally: The translate in the first instantiation would modify the
center vectors, and then the translate of the second instantiation would
modify the same center vectors. Thus you will end up having both instances
of the union of spheres at the same place.

  Implementing the same referencing system as the one used in meshes would
disallow using this optimization and thus even the simplest transformations
would always need a transformation matrix to be created for each instance
(as is the case with meshes).
  I don't know, however, *how* much this would slow down in the average.
I would guess that it would not slow down the rendering almost at all
(it might even speed up the rendering due to less memory usage).

  Thus I think that this optimization could be dropped in favor of having
the memory usage optimization instead.

  And this is where the historic issues kick in: Since the core code of
POV-Ray has always worked this way, it would be somewhat laborious modifying
it.
  Perhaps pov4 will do differently.

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


Post a reply to this message

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