vfbb 285 Posted May 5, 2022 (edited) 35 minutes ago, domus said: Installed fine (Windows 10) and worked fine in first project test. When I try a second project, I keep getting "skia library could not be loaded". These are tiny one-unit test projects. Anyone have any idea what I'm overlooking? Thx. Have you enabled skia in your project? Inside of IDE, right click in your project > Enable Skia. Maybe after that you have to rebuild your project (Clean and Compile). This step is made to configure skia binaries in your project... Maybe this is also @Serge_G problem too. 6 hours ago, Serge_G said: installing Ubuntu 20.04 My Ubuntu is 20.04 too (although it should work on 18.04 too) Edited May 5, 2022 by vfbb Share this post Link to post
domus 1 Posted May 5, 2022 4 minutes ago, vfbb said: right click in your project > Enable Skia. Maybe after that you have to rebuild your project That was it! Many thanks! Odd that this wasn't necessary in the first test project. However, while the test (just rotation bitmaps) runs very smoothly in standard FMX, it comes to an absolute crawl when I set GlobalUseSkia := True. Share this post Link to post
vfbb 285 Posted May 5, 2022 7 minutes ago, domus said: That was it! Many thanks! Odd that this wasn't necessary in the first test project. Without this step it will work when you run your app on Windows through the IDE run (because the IDE shares the same env PATH with the exe it is running). But the rule is: whenever you are going to use any skia code in an application (vcl, console or fmx), do this step. This should only not be done in libraries that use skia. 9 minutes ago, domus said: However, while the test (just rotation bitmaps) runs very smoothly in standard FMX, it comes to an absolute crawl when I set GlobalUseSkia := True. This is not expected. Can you add a new line above your GlobalUseSkia declaration: GlobalUseSkiaRasterWhenAvailable := False; Share this post Link to post
domus 1 Posted May 5, 2022 1 minute ago, vfbb said: This is not expected. Can you add a new line above your GlobalUseSkia declaration: GlobalUseSkiaRasterWhenAvailable := False; Now it's flying again! However, is Skia still being used for bitmaps when this is set to False? Share this post Link to post
vfbb 285 Posted May 5, 2022 (edited) 39 minutes ago, domus said: Now it's flying again! However, is Skia still being used for bitmaps when this is set to False? Yes. When you set "GlobalUseSkia := True;", the lib replaces the app's default canvas to the skia-based canvas. However, we made more than 1 canvas based on skia: a raster canvas (CPU), an opengl canvas (GPU) and a metal canvas (GPU). When creating the first form or drawing with bitmaps (which is when the FMX canvas system is started), we check if GlobalUseSkia is true, and if it is, we will choose one of our implementations based on the booleans GlobalUseSkiaRasterWhenAvailable and GlobalUseMetal, and on the target platform. But why use by default on Windows a raster canvas (which runs on the CPU), since the canvases that run on the GPU are faster? This was done because it is the most compatible mode of all, as some specific VMs do not implement full openGL support and often this is not possible to verify via code. In the future we intend to add new canvas implementations based on skia, such as the Vulkan implementation. Perhaps Vulkan was better implemented on Windows VMs. Edited May 5, 2022 by vfbb Share this post Link to post
domus 1 Posted May 5, 2022 22 minutes ago, vfbb said: Yes. Tested with over 3000 rotating rectangles, with assigned bitmaps. FMX still runs very smoothly, but Skia was jerky (even with GlobalUseSkiaRasterWhenAvailable = False). With 200 rotating rectangles, I have the impression Skia is smoother. All very subjective observations, of course. Not certain if any of this information is useful. Share this post Link to post
vfbb 285 Posted May 5, 2022 23 minutes ago, domus said: Tested with over 3000 rotating rectangles, with assigned bitmaps. FMX still runs very smoothly, but Skia was jerky (even with GlobalUseSkiaRasterWhenAvailable = False). With 200 rotating rectangles, I have the impression Skia is smoother. All very subjective observations, of course. Not certain if any of this information is useful. There are 2 questions in your test: 1) On the Windows platform, both the FMX and Skia canvas present very similar results, both in terms of quality and performance. Although on my machine there was a 10% gain, some reported the opposite, but overall both were satisfactory in all tests. On non-Windows platforms, the performance differences are greater and a second problem arises, which is the quality of the drawings (there is only antialiasing on FMX Windows, while on Skia there is maximum quality on all platforms); 2) In our canvas implementation, bitmaps are not as optimized as they could be. We split our canvas into 2 parts, the window canvas (form) and the bitmap canvas. In the implementation of the canvas bitmap we always decided to use the raster mode because we wanted the TBitmap to be used in background threads without locking the UI (embarcadero put a lock on the canvas that blocks drawings in parallel, even if you use bitmaps in threads, the drawings are not actually done in parallel, one blocks the other during BeginScene and EndScene). In our tests this raster implementation of bitmaps didn't affect the performance of projects that don't abuse bitmaps as much (but it's not your case, you're drawing 300 bitmaps at once); Share this post Link to post
domus 1 Posted May 5, 2022 24 minutes ago, vfbb said: On the Windows platform, both the FMX and Skia canvas present very similar results, both in terms of quality and performance I'll continue testing nevertheless. I'm mainly interested in exploring the animation possibilities using SVG. Could you tell me if the SVG component allows run-time created animations, like dynamic path creation and altering of SVG parameters (as opposed to loading file-based SVG animations)? Share this post Link to post
vfbb 285 Posted May 5, 2022 17 minutes ago, domus said: I'll continue testing nevertheless. I'm mainly interested in exploring the animation possibilities using SVG. Could you tell me if the SVG component allows run-time created animations, like dynamic path creation and altering of SVG parameters (as opposed to loading file-based SVG animations)? Skia does not support animated SVG. There are very few libs that support SVG animations and even then I believe there are no versions for delphi. However, there is something similar, and much better: lottie. Lottie are also vectorized animations in json format. As with SVG, you can also find lottie of everything on the internet. You can also create your own animation using Adobe After Effects (although it's hard for programmers lol). However it is not possible to edit it at runtime. Note: Replacing your app's canvas (GlobalUseSkia := True) is optional. You'll be able to use svg, lottie, skia controls, even without skia being your app's renderer. However, skia controls perform better when your app's canvas is based on skia (GlobalUseSkia := True) Share this post Link to post
domus 1 Posted May 5, 2022 Quote Skia does not support animated SVG. There are very few libs that support SVG animations and even then I believe there are no versions for delphi. There was one by Jason Southwell; a TSVG component in his Apesuite component set. Ten years ago, that was. Don't know if that's still active. Quote Lottie are also vectorized animations in json format. However it is not possible to edit it at runtime. So, no (truly) interactive animations possible? Only fixed animation sequences? I noticed there is a way to create SVGs in runtime. Maybe I'll experiment with that. Is the entire SKIA library exposed in Delphi, or just part of it? Share this post Link to post
vfbb 285 Posted May 5, 2022 (edited) 37 minutes ago, domus said: So, no (truly) interactive animations possible? Only fixed animation sequences? No truly interactive animations. But you could create these iterations artificially. Consider this example: https://lottiefiles.com/5222-switch between progress 0% to 50% is the animation enabling a switch, and progress 50% to 100% is the animation disabling a switch. Based on that you can configure the animation in your control so that when you click it execute the progress from 0% to 50% or from 50% to 100%. Note: Currently our TSkAnimatedImage control is capable of running lottie animations but it is not "so tunable". Either it automatically runs the entire animation or you activate the manual mode and change the progress on your own (for example by adding a timer and changing the progress manually every 15 ms). In our next release (in a few weeks) we will improve this a lot, we will add new properties to get better control of the animations in the TSkAnimatedImage control. 37 minutes ago, domus said: I noticed there is a way to create SVGs in runtime. Maybe I'll experiment with that. Yes it is possible with Skia4Delphi. 37 minutes ago, domus said: Is the entire SKIA library exposed in Delphi, or just part of it? Excluding experimental or deprecated modules, 99% of the library is exposed. Edited May 5, 2022 by vfbb Share this post Link to post
domus 1 Posted May 5, 2022 Quote Consider this example: https://lottiefiles.com/5222-switch I'll check that out. Thanks! Quote we will add new properties to improve this animation control in the TSkAnimatedImage control to the maximum Looking forward to checking it out. Many thanks for your swift and complete replies! 1 Share this post Link to post
Serge_G 87 Posted May 6, 2022 16 hours ago, vfbb said: My Ubuntu is 20.04 too (although it should work on 18.04 too) Hi, I report my success on my full Ubuntu PC upgraded to Ubuntu 20.4 I failed installation of 20.4 for WSL (not installation but XFCE4 don't work fine, no terminal !) So I will still investigate about 18.04 version failure. 1 Share this post Link to post
domus 1 Posted May 7, 2022 First test with a Lottie export from AE. Two superimposed circles with animated trim paths (connected parameters). Only one circle is animated, the other not. In the Lottie preview in the AE Plugin, all seems fine. In Delphi, only one circle is animated. Are there any limitations to the complexity of these Lottie imports (or unsupported functionality)? Share this post Link to post
vfbb 285 Posted May 7, 2022 1 hour ago, domus said: First test with a Lottie export from AE. Two superimposed circles with animated trim paths (connected parameters). Only one circle is animated, the other not. In the Lottie preview in the AE Plugin, all seems fine. In Delphi, only one circle is animated. Are there any limitations to the complexity of these Lottie imports (or unsupported functionality)? There are several limitations of Adobe After Effects to lottie (using bodymovin plugin) and they are not very well documented. This site lists some: https://www.elpassion.com/blog/lottie-who-common-mistakes-in-after-effects-animation-for-lottie Your case may have something to do with Keyframe or expressions... Share this post Link to post
domus 1 Posted May 7, 2022 15 hours ago, vfbb said: Your case may have something to do with Keyframe or expressions... As I suspected, it had to do with the "property pick whip," linking properties of different objects. When I detached them and configured them separately, it worked. Your link, however, was kind of depressing to read; Quote Unfortunately, the Lottie library doesn’t support some of the essential functions of After Effects such as Expressions or Effects Well, my test used a Gaussian blur effect and that seemed to work fine, so I hope it doesn't concern all of them... Cheers, Dom Share this post Link to post
vfbb 285 Posted May 7, 2022 2 hours ago, domus said: my test used a Gaussian blur effect and that seemed to work fine, so I hope it doesn't concern all of them... AE covers all kinds of animation, there are effects and raster features, for example, that would not even make sense to be supported in lottie, because the idea of lottie is to be vectorized and lightweight. Lastly, lottie and the bodymovin plugin are constantly developing and adding new features every day, so blogs from 1 year ago may no longer reflect reality. Share this post Link to post
domus 1 Posted May 7, 2022 As an aside, this test rendered the animation perfectly when loaded and played in the https://lottiefiles.com/ site. Don't know if this is useful info. Share this post Link to post
domus 1 Posted May 8, 2022 Is there any Skia4delphi specific documentation for TSkShader etc.? Or do we use https://api.skia.org/? Thx! Share this post Link to post
vfbb 285 Posted May 8, 2022 15 hours ago, domus said: As an aside, this test rendered the animation perfectly when loaded and played in the https://lottiefiles.com/ site. Don't know if this is useful info. Can you send me your lottie file? 10 minutes ago, domus said: Is there any Skia4delphi specific documentation for TSkShader etc.? Or do we use https://api.skia.org/? Official skia documentation is incomplete, but it helps. The official skia api is very similar to Skia4Delphi, just few methods and functions have been renamed for readability. I imagine you want to know more about custom shaders. They are made in SKSL language, using the SkRuntimeEffect class to build the shader. See some useful links below: SKSL doc: https://skia.org/docs/user/sksl/ SKSL playground: https://shaders.skia.org/ SkiaSimpleShaderViewer - Demo using custom shaders in skia4delphi: https://github.com/jimmckeeth/SkiaSimpleShaderViewer BricksGame - Game using custom shaders in skia4delphi: https://github.com/skia4delphi/skia4delphi/tree/main/Samples/Webinar - Game/FMX Skia4Delphi Demo using custom shaders in two units: https://github.com/skia4delphi/skia4delphi/blob/main/Samples/Demo/FMX/Source/Sample.Form.RuntimeEffects.pas https://github.com/skia4delphi/skia4delphi/blob/main/Samples/Demo/FMX/Source/Sample.Form.Filter.pas There is also new documentation from the android team, which is AGSL section. Android Graphics Shader Language (AGSL) is Skia Shader Language (SKSL), the android team just changed the name: https://developer.android.com/guide/topics/graphics/agsl You can also solve all your doubts on our telegram channel: https://t.me/skia4delphi Share this post Link to post
domus 1 Posted May 10, 2022 (edited) On 5/8/2022 at 4:11 PM, vfbb said: Can you send me your lottie file? You can also solve all your doubts on our telegram channel: https://t.me/skia4delphi Sent you all the stuff over Telegram, but the day after, Telegram tells me "no messages here yet." Bliss, now I'm also raising issues with the software that I have to use to raise an issue with other software. Will try again later. This is 2022. Communication is hard. Edited May 10, 2022 by domus Share this post Link to post
John van de Waeter 7 Posted July 15, 2022 Hi Vfbb, I installed skia4delphi a couple of months ago, (not via GetIt) and I'm not sure if it's the latest version. Where can I see the installed version number? Tnx, John Share this post Link to post
vfbb 285 Posted July 15, 2022 19 minutes ago, John van de Waeter said: I installed skia4delphi a couple of months ago, (not via GetIt) and I'm not sure if it's the latest version. Where can I see the installed version number? Skia.pas has a version: https://github.com/skia4delphi/skia4delphi/blob/d6feb7784c90623cef5b8948b12a5239eea2e4a0/Source/Skia.pas#L36 The latest version is 3.4.0. We will release a major version in few weeks. 1 Share this post Link to post