POV-Ray : Newsgroups : povray.binaries.animations : Uberpov persistent feature for animation of big scene Server Time
28 Mar 2024 08:59:26 EDT (-0400)
  Uberpov persistent feature for animation of big scene (Message 11 to 14 of 14)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Kenneth
Subject: Re: Uberpov persistent feature for animation of big scene
Date: 7 Jan 2018 21:55:00
Message: <web.5a52dd016e53ffa4a47873e10@news.povray.org>
By the way, I should have remembered some previous comments about UberPOV's
#persistent variables from here...

http://news.povray.org/povray.animations/thread/%3Cweb.565084806f515a457a3e03fe0%40news.povray.org%3E/

It's hard to keep all of this stuff in my head, but I'm trying ;-)


Post a reply to this message

From: Kenneth
Subject: Re: Uberpov persistent feature for animation of big scene
Date: 8 Jan 2018 21:25:00
Message: <web.5a5427b66e53ffa4a47873e10@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Kenneth" <kdw### [at] gmailcom> wrote:
>
> > I never realized that a macro's result-- object(FOO)-- was a global variable
> > that remained 'alive' in a scene once the macro was invoked.
>
> It has to be, since macros "spit thing out" to be used outside of the macro.
>

Yes, I do grasp that; I think I probably wasn't being very clear with my
questions. What I meant was, I wonder if a macro can actually 'cache' its
contents for use in a scene (not for animation, but just in a regular static
scene.) An example would be this...

#macro MyMacro()
#ifndef(FOO)
#local FOO = pigment{image_map{png "MY_IMAGE.png"}} // #local, not #declare
#else
#end
pigment{FOO}
#end

#for(i,1,10000)
box{0,1
   pigment{MyMacro()}
   translate i*x
}
#end

Would this *re-load* the image_map 10,000 times into memory... or would it load
only once and 'instantiate' the image_map 9,999 times, with MUCH less memory
use? I guess I need to do an experiment to find out.


Post a reply to this message

From: clipka
Subject: Re: Uberpov persistent feature for animation of big scene
Date: 9 Jan 2018 11:54:04
Message: <5a54f3ac$1@news.povray.org>
Am 09.01.2018 um 03:23 schrieb Kenneth:

> #macro MyMacro()
> #ifndef(FOO)
> #local FOO = pigment{image_map{png "MY_IMAGE.png"}} // #local, not #declare
> #else
> #end
> pigment{FOO}
> #end
> 
> #for(i,1,10000)
> box{0,1
>    pigment{MyMacro()}
>    translate i*x
> }
> #end
> 
> Would this *re-load* the image_map 10,000 times into memory... or would it load
> only once and 'instantiate' the image_map 9,999 times, with MUCH less memory
> use? I guess I need to do an experiment to find out.

It would load it 10,000 times; local variables are ditched after every
macro invocation.


Post a reply to this message

From: Kenneth
Subject: Re: Uberpov persistent feature for animation of big scene
Date: 10 Jan 2018 12:10:04
Message: <web.5a56479d6e53ffa4a47873e10@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:

>
> It would load it 10,000 times; local variables are ditched after every
> macro invocation.

OK, that makes sense now. #Local is always 'local', regardless of the #ifndef
block. Got it. Thanks.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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