Skip to content

About

SkiaSharp rendering straight into game engine textures on the GPU: MonoGame, KNI, FNA, raylib, Stride, BRUTAL, Godot and Unity

Resources

Stars

7 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

Skia Game Rendering

NuGet Join the chat

Draw SkiaSharp vector art, text and SVG straight into MonoGame, KNI, FNA, raylib, Stride, Godot and Unity textures on the GPU, with no CPU readback.

Platform Support

Engine Backend Package Platforms
MonoGame 3.8.4 DesktopGL, OpenGL SkiaGameRendering Windows, Linux, macOS
3.8.4 WindowsDX, D3D11 SkiaGameRendering.WindowsDX Windows
3.8.6 WindowsDX12, D3D12 SkiaGameRendering.WindowsDX12 Windows
3.8.4 Android, OpenGL ES SkiaGameRendering.Android Android 7+
3.8.4 iOS, OpenGL ES SkiaGameRendering.iOS iOS 15+
KNI DesktopGL, OpenGL SkiaGameRendering.Kni.DesktopGL Windows, Linux, macOS
WindowsDX, D3D11 SkiaGameRendering.Kni.WindowsDX Windows
Android, OpenGL ES SkiaGameRendering.Kni.Android Android 7+
iOS, OpenGL ES SkiaGameRendering.Kni.iOS iOS 15+
WebGL (Blazor), WebGL2 SkiaGameRendering.Kni.WebGL Browser
raylib OpenGL SkiaGameRendering.Raylib.OGL Windows, Linux, macOS
WebGL2 SkiaGameRendering.Raylib.WebGL Browser (.NET 10)
FNA D3D11 SkiaGameRendering.Fna.WindowsDX Windows
OpenGL SkiaGameRendering.Fna.OGL Windows, Linux, macOS
WebGL2 SkiaGameRendering.Fna.WebGL Browser
Stride D3D11 SkiaGameRendering.Stride.D3D11 Windows
Vulkan SkiaGameRendering.Stride.VK Windows, Linux, macOS
D3D12 SkiaGameRendering.Stride.D3D12 Windows
BRUTAL Vulkan SkiaGameRendering.Brutal Windows, Linux, macOS (MoltenVK)
OpenGL SkiaGameRendering.Brutal.OGL Windows, Linux, macOS
Godot 4.7+ Vulkan, D3D12, Metal, OpenGL 3.3 Source only Windows, Linux, macOS
Unity 6 D3D11, D3D12, Vulkan, OpenGL, Metal, OpenGL ES UPM Windows x64, macOS, Android

Quick Start

Skia draws straight into whatever the engine is rendering to:

A red circle, a blue SVG water drop and a pink-to-purple gradient rounded rectangle

// once, e.g. in LoadContent
_skia = new SkiaDirectCanvas(GraphicsDevice);
_red = new SKPaint { Color = SKColors.Red, IsAntialias = true };
_drop = new SKSvg(); // Svg.Skia
_drop.Load("drop.svg");
_gradient = new SKPaint
{
    IsAntialias = true,
    Shader = SKShader.CreateLinearGradient(new SKPoint(420, 20), new SKPoint(580, 180),
        new[] { new SKColor(0xF7, 0x25, 0x85), new SKColor(0x72, 0x09, 0xB7) }, SKShaderTileMode.Clamp),
};

// every frame, in Draw
_skia.Begin();
_skia.Canvas.DrawCircle(100, 100, 80, _red);
_skia.Canvas.DrawPicture(_drop.Picture, 220, 20);
_skia.Canvas.DrawRoundRect(new SKRect(420, 20, 580, 180), 32, 32, _gradient);
_skia.End();

Setup differs per engine; pick yours from the table above.

More

License

MIT License. See LICENSE.md.

Credits

Originally created by Miguel Anxo Figueirido.

About

SkiaSharp rendering straight into game engine textures on the GPU: MonoGame, KNI, FNA, raylib, Stride, BRUTAL, Godot and Unity

Resources

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages