Comments (1)
switching to a x8 slowdown causes a recomputation that requires eight times as many frames to be computed.
There's no x8 slowdown, max is x4. But the recalculation that happens seems to be a leftover from before https://github.com/motion-canvas/core/issues/57
The goal of recalculation is to compute the new starting and ending frames which are currently independent of the speed. So I believe recalculation, in this case, could simply be omitted.
Currently, if the thread runner gets out of sync with the audio, the audio time is adjusted
That's not entirely true. If present, the audio serves as a master clock.
If the animation is ahead, it will wait until the next requestAnimationFrame
:
motion-canvas/packages/core/src/player/Player.ts
Lines 300 to 310 in 355ce86
If the animation is behind, it will try to catch on:
motion-canvas/packages/core/src/player/Player.ts
Lines 311 to 320 in 355ce86
So the framerate is variable, but it's controlled by the requestAnimationFrame
loop and not the project itself.
The audio is only adjusted if the speed is different than 1
for obvious reasons.
When it comes to seeking/recalculation optimization, I played around with this idea when working on https://github.com/motion-canvas/core/issues/57 since the implementation was already there. If you set the speed to a high number, say 10, you'll see the performance gains you're talking about. But the disadvantage you've mentioned was the reason I dropped it.
Personally, I wouldn't say that accessing a value during a tween is bad practice.
It would only be a problem if you were to use this value to modify the timing. Pass it to waitFor
or something like that.
Otherwise, the worst it could do is to produce some visual artifacts/discrepancies which I think would be an acceptable trade-off.
Anyway, as you've mentioned in the note, let's leave this as a ripcord for now.
from motion-canvas.
Related Issues (20)
- Documentation pages sometimes failed to load on mobile device
- DestinationUV uniform doesn't scale with scene on render HOT 5
- Preview-only Background Color HOT 1
- TXT does not move with parent Line when tweening HOT 5
- Create a scene with custom data so that we could reuse the code for building multiple videos through automation NATIVELY HOT 1
- The audio sound is not aligned with the audio track. HOT 4
- Seperate Inherited properties/functions from other inherited properies/functions HOT 2
- Add a length() accessor to the Line component HOT 1
- Offline Icon Support HOT 1
- Different Browsers, Same Code, Different Appearance. HOT 1
- Mathematical operations for Vector2 signals HOT 1
- More Playhead Functionality
- `Path` appears like polylines while animating to new values HOT 1
- Documentation (and examples) for: to, do, back
- Document range handles and other parts of the interface HOT 10
- Dynamic point definition for `Spline` yields `Insufficient number of knots` warning. HOT 1
- view.fill(); causes FR drop in Safari on MacOS
- Arrows in the middle of the line
- How to place an animation in an existing web project HOT 3
- add tweening for layout properties HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from motion-canvas.