ccapture.js icon indicating copy to clipboard operation
ccapture.js copied to clipboard

Retrieve real performance timing

Open queenvictoria opened this issue 9 years ago • 3 comments

This is to support tweaking the playback of video textures as reported in #20 . I know you had a different idea but I've not been able to figure out how to do what you mean.

So my code in the animate() loop looks a bit like:

var recording_fps = 60;
timing = capturer.getTiming();
actual_fps = timing.performancetime - lasttiming.performancetime;
ratio = actual_fps / recording_fps;
// playbackRate is normalised
video.playbackRate = ratio;
lasttiming = timing;

queenvictoria avatar Aug 14 '16 01:08 queenvictoria

and what is lasttiming ?

tonycaso avatar Aug 14 '16 10:08 tonycaso

Sorry lasttiming is the stored value from the previous loop. I'll update my sample.

queenvictoria avatar Aug 17 '16 04:08 queenvictoria

+1. This really helps with video texture rendering.

rwoodley avatar Oct 31 '16 03:10 rwoodley