POV-Ray : Newsgroups : povray.animations : How to animate sub-region only Server Time
23 Nov 2024 12:14:16 EST (-0500)
  How to animate sub-region only (Message 1 to 8 of 8)  
From: sumdumguy
Subject: How to animate sub-region only
Date: 22 Nov 2008 03:50:01
Message: <web.4927c762fb7773f43b34ecfe0@news.povray.org>
I have a scene where only a small part gets changed frame to frame so I want to
render the first frame fully and then the following frames only for a selection
of rows and columns, automatically keeping the rest of the pixel values
unchanged from first frame. How do I do this?


Post a reply to this message

From: Chris B
Subject: Re: How to animate sub-region only
Date: 22 Nov 2008 04:56:26
Message: <4927d74a@news.povray.org>
"sumdumguy" <nomail@nomail> wrote in message 
news:web.4927c762fb7773f43b34ecfe0@news.povray.org...
>I have a scene where only a small part gets changed frame to frame so I 
>want to
> render the first frame fully and then the following frames only for a 
> selection
> of rows and columns, automatically keeping the rest of the pixel values
> unchanged from first frame. How do I do this?

I don't think there's a straightforward way of doing this. If your desire to 
do this is to save render time you may well find you expend more time 
developing a technique to glue all the bits together than you save when 
rendering. However, if you're driven by some other motive then there are a 
variety of approaches that spring to mind (all of which involve some 
external post-processing).

You don't say whether each of the subsequent frames would be an identical 
selection of rows and columns. If you want different rows and columns in 
each frame then you'd need to invoke POV-Ray from the command-line (e.g from 
a script) with different command-line options for each frame. Otherwise you 
could use one POV-Ray render for the first frame and an animation sequence 
(e.g. +kfi1 +kff100) to generate all the other frames.

There are partial animation command-line options, which may be of value to 
you (see +sc in the help). If the rows and columns you want to render from 
frame 2 are centred on the middle of frame 1, then you may find it easier to 
adjust the width and height (+w +h) and compensate using the up and right 
camera vectors (or the angle attribute), because then you don't have the 
post-processing effort required to isolate the rendered sections from the 
rest of the images.

Assembling the images into a single animation is always done outside of 
POV-Ray using whichever tool serves you best. The technique you develop 
would need to correspond with the capabilities of the utility you plan to 
use and the format you wish to generate. For example, the GIF constructor 
set (to build animated GIFs) allows you to retain a previous image and 
overlay a new partial image at a particular location, so this would probably 
lend itself to the technique of adjusting the width and height with the up 
and right vectors.

Regards,
Chris B.


Post a reply to this message

From: sumdumguy
Subject: Re: How to animate sub-region only
Date: 22 Nov 2008 05:20:01
Message: <web.4927dbb3efcfba633b34ecfe0@news.povray.org>
"Chris B" <nom### [at] nomailcom> wrote:
> "sumdumguy" <nomail@nomail> wrote in message
> news:web.4927c762fb7773f43b34ecfe0@news.povray.org...
> >I have a scene where only a small part gets changed frame to frame so I
> >want to
> > render the first frame fully and then the following frames only for a
> > selection
> > of rows and columns, automatically keeping the rest of the pixel values
> > unchanged from first frame. How do I do this?
>
> I don't think there's a straightforward way of doing this. If your desire to
> do this is to save render time you may well find you expend more time
> developing a technique to glue all the bits together than you save when
> rendering. However, if you're driven by some other motive then there are a
> variety of approaches that spring to mind (all of which involve some
> external post-processing).
>
> You don't say whether each of the subsequent frames would be an identical
> selection of rows and columns. If you want different rows and columns in
> each frame then you'd need to invoke POV-Ray from the command-line (e.g from
> a script) with different command-line options for each frame. Otherwise you
> could use one POV-Ray render for the first frame and an animation sequence
> (e.g. +kfi1 +kff100) to generate all the other frames.
>
> There are partial animation command-line options, which may be of value to
> you (see +sc in the help). If the rows and columns you want to render from
> frame 2 are centred on the middle of frame 1, then you may find it easier to
> adjust the width and height (+w +h) and compensate using the up and right
> camera vectors (or the angle attribute), because then you don't have the
> post-processing effort required to isolate the rendered sections from the
> rest of the images.
>
> Assembling the images into a single animation is always done outside of
> POV-Ray using whichever tool serves you best. The technique you develop
> would need to correspond with the capabilities of the utility you plan to
> use and the format you wish to generate. For example, the GIF constructor
> set (to build animated GIFs) allows you to retain a previous image and
> overlay a new partial image at a particular location, so this would probably
> lend itself to the technique of adjusting the width and height with the up
> and right vectors.
>
> Regards,
> Chris B.

