|
|
"jr" <cre### [at] gmailcom> wrote:
>
> #macro mkPigment(i_)
> pigment {image_map {jpeg concat("my image ",str(i_,0,0)," example.jpg")
> interpolate 2}}
> #end
>
Oops, I just noticed the difference between this macro and my array idea-- the
macro doe not actually pre-#declare the image, whereas the array does. The main
reason for the initial ARRAY is that it essentially #declares all of the images
at the outset-- and its main 'reason for being' is that the various images might
be used *repetitively* in a scene (which I forgot to mention!) Pre-#declaring
the images saves a tremendous amount of RAM memory later, when the array
elements are called. Their repetitions are essentially 'instances' of the
image_maps, with little to no increase in memory use. The macro, on the other
hand, would load the image into memory every time it's invoked.
For the macro, I came up with a slight change which *might* make it work
likewise... but I don't think so:
#macro mkPigment(i_)
#declare IMG =
pigment {image_map {jpeg concat("my image ",str(i_,0,0)," example.jpg")
interpolate 2}}
IMG
#end
That would just re-#declare the image for each macro call, with the same(?)
memory increase...unless each 'newly-#declared' identical IMG just takes the
place of the previous one in memory?
Post a reply to this message
|
|