Skip to content

Latest commit

 

History

History
18 lines (10 loc) · 1.37 KB

README.md

File metadata and controls

18 lines (10 loc) · 1.37 KB

.NET MAUI Shaders Carousel Demo

demo.mp4

Among some stunning features, SkiaSharp version 3 brought the latest SKSL syntax. Can now use official samples etc, to create shaders for .NET MAUI.

An important new possibility is to port existing GLSL shaders into the modern SKSL, what was done in this case. Adapted GLSL shaders from https://github.com/gl-transitions/gl-transitions were used.

One could use the code to serve as a stand-alone control inside a usual MAUI app, just reference/initialize DrawnUI nuget then put the canvas with a drawn carousel anywhere. You could ship shader files inside the app Raw folder or even as strings in code or from resources.

Do not run this app on iOS and Catalyst simulators as SkiaSharp is not supporting their hardware acceleration at this time.

DrawnUI preview nuget allowed to use SkiaSharp intuitively on a hardware-accelerated Skia canvas.

What's behind: subclassed SkiaShader effect to create a custom one with transitions and attached it to a customized SkiaCarousel via VisualEffects property.

Our ShaderTransitionEffect uses SkSl helper to load shader source from app resources, then compile it into a SKRuntimeEffect to be used while painting.