My goal is indeed to save time.
Here is why +sc option is no good for me. If I use +sc options, the resulting
image will have the pixels I want and black pixels elsewhere. So far so good.
But the location of the "good" pixels within the total image will be different
from where they are in the first frame.
Suppose I have a 1280x1024 image and I want to render row 2 through 5 and
columns 2 through 5. Just a tiny patch. This will render fine and produce a
mostly black image whose size is 1280x1024. But the non-black patch will not be
between columns 2 and 5 and rows 2 and 5. It will be starting at row 1 and it
seems to be centered columnwise. So I cannot just use software to map black
pixels to 100% transparency and then paste the new image on top of frame 1.

The real problem is that for large images with tons of isosurfaces and
anti-aliasing, the speed per frame is ~2 hours on my computer. If I can animate
1/1000th of the image that changes, I can save days (actually weeks) of
rendering.


Post a reply to this message

From: Chris B
Subject: Re: How to animate sub-region only
Date: 22 Nov 2008 05:46:38
Message: <4927e30e$1@news.povray.org>
"sumdumguy" <nomail@nomail> wrote in message 
news:web.4927dbb3efcfba633b34ecfe0@news.povray.org...
> "Chris B" <nom### [at] nomailcom> wrote:
>> "sumdumguy" <nomail@nomail> wrote in message
>> news:web.4927c762fb7773f43b34ecfe0@news.povray.org...
>> >I have a scene where only a small part gets changed frame to frame so I
>> >want to
>> > render the first frame fully and then the following frames only for a
>> > selection
>> > of rows and columns, automatically keeping the rest of the pixel values
>> > unchanged from first frame. How do I do this?
>>
>> I don't think there's a straightforward way of doing this. If your desire 
>> to
>> do this is to save render time you may well find you expend more time
>> developing a technique to glue all the bits together than you save when
>> rendering.
>
> My goal is indeed to save time.
> Here is why +sc option is no good for me. If I use +sc options, the 
> resulting
> image will have the pixels I want and black pixels elsewhere. So far so 
> good.
> But the location of the "good" pixels within the total image will be 
> different
> from where they are in the first frame.
>
> Suppose I have a 1280x1024 image and I want to render row 2 through 5 and
> columns 2 through 5. Just a tiny patch. This will render fine and produce 
> a
> mostly black image whose size is 1280x1024. But the non-black patch will 
> not be
> between columns 2 and 5 and rows 2 and 5. It will be starting at row 1 and 
> it
> seems to be centered columnwise. So I cannot just use software to map 
> black
> pixels to 100% transparency and then paste the new image on top of frame 
> 1.
>
> The real problem is that for large images with tons of isosurfaces and
> anti-aliasing, the speed per frame is ~2 hours on my computer. If I can 
> animate
> 1/1000th of the image that changes, I can save days (actually weeks) of
> rendering.


Sounds like you're on 3.6, which indeed does what you describe.
I'm using 3.7 Beta 27 on Windows at the moment and that seems to place the 
pixels in the right place within the generated bmp image. It may be best and 
quickest to try the 3.7 Beta for this (You can still keep a copy of 3.6 
installed alongside it).

Regards,
Chris B.


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: How to animate sub-region only
Date: 23 Nov 2008 12:32:51
Message: <492993c2@news.povray.org>
sumdumguy wrote:
> Suppose I have a 1280x1024 image and I want to render row 2 through 5 and
> columns 2 through 5. Just a tiny patch. This will render fine and produce
> a mostly black image whose size is 1280x1024. But the non-black patch will
> not be between columns 2 and 5 and rows 2 and 5. It will be starting at
> row 1 and it seems to be centered columnwise.

