Material design animations in fpgui lazarus / 39-Graphics ---------------------------------------------------------------------- mohsenti · 2016-02-22 15:51 Hi I try to develop some buttons with fpGUI widget and AggPas canvas and add some material like animations to component  but animations are too slow and using much CPU. I using TfpgTimer with 10ms interval to animate full screen button component . Is there way to speedup drawing animations or faster canvas ? regards, Mohsen Timar ---------------------------------------------------------------------- circular · 2016-02-23 05:08 What is material like animations? ---------------------------------------------------------------------- mohsenti · 2016-02-23 06:09 Material is a design language developed by google.see this for more information. and a set of html components design with material is here. for example animations like mouse-down animation,mouse-move animation and other animations defined by material design. ---------------------------------------------------------------------- circular · 2016-02-23 06:37 Ah ok. I suppose you would need to use OpenGL for fast 2d rendering: first render images (of text, icons, etc.) and then use OpenGL to draw them, scale them etc. ---------------------------------------------------------------------- mohsenti · 2016-02-23 08:32 thank you circular. Is there way to run AggPas or BGRABitmap functions parallel with ProcThreadPool instead of using OpenGL ? ---------------------------------------------------------------------- Thaddy · 2016-02-23 09:22 Quote from: mohsenti on February 23, 2016, 09:32:22 amthank you circular. Is there way to run AggPas or BGRABitmap functions parallel with ProcThreadPool� instead of using OpenGL ? Technically no problem. But first you have to know something about the architecture behind Material: 1. It rather loads pictures than renders them from code 2. If it needs to render then it does it before page view. You will notice a delay on page view, especcially on slower computers. 3. It uses OpenG itself on most platforms (except windows browsers for now) to render the content because most browsers render through opengl, including Chromium and Firefox. So if you switch to an OpenGL canvas, you are already on the same low- level as the browsers are. But, again, technically you could do that with any well written canvas. You just have to play with compiler settings to achieve optimal results. FPC has a lot of them, try the vector processing for example. That's why I am working on a html canvas, btw. Defer everything to the "browser" which can be opaque and used for any GUI. ---------------------------------------------------------------------- mohsenti · 2016-02-23 11:46 thank you Thaddy. Can you tell me more about your html canvas or share some demo with me ? ---------------------------------------------------------------------- Thaddy · 2016-02-23 12:19 yes and no: If I publish code I have to know  it  is clear to read and not just "works on my computers". But feel free to send me an email and I'll give you some working experiments (that are not working in all scenarios). ---------------------------------------------------------------------- Graeme · 2016-02-24 12:46 Hi Mohsen, As Thaddy mentioned, Material Design mostly uses images, then renders them to the display. The same can be done with AggPas. Pre-render what you need, or load them from images. Then in each animation cycle you can combine the pre-rendered images into one, on the display. Done correctly, and not using a massive final canvas size, it is doable to get smooth animation without the need for 2D hardware acceleration. fpGUI even includes an animation demo to show this is possible and can be smooth at the same time. ---------------------------------------------------------------------- Graeme · 2016-02-24 13:03 Quote from: mohsenti on February 22, 2016, 04:51:29 pmI try to develop some buttons with fpGUI widget and AggPas canvas and add some material like animations to component Can you be more specific with what you want. Is it one of these? ---------------------------------------------------------------------- mohsenti · 2016-02-24 15:02 Hi Graeme yes, but I have develop set of material design like components not only button. ---------------------------------------------------------------------- Graeme · 2016-02-24 22:52 Okay... I don't know the full details of Material Design etc., but like I mentioned, using pre-rendered images for certain effects should speed things up greatly.