POV-Ray : Newsgroups : povray.general : parse vs. render stages, and best use of memory : Re: parse vs. render stages, and best use of memory Server Time
3 May 2024 15:37:34 EDT (-0400)
  Re: parse vs. render stages, and best use of memory  
From: clipka
Date: 28 Jan 2018 08:04:42
Message: <5a6dca6a@news.povray.org>
Am 28.01.2018 um 13:32 schrieb clipka:

Having looked at the code again, I must correct myself:

> Whenever an object instance is inserted into the scene, some additional
> instantiations may also happen. For instance, if a primitive does not
> have an explicit texture, a texture will be instantiated as a copy of
> either the containing CSG's texture or the default texture.

When a primitive inside a CSG has no texture, the parser will /not/
create a new texture instance. Rather, the contained primitive will
share the texture with the containing CSG.

>> To 'muddy the waters' a bit (or  maybe not?), add something simple like a random
>> scale to the texture, in the first-example #while loop (just a typical
>> 'conceptual' example of a change.) Does this cause the texture itself to be
>> re-evaluated every time, and/or to require more memory?
>>
>> #declare S = seed(123);
>> #declare C = 1;
>> #while(C <= 100000)
>> object{B texture (TEX scale .5 + .5*rand(S)} translate 1.1*C*x}
>> #declare C = C + 1;
>> #end
> 
> No change in memory consumption there: Even without the transformation
> of the texture a copy is currently created.

While this statement is technically true, that's only because the object
itself is translated, which constitutes an implicit translation of the
texture. If the texture is transformed anyway, that implict translation
is "fused" into the texture's transformation block.


Post a reply to this message

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