It doesn't always do that. It depends on the file format.

For PNG, it will start on row 1, and a special field inside the PNG format
will say where that row should really be located.

> So I cannot just use 
> software to map black pixels to 100% transparency and then paste the new
> image on top of frame 1.

Use smarter software :) Put the rendered chunk in the correct place of the
frame 1 (you *know* what the correct place is, since you used it to tell
POV-Ray what to render).

If you map black pixels to transparency, wouldn't you have problems if the
rendered chunk has real black parts?


Post a reply to this message

From: Reactor
Subject: Re: How to animate sub-region only
Date: 23 Nov 2008 16:05:00
Message: <web.4929c565efcfba633c7bd44e0@news.povray.org>
"sumdumguy" <nomail@nomail> wrote:
> I have a scene where only a small part gets changed frame to frame so I want to
> render the first frame fully and then the following frames only for a selection
> of rows and columns, automatically keeping the rest of the pixel values
> unchanged from first frame. How do I do this?

Depending on what changes and what else is in the scene, you could render the
static background, then render the animated part without anything else around
and use the alpha channel to composite.  You may also be able to achieve this
even if there is some degree of scene interaction (such as reflections or cast
shadows) by using the no_image, no_shadow, and no_reflection modifiers.

Of course, if a 'background' object occludes the animated object at some point,
it would need to be re-rendered with it and composited also.  Furthermore,
using radiosity in your scene will depend on the locations of all objects
present, which means that trying this technique with radiosity will not look
like it should.  There is also the issue of shadows cast by your object...

Some of the above issues can be worked around by clipping the entire scene into
a small box that moves with the moving object and having the background alpha'd
for compositing.  If you lengthen this box along the axis of the camera, toward
the camera, this could also ease occlusion problems.  It may take some work to
get such a thing going, you may still save some time.


-Reactor


Post a reply to this message

From: sumdumguy
Subject: Re: How to animate sub-region only
Date: 23 Nov 2008 22:00:01
Message: <web.492a1787efcfba633b34ecfe0@news.povray.org>
"Reactor" <rea### [at] hotmailcom> wrote:
> "sumdumguy" <nomail@nomail> wrote:
> > I have a scene where only a small part gets changed frame to frame so I want to
> > render the first frame fully and then the following frames only for a selection
> > of rows and columns, automatically keeping the rest of the pixel values
> > unchanged from first frame. How do I do this?
>
> Depending on what changes and what else is in the scene, you could render the
> static background, then render the animated part without anything else around
> and use the alpha channel to composite.  You may also be able to achieve this
> even if there is some degree of scene interaction (such as reflections or cast
> shadows) by using the no_image, no_shadow, and no_reflection modifiers.
>
> Of course, if a 'background' object occludes the animated object at some point,
> it would need to be re-rendered with it and composited also.  Furthermore,
> using radiosity in your scene will depend on the locations of all objects
> present, which means that trying this technique with radiosity will not look
> like it should.  There is also the issue of shadows cast by your object...
>
> Some of the above issues can be worked around by clipping the entire scene into
> a small box that moves with the moving object and having the background alpha'd
> for compositing.  If you lengthen this box along the axis of the camera, toward
> the camera, this could also ease occlusion problems.  It may take some work to
> get such a thing going, you may still save some time.
>
>
> -Reactor

Yeah, I use radiosity and thing occlude each other. But holy jebus, 3.7 is so
fast. Thanks for that suggestion.


Post a reply to this message

From: Bryan Heit
Subject: Re: How to animate sub-region only
Date: 25 Nov 2008 09:39:29
Message: <492c0e21$1@news.povray.org>
sumdumguy wrote:
> I have a scene where only a small part gets changed frame to frame so I want to
> render the first frame fully and then the following frames only for a selection
> of rows and columns, automatically keeping the rest of the pixel values
> unchanged from first frame. How do I do this?
> 
> 

I've done something like this; basically an image in a TV with a static 
scene around it.

Easiest method I've found is to render the moving part as a separate 
file, and then blue-screen/overlay/chromakey/... it into the final 
animation using whatever video editing software you prefer.

Bryan


Post a reply to this message

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