Giter VIP home page Giter VIP logo

Comments (6)

rankinstudio avatar rankinstudio commented on September 12, 2024

the step size is around 28ms. Can I get the step size to change but keep the FPS above 30?

from ccapture.js.

spite avatar spite commented on September 12, 2024

Without knowing more about your project, that's probably happening because your animation is frame-dependant. That is: if you increment your position 1 unit per frame, it will increment 60 units at 60FPS, 30 units at 30FPS and 960 units at 960FPS.

You have to make your animations time dependant, that is: based on time. Calculate the delta time (time elapsed between the current frame and the last frame) and use that as a factor of your calculations.

Would that explain your problem?

from ccapture.js.

rankinstudio avatar rankinstudio commented on September 12, 2024

Thanks, got it figured out. My animations are based on time, just large time hops (orbits).

from ccapture.js.

evgeniyaaa avatar evgeniyaaa commented on September 12, 2024

Hello, I'm using Createjs to create banner animations. I have a similar to the above mentioned problem:

When I lower the framerate, the animation becomes too choppy, when I increase it, it plays back way too fast

I think this is due to the Ticker used to create the animations in Createjs.

The video works correctly when I set the framerate in the Ccapture to 60, but not on any other value.

If I set the framerate to 1 and the type to 'png' or 'jpg', then in the archive I still get around 60 images per second (not sure if this is related the above though).

Do you think that the Ticker is creating frame-dependent animations instead of time-dependent ones as you explained it above and that is causing the mix-up?

from ccapture.js.

spite avatar spite commented on September 12, 2024

As long as there's code somewhere that is adding per-frame (let's say position = position + 1) you're going to have this kind of problems. If that code was running correctly at 60FPS (position is incremented 60 times a second), it will run slower if the framerate is 30 (position will be incremented 30 times a second) or extremely fast if, for instance, you use the motion blur preset from ccapture (position will be incremented ~960 times a second).

The ways most libraries sync with time are intercepted by ccapture (setTimeout, setInterval, requestAnimationFrame, Date methods ,etc.). So from the libs perspective, time is running at exactly the expected rate.

Usually a speed problem would be in your animation loop, but there's precedent of weird stuff, like GreenSock's Tween library caching Date.now before ccapture can intercept it.

from ccapture.js.

evgeniyaaa avatar evgeniyaaa commented on September 12, 2024

from ccapture.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.