XTDStudios / DMT

Dynamically Mapping Textures
101 stars 13 forks source link

Skipping identical frames in movie clips #5

Closed yurishkuro closed 11 years ago

yurishkuro commented 11 years ago

It is common among the animators I work with to do animation in Flash on 2s, 3s, and 4s, that is holding a single image for more than one frame. The animation is not quite smooth as 30 distinct frames per second, but in most cases it is not noticeable.

Such movie clips, however, create a lot of waste in the texture atlas because repeated frames are still recorded into the atlas. Is it possible for DMT to be smarter about such frames and only pack those that are actually different? At least different from the previous frame, that it. I seem to recall another Starling extension claiming to so such "compression", but can't see to find it anymore.

The function BitmapData.compare() returns number 0 when the two bitmaps are identical.

gilamran commented 11 years ago

Yea, we know about this issue, but it's quite heavy process (Especially on mobile). We are thinking about pre-process that will be done in an external tool, this tool will help the developers see the final atlases, captured children, and it will output an XML that DMT will be able to use to generate the images on runtime.

yurishkuro commented 11 years ago

That's sounds very cool! Any ETA?

gilamran commented 11 years ago

Not any time soon :-( too many projects under our belt... Looking at the example that you gave me (Fire), you can just catch less frames, and play it slower on Starling...