Re: [Sugar-devel] What should be the ideal range for animations FPS ?
Thank you very much. I am looking forward to test these feature : as soon as I manage to fix a problem with my Sugar Gitorious account. Regards 2014/1/9 Manuel Quiñones ma...@laptop.org 2014/1/8 Manuel Quiñones ma...@laptop.org: 2014/1/8 laurent bernabe laurent.bern...@gmail.com: 2014/1/8 James Cameron qu...@laptop.org On Wed, Jan 08, 2014 at 11:49:56AM +0100, laurent bernabe wrote: True, but if you make a simple test available, others can test it for you. Especially so if you can figure a way to give the test report on screen, like a frame rate achieved. If I've well understood, I should give a way to turn on/off the frame rate display ? (Like in some games / 3D frameworks). A display with the current FPS is great for testers. For your own tests, there are impressive debugging tools in web technologies that I never seen before. The inspector timeline in Chrome, for example: https://developers.google.com/chrome-developer-tools/docs/timeline This discussion made me start a new activity that could serve as example. In the attached images you can see the inspector timeline being used First the full page is painted, and after that only the areas that changed are painted. . -- .. manuq .. ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] What should be the ideal range for animations FPS ?
You're right : I've already a Githhub account. I was just trying hard to push my project on the Sugar Hub. I will try with a new repository into Github instead. Regards 2014/1/9 Daniel Narvaez dwnarv...@gmail.com I wouldn't let issue with gitorious stop you, git is cool because you can easily move to another location etc, you could push to a github repo and then, if you want, come back to gitorious when it's solved. On Thursday, 9 January 2014, laurent bernabe wrote: Thank you very much. I am looking forward to test these feature : as soon as I manage to fix a problem with my Sugar Gitorious account. Regards 2014/1/9 Manuel Quiñones ma...@laptop.org 2014/1/8 Manuel Quiñones ma...@laptop.org: 2014/1/8 laurent bernabe laurent.bern...@gmail.com: 2014/1/8 James Cameron qu...@laptop.org On Wed, Jan 08, 2014 at 11:49:56AM +0100, laurent bernabe wrote: True, but if you make a simple test available, others can test it for you. Especially so if you can figure a way to give the test report on screen, like a frame rate achieved. If I've well understood, I should give a way to turn on/off the frame rate display ? (Like in some games / 3D frameworks). A display with the current FPS is great for testers. For your own tests, there are impressive debugging tools in web technologies that I never seen before. The inspector timeline in Chrome, for example: https://developers.google.com/chrome-developer-tools/docs/timeline This discussion made me start a new activity that could serve as example. In the attached images you can see the inspector timeline being used First the full page is painted, and after that only the areas that changed are painted. . -- .. manuq .. -- Daniel Narvaez ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] What should be the ideal range for animations FPS ?
Personally I think activities.sugarlabs.org should be the Sugar hub and git would be just on any of the many free git hosts available. Probably not everyone agrees with me there but the sugar core modules all live on github already. On Thursday, 9 January 2014, laurent bernabe wrote: You're right : I've already a Githhub account. I was just trying hard to push my project on the Sugar Hub. I will try with a new repository into Github instead. Regards 2014/1/9 Daniel Narvaez dwnarv...@gmail.com javascript:_e({}, 'cvml', 'dwnarv...@gmail.com'); I wouldn't let issue with gitorious stop you, git is cool because you can easily move to another location etc, you could push to a github repo and then, if you want, come back to gitorious when it's solved. On Thursday, 9 January 2014, laurent bernabe wrote: Thank you very much. I am looking forward to test these feature : as soon as I manage to fix a problem with my Sugar Gitorious account. Regards 2014/1/9 Manuel Quiñones ma...@laptop.org 2014/1/8 Manuel Quiñones ma...@laptop.org: 2014/1/8 laurent bernabe laurent.bern...@gmail.com: 2014/1/8 James Cameron qu...@laptop.org On Wed, Jan 08, 2014 at 11:49:56AM +0100, laurent bernabe wrote: True, but if you make a simple test available, others can test it for you. Especially so if you can figure a way to give the test report on screen, like a frame rate achieved. If I've well understood, I should give a way to turn on/off the frame rate display ? (Like in some games / 3D frameworks). A display with the current FPS is great for testers. For your own tests, there are impressive debugging tools in web technologies that I never seen before. The inspector timeline in Chrome, for example: https://developers.google.com/chrome-developer-tools/docs/timeline This discussion made me start a new activity that could serve as example. In the attached images you can see the inspector timeline being used First the full page is painted, and after that only the areas that changed are painted. . -- .. manuq .. -- Daniel Narvaez -- Daniel Narvaez ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] What should be the ideal range for animations FPS ?
I wonder if would not be a good idea add a repository property in the activity.info file, to allow users (and future tools) locate where are the sources. In the future, as w have a Duplicate option, we can add a Get Last sources or similar, and clone the repository to allow easier participation. Gonzalo On Thu, Jan 9, 2014 at 1:47 PM, Daniel Narvaez dwnarv...@gmail.com wrote: Personally I think activities.sugarlabs.org should be the Sugar hub and git would be just on any of the many free git hosts available. Probably not everyone agrees with me there but the sugar core modules all live on github already. On Thursday, 9 January 2014, laurent bernabe wrote: You're right : I've already a Githhub account. I was just trying hard to push my project on the Sugar Hub. I will try with a new repository into Github instead. Regards 2014/1/9 Daniel Narvaez dwnarv...@gmail.com I wouldn't let issue with gitorious stop you, git is cool because you can easily move to another location etc, you could push to a github repo and then, if you want, come back to gitorious when it's solved. On Thursday, 9 January 2014, laurent bernabe wrote: Thank you very much. I am looking forward to test these feature : as soon as I manage to fix a problem with my Sugar Gitorious account. Regards 2014/1/9 Manuel Quiñones ma...@laptop.org 2014/1/8 Manuel Quiñones ma...@laptop.org: 2014/1/8 laurent bernabe laurent.bern...@gmail.com: 2014/1/8 James Cameron qu...@laptop.org On Wed, Jan 08, 2014 at 11:49:56AM +0100, laurent bernabe wrote: True, but if you make a simple test available, others can test it for you. Especially so if you can figure a way to give the test report on screen, like a frame rate achieved. If I've well understood, I should give a way to turn on/off the frame rate display ? (Like in some games / 3D frameworks). A display with the current FPS is great for testers. For your own tests, there are impressive debugging tools in web technologies that I never seen before. The inspector timeline in Chrome, for example: https://developers.google.com/chrome-developer-tools/docs/timeline This discussion made me start a new activity that could serve as example. In the attached images you can see the inspector timeline being used First the full page is painted, and after that only the areas that changed are painted. . -- .. manuq .. -- Daniel Narvaez -- Daniel Narvaez ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel -- Gonzalo Odiard SugarLabs - Learning Software for children ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] What should be the ideal range for animations FPS ?
2014/1/9 Daniel Narvaez dwnarv...@gmail.com: Personally I think activities.sugarlabs.org should be the Sugar hub and git would be just on any of the many free git hosts available. Probably not everyone agrees with me there but the sugar core modules all live on github already. +1 -- .. manuq .. ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] What should be the ideal range for animations FPS ?
On Thu, Jan 9, 2014 at 2:38 PM, Gonzalo Odiard godi...@sugarlabs.orgwrote: I wonder if would not be a good idea add a repository property in the activity.info file +1 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] What should be the ideal range for animations FPS ?
Yes, I think that's a great idea (both adding the property and integrate it in the sugar experience in te future). On Thursday, 9 January 2014, Gonzalo Odiard wrote: I wonder if would not be a good idea add a repository property in the activity.info file, to allow users (and future tools) locate where are the sources. In the future, as w have a Duplicate option, we can add a Get Last sources or similar, and clone the repository to allow easier participation. Gonzalo On Thu, Jan 9, 2014 at 1:47 PM, Daniel Narvaez dwnarv...@gmail.comjavascript:_e({}, 'cvml', 'dwnarv...@gmail.com'); wrote: Personally I think activities.sugarlabs.org should be the Sugar hub and git would be just on any of the many free git hosts available. Probably not everyone agrees with me there but the sugar core modules all live on github already. On Thursday, 9 January 2014, laurent bernabe wrote: You're right : I've already a Githhub account. I was just trying hard to push my project on the Sugar Hub. I will try with a new repository into Github instead. Regards 2014/1/9 Daniel Narvaez dwnarv...@gmail.com I wouldn't let issue with gitorious stop you, git is cool because you can easily move to another location etc, you could push to a github repo and then, if you want, come back to gitorious when it's solved. On Thursday, 9 January 2014, laurent bernabe wrote: Thank you very much. I am looking forward to test these feature : as soon as I manage to fix a problem with my Sugar Gitorious account. Regards 2014/1/9 Manuel Quiñones ma...@laptop.org 2014/1/8 Manuel Quiñones ma...@laptop.org: 2014/1/8 laurent bernabe laurent.bern...@gmail.com: 2014/1/8 James Cameron qu...@laptop.org On Wed, Jan 08, 2014 at 11:49:56AM +0100, laurent bernabe wrote: True, but if you make a simple test available, others can test it for you. Especially so if you can figure a way to give the test report on screen, like a frame rate achieved. If I've well understood, I should give a way to turn on/off the frame rate display ? (Like in some games / 3D frameworks). A display with the current FPS is great for testers. For your own tests, there are impressive debugging tools in web technologies that I never seen before. The inspector timeline in Chrome, for example: https://developers.google.com/chrome-developer-tools/docs/timeline This discussion made me start a new activity that could serve as example. In the attached images you can see the inspector timeline being used First the full page is painted, and after that only the areas that changed are painted. . -- .. manuq .. -- Daniel Narvaez -- Daniel Narvaez ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org javascript:_e({}, 'cvml', 'Sugar-devel@lists.sugarlabs.org'); http://lists.sugarlabs.org/listinfo/sugar-devel -- Gonzalo Odiard SugarLabs - Learning Software for children -- Daniel Narvaez ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] What should be the ideal range for animations FPS ?
Believe it or not, it was a ridiculous error !!! I tried to access git command from inside osbuild shell (without then trying outside it) : shame at me. Anyway, problem is solved. Regards 2014/1/9 laurent bernabe laurent.bern...@gmail.com You're right : I've already a Githhub account. I was just trying hard to push my project on the Sugar Hub. I will try with a new repository into Github instead. Regards 2014/1/9 Daniel Narvaez dwnarv...@gmail.com I wouldn't let issue with gitorious stop you, git is cool because you can easily move to another location etc, you could push to a github repo and then, if you want, come back to gitorious when it's solved. On Thursday, 9 January 2014, laurent bernabe wrote: Thank you very much. I am looking forward to test these feature : as soon as I manage to fix a problem with my Sugar Gitorious account. Regards 2014/1/9 Manuel Quiñones ma...@laptop.org 2014/1/8 Manuel Quiñones ma...@laptop.org: 2014/1/8 laurent bernabe laurent.bern...@gmail.com: 2014/1/8 James Cameron qu...@laptop.org On Wed, Jan 08, 2014 at 11:49:56AM +0100, laurent bernabe wrote: True, but if you make a simple test available, others can test it for you. Especially so if you can figure a way to give the test report on screen, like a frame rate achieved. If I've well understood, I should give a way to turn on/off the frame rate display ? (Like in some games / 3D frameworks). A display with the current FPS is great for testers. For your own tests, there are impressive debugging tools in web technologies that I never seen before. The inspector timeline in Chrome, for example: https://developers.google.com/chrome-developer-tools/docs/timeline This discussion made me start a new activity that could serve as example. In the attached images you can see the inspector timeline being used First the full page is painted, and after that only the areas that changed are painted. . -- .. manuq .. -- Daniel Narvaez ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] What should be the ideal range for animations FPS ?
Thank you for these suggestions. I'll study them attentively. Regards 2014/1/8 Manuel Quiñones ma...@laptop.org 2014/1/7 Daniel Narvaez dwnarv...@gmail.com: I'm not an expert of graphics performance or web technologies, but my understanding is that you don't want to be the one setting the FPS. The system will know much better when it's time to draw. And that seems the philosophy behind this API https://developer.mozilla.org/en/docs/Web/API/window.requestAnimationFrame https://hacks.mozilla.org/2011/08/animating-with-javascript-from-setinterval-to-requestanimationframe/ Yes, requestAnimationFrame is the preferred way to do it in JS. To reach a constant speed in your animations you can use Date.now() inside the callback. Further, you can use a tweener lib like TweenJS. For browser compatibility you should use a polyfill like this one: https://gist.github.com/paulirish/1579671 I have to add that to Clock Web. -- .. manuq .. ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] What should be the ideal range for animations FPS ?
Thank you very much : so I undestand that this is at the same time a software and a hardware (with temperatures) concern. And that the process can be different in cases of raster based programs and vector based programs. Unfortunately, I can only test programs on my two computers (an old PC and a recent laptop) : so the hardware part will hardly be tested by my means. Meanwhile, when I asked this question, I had in mind that a suggested range of values, as a guideleness, can be known : perhaps not now, as, like you pointed me, one may not have enough informations and tests in order to fetch those values. And also, as I've been told on this mailing list, there is a new Javascript API in order to let the computer(web browser ?) hold this value for the programmer. So I think the issue can easily be solved : at least with this requestAnimationFrame() function. Regards ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] What should be the ideal range for animations FPS ?
On Wed, Jan 08, 2014 at 11:49:56AM +0100, laurent bernabe wrote: Thank you very much : so I undestand that this is at the same time a software and a hardware (with temperatures) concern. And that the process can be different in cases of raster based programs and vector based programs. Unfortunately, I can only test programs on my two computers (an old PC and a recent laptop) : so the hardware part will hardly be tested by my means. True, but if you make a simple test available, others can test it for you. Especially so if you can figure a way to give the test report on screen, like a frame rate achieved. Meanwhile, when I asked this question, I had in mind that a suggested range of values, as a guideleness, can be known : perhaps not now, as, like you pointed me, one may not have enough informations and tests in order to fetch those values. Yes, it is not practical to have a suggested range given the number of variables. However, designing for higher values can have benefits ... in research for Netrek it was found that: - five frames per second is a minimum for perception of motion, but most users will perceive the steps and use them as the basis for their reaction, such that when the rate is increased their training has to be redone, - ten frames per second is preferable, with most users still perceiving the steps, - 25 frames per second is very good, with most users not perceiving the steps, - 50 frames per second is excellent. And also, as I've been told on this mailing list, there is a new Javascript API in order to let the computer(web browser ?) hold this value for the programmer. So I think the issue can easily be solved : at least with this requestAnimationFrame() function. Great. -- James Cameron http://quozl.linux.org.au/ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] What should be the ideal range for animations FPS ?
2014/1/8 James Cameron qu...@laptop.org On Wed, Jan 08, 2014 at 11:49:56AM +0100, laurent bernabe wrote: True, but if you make a simple test available, others can test it for you. Especially so if you can figure a way to give the test report on screen, like a frame rate achieved. If I've well understood, I should give a way to turn on/off the frame rate display ? (Like in some games / 3D frameworks). Yes, it is not practical to have a suggested range given the number of variables. However, designing for higher values can have benefits ... in research for Netrek it was found that: - five frames per second is a minimum for perception of motion, but most users will perceive the steps and use them as the basis for their reaction, such that when the rate is increased their training has to be redone, - ten frames per second is preferable, with most users still perceiving the steps, - 25 frames per second is very good, with most users not perceiving the steps, - 50 frames per second is excellent. Thank you very much for this guideleness. So, in my case, I should keep a frame rate around 50, if I really need to fix it myself (I am thinking about the javascript requestAnimationFrame() function). And also, as I've been told on this mailing list, there is a new Javascript API in order to let the computer(web browser ?) hold this value for the programmer. So I think the issue can easily be solved : at least with this requestAnimationFrame() function. Great. -- James Cameron http://quozl.linux.org.au/ Regards Laurent Bernabe ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] What should be the ideal range for animations FPS ?
2014/1/8 laurent bernabe laurent.bern...@gmail.com: 2014/1/8 James Cameron qu...@laptop.org On Wed, Jan 08, 2014 at 11:49:56AM +0100, laurent bernabe wrote: True, but if you make a simple test available, others can test it for you. Especially so if you can figure a way to give the test report on screen, like a frame rate achieved. If I've well understood, I should give a way to turn on/off the frame rate display ? (Like in some games / 3D frameworks). A display with the current FPS is great for testers. For your own tests, there are impressive debugging tools in web technologies that I never seen before. The inspector timeline in Chrome, for example: https://developers.google.com/chrome-developer-tools/docs/timeline There you can see how much takes your app for painting and for other calculations, so you can find the bottleneck in your code. You can even click on a paint record and it will highlight the area of the screen that was changed. Yes, it is not practical to have a suggested range given the number of variables. However, designing for higher values can have benefits ... in research for Netrek it was found that: - five frames per second is a minimum for perception of motion, but most users will perceive the steps and use them as the basis for their reaction, such that when the rate is increased their training has to be redone, - ten frames per second is preferable, with most users still perceiving the steps, - 25 frames per second is very good, with most users not perceiving the steps, - 50 frames per second is excellent. Thank you very much for this guideleness. So, in my case, I should keep a frame rate around 50, if I really need to fix it myself (I am thinking about the javascript requestAnimationFrame() function). With requestAnimationFrame you don't force a constant FPS. Instead, the callback is called as fast as your machine can. So is good to decouple the duration of your animation from the frame rate. If you move your image 2 pixels each frame, the velocity will vary in diferent systems. Instead, you should calculate how many milliseconds have passed since the last frame, and move your imave accordingly. Here is when interpolation comes into play, and a tweener lib becomes handy. And also, as I've been told on this mailing list, there is a new Javascript API in order to let the computer(web browser ?) hold this value for the programmer. So I think the issue can easily be solved : at least with this requestAnimationFrame() function. Great. -- James Cameron http://quozl.linux.org.au/ Regards Laurent Bernabe ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel -- .. manuq .. ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] What should be the ideal range for animations FPS ?
I'll try to use the inspector whenever I run into serious animation issue. Thanks. Indeed, looks like all this concern seems very difficult without using at least a tweening library. Tween.js/Easel.js looks to be a very good one (it is recommanded to use the ticker function from easel.js, or to write one from scratch), and I am very interested in developping activities with it. But : - it does not seem to be AMD-ready : which, I think can be easily solved, looking again at Require.js documentation - the minified version (about 80 ko) seems to be the only way to avoid increasing significantly activity size when using it : again, I think I can go for it. Regards Laurent Bernabe 2014/1/8 Manuel Quiñones ma...@laptop.org 2014/1/8 laurent bernabe laurent.bern...@gmail.com: 2014/1/8 James Cameron qu...@laptop.org On Wed, Jan 08, 2014 at 11:49:56AM +0100, laurent bernabe wrote: True, but if you make a simple test available, others can test it for you. Especially so if you can figure a way to give the test report on screen, like a frame rate achieved. If I've well understood, I should give a way to turn on/off the frame rate display ? (Like in some games / 3D frameworks). A display with the current FPS is great for testers. For your own tests, there are impressive debugging tools in web technologies that I never seen before. The inspector timeline in Chrome, for example: https://developers.google.com/chrome-developer-tools/docs/timeline There you can see how much takes your app for painting and for other calculations, so you can find the bottleneck in your code. You can even click on a paint record and it will highlight the area of the screen that was changed. Yes, it is not practical to have a suggested range given the number of variables. However, designing for higher values can have benefits ... in research for Netrek it was found that: - five frames per second is a minimum for perception of motion, but most users will perceive the steps and use them as the basis for their reaction, such that when the rate is increased their training has to be redone, - ten frames per second is preferable, with most users still perceiving the steps, - 25 frames per second is very good, with most users not perceiving the steps, - 50 frames per second is excellent. Thank you very much for this guideleness. So, in my case, I should keep a frame rate around 50, if I really need to fix it myself (I am thinking about the javascript requestAnimationFrame() function). With requestAnimationFrame you don't force a constant FPS. Instead, the callback is called as fast as your machine can. So is good to decouple the duration of your animation from the frame rate. If you move your image 2 pixels each frame, the velocity will vary in diferent systems. Instead, you should calculate how many milliseconds have passed since the last frame, and move your imave accordingly. Here is when interpolation comes into play, and a tweener lib becomes handy. And also, as I've been told on this mailing list, there is a new Javascript API in order to let the computer(web browser ?) hold this value for the programmer. So I think the issue can easily be solved : at least with this requestAnimationFrame() function. Great. -- James Cameron http://quozl.linux.org.au/ Regards Laurent Bernabe ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel -- .. manuq .. ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] What should be the ideal range for animations FPS ?
On Tue, Jan 07, 2014 at 05:37:34PM +0100, laurent bernabe wrote: As I am programming on a recent laptop, it can be easy to call javascript method setTimeout with too high values, without noticing the wrong behaviour for real XO. This is why I am wondering what should be the ideal range for animations Frames Per Second value ? There is no easy answer. There are too many factors. I can speak from experience with Pygame and attempt to explain how to transfer that experience to Javascript. Now, Pygame is a raster based animation, and Javascript drawing can be vector based. I do not know if the layer between Javascript and the display handles this as vectors or a raster. At worst, it will be a raster. A raster based animation must update the display by blitting changed rectangles. At worst, the entire drawing area must be blitted. At best, only a small rectangle covering the motion must be blitted. This is a rectangle that is the union of the old position of the object and the new position of the object. There is a sequence of steps between the application program and the hardware: - the application program makes drawing commands, - the application program asks for a frame to be revealed (Pygame's display update), or the library assumes it (setTimeout), - the library translates the display update into the display protocol; which for Pygame means the change is passed to SDL, which passes it to X, - some time later, the X display server receives the change and updates the frame buffer, - the light from the display reaches the user. ;-) There is a queue before the X display server. It is possible to fill the queue. Once this happens, the displayed image lags behind the application program, and if motion is being displayed the frame rate will change according to the complexity of the update; a small update will give a faster frame rate. Too hight a frame rate on Pygame gives the above effect. I would be interested to hear what happens if you use too high a frame rate on Javascript. There is insufficient feedback from the system to the application to determine the spare CPU time available. So we often guess at a frame rate. The only way to find an appropriate frame rate is to test on a known combination of hardware and software. For the XO laptop, gather test results with the following associated data: - the model, - the SKU, - the operating system version, - a measure of the raw CPU performance at a few known temperatures, The last point is the most interesting to me. Laptops of the same model, SKU, and operating system version, do not all perform the same. This can be due to thermal problems. A fault in the heat transfer system degrades performance, and basing assertions on such results is incorrect. -- James Cameron http://quozl.linux.org.au/ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] What should be the ideal range for animations FPS ?
I'm not an expert of graphics performance or web technologies, but my understanding is that you don't want to be the one setting the FPS. The system will know much better when it's time to draw. And that seems the philosophy behind this API https://developer.mozilla.org/en/docs/Web/API/window.requestAnimationFrame https://hacks.mozilla.org/2011/08/animating-with-javascript-from-setinterval-to-requestanimationframe/ On 7 January 2014 17:37, laurent bernabe laurent.bern...@gmail.com wrote: Hello everyone, As I am programming on a recent laptop, it can be easy to call javascript method setTimeout with too high values, without noticing the wrong behaviour for real XO. This is why I am wondering what should be the ideal range for animations Frames Per Second value ? Regards Laurent Bernabe ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel -- Daniel Narvaez ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] What should be the ideal range for animations FPS ?
Thank you very much : I didn't knew that new API. I'll have a closer look at your articles, and use this function instead of setTimeOut/setInterval. Regards Laurent Bernabe 2014/1/8 Daniel Narvaez dwnarv...@gmail.com I'm not an expert of graphics performance or web technologies, but my understanding is that you don't want to be the one setting the FPS. The system will know much better when it's time to draw. And that seems the philosophy behind this API https://developer.mozilla.org/en/docs/Web/API/window.requestAnimationFrame https://hacks.mozilla.org/2011/08/animating-with-javascript-from-setinterval-to-requestanimationframe/ On 7 January 2014 17:37, laurent bernabe laurent.bern...@gmail.comwrote: Hello everyone, As I am programming on a recent laptop, it can be easy to call javascript method setTimeout with too high values, without noticing the wrong behaviour for real XO. This is why I am wondering what should be the ideal range for animations Frames Per Second value ? Regards Laurent Bernabe ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel -- Daniel Narvaez ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] What should be the ideal range for animations FPS ?
2014/1/7 Daniel Narvaez dwnarv...@gmail.com: I'm not an expert of graphics performance or web technologies, but my understanding is that you don't want to be the one setting the FPS. The system will know much better when it's time to draw. And that seems the philosophy behind this API https://developer.mozilla.org/en/docs/Web/API/window.requestAnimationFrame https://hacks.mozilla.org/2011/08/animating-with-javascript-from-setinterval-to-requestanimationframe/ Yes, requestAnimationFrame is the preferred way to do it in JS. To reach a constant speed in your animations you can use Date.now() inside the callback. Further, you can use a tweener lib like TweenJS. For browser compatibility you should use a polyfill like this one: https://gist.github.com/paulirish/1579671 I have to add that to Clock Web. -- .. manuq .. ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] What should be the ideal range for animations FPS ?
2014/1/7 James Cameron qu...@laptop.org: On Tue, Jan 07, 2014 at 05:37:34PM +0100, laurent bernabe wrote: As I am programming on a recent laptop, it can be easy to call javascript method setTimeout with too high values, without noticing the wrong behaviour for real XO. This is why I am wondering what should be the ideal range for animations Frames Per Second value ? There is no easy answer. There are too many factors. I can speak from experience with Pygame and attempt to explain how to transfer that experience to Javascript. Now, Pygame is a raster based animation, and Javascript drawing can be vector based. I do not know if the layer between Javascript and the display handles this as vectors or a raster. At worst, it will be a raster. A raster based animation must update the display by blitting changed rectangles. At worst, the entire drawing area must be blitted. At best, only a small rectangle covering the motion must be blitted. This is a rectangle that is the union of the old position of the object and the new position of the object. There is a sequence of steps between the application program and the hardware: - the application program makes drawing commands, - the application program asks for a frame to be revealed (Pygame's display update), or the library assumes it (setTimeout), - the library translates the display update into the display protocol; which for Pygame means the change is passed to SDL, which passes it to X, - some time later, the X display server receives the change and updates the frame buffer, - the light from the display reaches the user. ;-) Yes, that's the theory and is important to understand what happens under the hood. PyGame does a good job giving you the dirty rects By the way, usually you let that job to the lib in question. There are graphics libs for JS, some work with canvas and some with SVG. -- .. manuq .. ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel