Animation Engine: speed tips

David Bovill david.bovill at gmail.com
Thu Jul 2 18:35:24 EDT 2020


Here is a short video of a really nice ball animation of the Earth’s Carbon Cycle - which is the sort of thing I’d like to make a series of animations / interactive simulations about. There a re a few more than 30-40 moving balls here - but they are more or less dots….

https://www.youtube.com/watch?v=dwVsD9CiokY

I wonder how many particles can be animated like this in Livecode...
On 2 Jul 2020, 20:53 +0100, David Bovill <david.bovill at gmail.com>, wrote:
> That's inspired me :)
>
> I think it may be possible to do what I want in Livecode - which would be great. Thanks Alex and Bernd :)
>
> > On Thu, 2 Jul 2020 at 20:36, Alex Tweedly via use-livecode <use-livecode at lists.runrev.com> wrote:
> > >
> > > On 01/07/2020 02:52, J. Landman Gay via use-livecode wrote:
> > > > Did you use acceleratedRendering? Set it to true and set the layermode
> > > > of each moving object to dynamic. I'd be curious to see if there's a
> > > > difference.
> > > >
> > > >
> > > Hadn't  tried those until now. There is a difference - but not the kind
> > > I'd hoped for :-)
> > >
> > > Full script is below with detailed time, but the summary is:
> > > - acceleratedRendering made things much worse (50% to 90% slower)
> > > - dynamic layerMode made things a little bit better (5% to 15%).
> > >
> > > If the circle was moving over a plain background, improvement was only
> > > 5%-ish, while if moving over multiple other shapes, it gave a better
> > > improvement.
> > >
> > > Here's the full snippet of the script involved (other cases obvious :-)
> > >
> > > >   set the acceleratedRendering of this stack to false
> > > >    set the layermode of grc "g1" to "static"
> > > >
> > > >    repeat 3 times
> > > >       put 100,400 into tmp
> > > >       put the millisecs into tim1
> > > >       repeat 100 times
> > > >          add 1 to item 1 of tmp
> > > >          set the loc of grc "g1" to tmp
> > > >          wait 0 with messages
> > > >       end repeat
> > > >       put the acceleratedRendering of this stack && \
> > > >             the layermode of grc "g1" \
> > > >             && the millisecs-tim1 &CR after gLog
> > > >    end repeat
> > > >    put CR after gLog
> > >
> > > Here are the times for each of the cases, moving 100 times
> > >
> > > false static 192
> > > false static 154
> > > false static 155
> > >
> > > true static 285
> > > true static 332
> > > true static 249
> > >
> > > true dynamic 265
> > > true dynamic 255
> > > true dynamic 309
> > >
> > > false dynamic 131
> > > false dynamic 134
> > > false dynamic 149
> > >
> > > Alex.
> > >
> > >
> > > _______________________________________________
> > > use-livecode mailing list
> > > use-livecode at lists.runrev.com
> > > Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> > > http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the use-livecode mailing list