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
19 Apr 2024 06:08:31 EDT (-0400)
  Re: parse vs. render stages, and best use of memory  
From: Kenneth
Date: 26 Jan 2018 21:40:01
Message: <web.5a6be5dca3012ab7a47873e10@news.povray.org>
Alain <kua### [at] videotronca> wrote:
>
> In your example of many objects sharing a single texture, you can save a
> *LOT* of memory by grouping them into an union and applying the texture
> to the whole union at once :
> union{
>   #declare C = 1;
>   #while(C <= 100000)
>   object{B translate 1.1*C*x}
>   #declare C = C + 1;
>   #end
> texture { TEX }
> }
>
> This way, you only have a single texture instead of 100000 whole textures.
>

A good idea; I didn't take that into account. (Another example of the 'endless
permutations' to consider!) But my own example was purposely designed with
100000 same-textured items that are then individually moved (or scaled, or
rotated, or...)-- as an example of how that single 'change' may or may not
impact parse time and memory usage. And this particular object/texture/loop
example is just one of hundreds of similar situations that might arise while
coding a scene. It's not clear to me what (if any) impact such 'minor' changes
might have.

BTW, another example would be MEDIA. I *think* it's evaluated during the render
stage rather than the parse stage-- negating any particular advantage of
pre-#declareing such a media object beforehand to save memory, when it's used
multiple times in a scene. But I don't know for sure.


Post a reply to this message

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