Why isn't it smooth? I'm pretty sure it has to do with how the browsers handle the rendering.
Independent of C2, motion still isn't buttery smooth, well at least not on my pc. Part of the issue is graphics card support, mine for instance has bugs in the driver and ati won't be making an updated driver for a ten year old card.
Here's a very simple js test where motion still isn't smooth:
viewtopic.php?f=147&t=115540&p=835995&hilit=jsfiddle#p835995
I'm pretty sure Javascript isn't to blame. I was able to get smooth motion in my now stalled wrapper experiment, in which I still used javascript, but implemented my own crude renderer on top.
Reducing the framerate doesn't fix the lack of smooth motion.
There was a discussion before of adding a 30fps mode, but it didn't work out as I recall because it wasn't smooth and had an unstable framerate.
Anyways I found this page describing a way to use a fixed framerate, so I took a gander at editing the C2 runtime to implement it.
http://stackoverflow.com/questions/1951 ... pplication
It seems to work alright, at least for me. It still has little pauses on my pc, but it's at least as smooth looking as it normally is on my pc.
These are the changes to limit the fps to 30, if anyone wants to test it.
file: \exporters\html5\preview.js
"..." is any number of lines, for this you'll want to find the line with "Runtime.prototype.tick". Bold are added lines. I prepended "rojo" to the variables I added. If it breaks, then just re-install C2 to fix it, or you could backup the file before editing it.
...
var rojoThen = cr.performance_now();
Runtime.prototype.tick = function (background_wake, timestamp, debug_step)
{
...
var rojoDelta = nowtime-rojoThen;
var rojoInterval = 1000/30;
if (rojoDelta >= rojoInterval)
{
rojoThen = nowtime - (rojoDelta % rojoInterval);
raf_time -= (rojoDelta % rojoInterval);
// Execute logic
this.logic(raf_time);
...
this.logictime += cr.performance_now() - logic_start;
}
};