POV-Ray : Newsgroups : povray.advanced-users : Animations and memory Server Time
22 Dec 2024 17:02:49 EST (-0500)
  Animations and memory (Message 1 to 4 of 4)  
From: Mike Horvath
Subject: Animations and memory
Date: 15 Aug 2015 14:11:30
Message: <55cf80d2$1@news.povray.org>
If I create an animation where everything remains the same except for 
the camera position, will I have to go through the whole parsing process 
each time, or will the scene stay in memory and therefore be faster?


Mike


Post a reply to this message

From: clipka
Subject: Re: Animations and memory
Date: 16 Aug 2015 03:40:07
Message: <55d03e57$1@news.povray.org>
Am 15.08.2015 um 20:11 schrieb Mike Horvath:
> If I create an animation where everything remains the same except for
> the camera position, will I have to go through the whole parsing process
> each time, or will the scene stay in memory and therefore be faster?

That depends.

If you use plain vanilla POV-Ray, then IIRC there's some highly 
experimental mechanism originally designed just for this case, parsing a 
scene once with multiple camera statements and then just iterating 
through all the cameras defined, frame by frame, but I must confess I 
have no idea how it works (or whether it even does currently).

If you use UberPOV, there's the "#persistent" statement, which you can 
use instead of "#declare" to define variables that persist between 
frames of an animation (and, in case of POV-Ray for Windows, even 
between totally unrelated renders in the same session, so caveat there) 
as long as you don't explicitly "#undef" them. You can put (almost) 
anything in there - including complex CSG unions - and simply re-use it 
in the next frame instead of parsing it all over again, for example like so:

     my_scene.pov:
     -------------------------
       #if((frame_number = initial_frame) | !defined(MyHugeObject))
       #include "my_huge_object.inc"
       #end

       object { MyHugeObject }

       #if(frame_number = final_frame)
       #undef MyHugeObject
       #end
     -------------------------

     my_huge_object.pov:
     -------------------------
       #persistent MyHugeObject = union {
       ...
       }
     -------------------------


Post a reply to this message

From: Mike Horvath
Subject: Re: Animations and memory
Date: 30 Aug 2015 01:20:02
Message: <55e29282$1@news.povray.org>
On 8/16/2015 3:40 AM, clipka wrote:
> Am 15.08.2015 um 20:11 schrieb Mike Horvath:
>> If I create an animation where everything remains the same except for
>> the camera position, will I have to go through the whole parsing process
>> each time, or will the scene stay in memory and therefore be faster?
>
> That depends.
>
> If you use plain vanilla POV-Ray, then IIRC there's some highly
> experimental mechanism originally designed just for this case, parsing a
> scene once with multiple camera statements and then just iterating
> through all the cameras defined, frame by frame, but I must confess I
> have no idea how it works (or whether it even does currently).
>
> If you use UberPOV, there's the "#persistent" statement, which you can
> use instead of "#declare" to define variables that persist between
> frames of an animation (and, in case of POV-Ray for Windows, even
> between totally unrelated renders in the same session, so caveat there)
> as long as you don't explicitly "#undef" them. You can put (almost)
> anything in there - including complex CSG unions - and simply re-use it
> in the next frame instead of parsing it all over again, for example like
> so:
>
>      my_scene.pov:
>      -------------------------
>        #if((frame_number = initial_frame) | !defined(MyHugeObject))
>        #include "my_huge_object.inc"
>        #end
>
>        object { MyHugeObject }
>
>        #if(frame_number = final_frame)
>        #undef MyHugeObject
>        #end
>      -------------------------
>
>      my_huge_object.pov:
>      -------------------------
>        #persistent MyHugeObject = union {
>        ...
>        }
>      -------------------------
>

How will this work for highly nested objects, like LDraw models? Do I 
make each and every primitive persistent?


Mike


Post a reply to this message

From: clipka
Subject: Re: Animations and memory
Date: 30 Aug 2015 13:03:01
Message: <55e33745$1@news.povray.org>
Am 30.08.2015 um 07:20 schrieb Mike Horvath:

>>      my_scene.pov:
>>      -------------------------
>>        #if((frame_number = initial_frame) | !defined(MyHugeObject))
>>        #include "my_huge_object.inc"
>>        #end
>>
>>        object { MyHugeObject }
>>
>>        #if(frame_number = final_frame)
>>        #undef MyHugeObject
>>        #end
>>      -------------------------
>>
>>      my_huge_object.pov:
>>      -------------------------
>>        #persistent MyHugeObject = union {
>>        ...
>>        }
>>      -------------------------
>>
> 
> How will this work for highly nested objects, like LDraw models? Do I
> make each and every primitive persistent?

Nope - that's the beauty of it: You just make the "root" object
persistent, and it remembers the whole hierarchy.


Post a reply to this message

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