How to reduce render time for masked bitmaps?

Wondering how to accomplish a certain animation task? Ask here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
Rasheed
Posts: 2008
Joined: Tue May 17, 2005 8:30 am
Location: The Netherlands

How to reduce render time for masked bitmaps?

Post by Rasheed »

I made this sample animation (291 QT DivX):
dinosaur.mov
using this Moho file and PNGs:
http://www.myfilestash.com/userfiles/Ra ... r.moho.zip

The PNG files were created this way:
1) export the vector drawing in Moho as a PSD file
2) import the PSD file in an image editor (Photoshop, Gimp etc.) and create for each layer a new layer (same name, but ".png" added)
3) create the textures in the new layers, using the old layers as templates
4) export each newly created layer as PNG image file (use the layer name as file name)

Now the vector and corresponding PNG image layers were co-translated, rigged with bones in a single bone layer and reassembled using the Offset Bones tool. Each vector layer had its corresponding image PNG layer just above it in the layers panel. In the bone layer masking made everything invisible, while each vector layer got the mask option clear the mask and add this layer to the mask.

Next the character was animated for one walk cycle, which was repeated and translated and some other stuff with the tree, but that doesn't matter here.

The point is, that it takes a very long time to render this Moho file as an animation.

Is there a particular reason why this Moho file takes such a long time to render (appr. 15 minutes for only 173 frames on my 1.25 Mhz G4 processor)?

Even using PNG files only (in layers) takes a very long render time, compared to vectors only. And because you can't see outlines from imported images in union skinning, I think the masked bitmaps trick is much more versatile than using only images, as in the animGIF below.
Image
tim worsfold
Posts: 13
Joined: Mon Dec 06, 2004 10:14 am
Location: London, UK

Post by tim worsfold »

I hate to say it, but 15 minutes render time actually sounds quite fast to me. I've recently been doing a project that has taken about 2 hours to render (on a 1GHz G4) and is about 300 frames long.

The problem seems to come with PNG files. If you can get away with not having transparency, try using BMP files. Try also reducing the size of the bitmaps to the bare minimum. Apart from that, there's little else you can do, unless you go for a vector-only approach, which would probably be 10 times quicker or more.

Another trick would be to do your test runs checking the 'render at half dimensions' and 'render at half frame rate' boxes, which speeds things up considerably. You could then do the final render at full-size. Minimising the preview window during rendering also speeds things up by a fair bit.
Toontoonz
Posts: 763
Joined: Fri Mar 25, 2005 9:28 pm

Post by Toontoonz »

I render animations with PNG files quite a bit and don´t have a problem with rendering times.

I think you need to do a bit more experimenting before attributing it solely on any PNG file.

Your long rendering times are usually a combination of lots of things - and the main culprit is when one uses a mask on any one or more layers and/or adding particles to the animation.

For example: I created the test lava flow animations at this Water Tutorial forum:
http://www.lostmarble.com/forum/viewtopic.php?t=1956
Their are no png files involved, just vectors. But there are several masked layers plus several particle layers. To render the 72 frames took almost 30 minutes. (!)

As a test of your png files and the render time, do a simple animation of a vector object moving across the screen vs. the same animation with an appopriately sized png file. What is the difference in render times?

(Could it be that since you are both using Macs that´s the reason there is a problem with render times? I think I recall reading in other forums where Mac computer people were having speed-related problems with Moho.)
User avatar
Rasheed
Posts: 2008
Joined: Tue May 17, 2005 8:30 am
Location: The Netherlands

Post by Rasheed »

Toontoonz wrote:As a test of your png files and the render time, do a simple animation of a vector object moving across the screen vs. the same animation with an appopriately sized png file. What is the difference in render times?
I made an animation of a red square moving across the screen (files here)
The file testvector.mov took 8 counts to render, while testPNG.mov took 24 counts to render, a significant difference (I counted one, two, three etc.).

Edit: I also tried a BMP file instead of the PNG and that took only 16 counts, but I don't like losing transparency.

The result from my little test:
- BMP twice as long to render as comparable vector version
- PNG three times as long to render as comparable vector version

How does that compare to the Windows and Linux version of Moho?

NB: I updated the zip file containing the relevant files and added the BMP test.
User avatar
Rasheed
Posts: 2008
Joined: Tue May 17, 2005 8:30 am
Location: The Netherlands

Post by Rasheed »

I just downloaded v5.2.1 of Moho and rendering is suddenly a lot faster:
* testvector.mov 4 s
* testPNG.mov 14 s
* testBMP.mov 19 s

Of course, I tried the Dinosaur animation as well, and it did render faster (less than 12 minutes).
Toontoonz
Posts: 763
Joined: Fri Mar 25, 2005 9:28 pm

Post by Toontoonz »

The png vs vector rendering times is a reasonable difference - considering what each is. And does a detailed, complicated vector drawing render slower than a simple color square vector (or png)?

Does it make a difference if your .png is very large, for example, 300 dpi 1200 x 1000 and then reduced to fit the 320 x 240 pixel window size in the Moho?
If the original png file was smaller and did not have to be reduced in Moho to fit the screen does that make a difference in rendering times?

Maybe take it through the next steps to experiement rendering times:
1 png takes x time.
Add another png and see what happens. And another...

Add a mask layer or two, add a particle layer, add a bone layer.
Where is the time rendering the worst?

Is it the size of the original png, the number of pngs, all the added layers in the animation, the mask or what causes the slow down.
None? Every render is the same?
These are things to test.

And then maybe it is all a waste of time and it really boils down to processing speed and the graphic card of your computer?
LM would be best to answer all that.
User avatar
Lost Marble
Site Admin
Posts: 2347
Joined: Tue Aug 03, 2004 6:02 pm
Location: Scotts Valley, California, USA
Contact:

Post by Lost Marble »

Rasheed wrote:I just downloaded v5.2.1 of Moho and rendering is suddenly a lot faster
I haven't posted an announcement yet (I may have done it by the time you read this), but version 5.2.1 does indeed speed up image rendering quite a bit.

Your dinosaur file on my 2.4 GHz Windows 2000 box rendered in 8m 04sec with version 5.2. With version 5.2.1, the same file renders in 3m 43sec - less than half the time! This is a big improvement for image layers. Image layers in the editing view should be faster now too.

The downside: the improvement was to fix a memory problem that may not show up on all computers or operating systems. For example, the improvement does not seem to be as pronounced on the Mac, but depending on your computer, there may be more or less of a speed improvement.
User avatar
WillBellJr
Posts: 41
Joined: Mon Oct 25, 2004 7:49 pm
Location: New York
Contact:

Post by WillBellJr »

I would think using PNGs that large would slow things down a bit. It's great to have hi-res sources but similar to webpage development, your working images should be close to the exact size you need for your animation.

The only time you need high resolution on your bitmaps is if you're going to >scale into them<; if you're going to zoom to 2x, your images should be 2x larger than the desired "normal" size...

For one, you're defintely taxing your system resources if you have a LOT of large images in memory - and gawd help you if you start using virtual memory!

-Will
"With THIS!, you could be like GOD!..." - Kozer, Blake's 7
Post Reply