VL.StandardLibs icon indicating copy to clipboard operation
VL.StandardLibs copied to clipboard

Render Avalonia into 3d textures using Skia with ANGLE backend

Open tebjan opened this issue 4 years ago • 2 comments

existing implementation to check: https://github.com/TheKeyblader/Stridelonia

Avalonia Skia gpu setup: https://github.com/AvaloniaUI/Avalonia/tree/master/src/Skia/Avalonia.Skia/Gpu

GPU implementation for WebGL as an example: https://github.com/AvaloniaUI/Avalonia/blob/master/src/Web/Avalonia.Web.Blazor/BlazorSingleViewLifetime.cs https://github.com/AvaloniaUI/Avalonia/blob/master/src/Web/Avalonia.Web.Blazor/BlazorSkiaGpu.cs

Also interesting for running skia with ANGLE: https://github.com/mono/SkiaSharp/issues/745 https://github.com/mono/SkiaSharp/tree/main/source/SkiaSharp.Views/SkiaSharp.Views.UWP/GlesInterop https://hg.mozilla.org/mozilla-central/file/tip/gfx/gl/SharedSurfaceD3D11Interop.cpp

Step 2: if we got Skia GPU images from a shared texture handle, we can also render 3d content into an Avalonia app.

tebjan avatar Jan 27 '22 22:01 tebjan

Avalonia already have code about angle Some additional resources : https://github.com/AvaloniaUI/Avalonia/tree/master/src/Windows/Avalonia.Win32.Interop https://github.com/AvaloniaUI/Avalonia/tree/master/src/Avalonia.OpenGL/Angle

how to bind textures https://github.com/microsoft/angle/wiki/Interop-with-other-DirectX-code

TheKeyblader avatar Feb 02 '22 16:02 TheKeyblader

Avalonia also supports rendering with Direct2D. Wouldn't it make more sense to go that route? At least in my experience Skia tends to cause performance problems. Found this video. It's pretty old so don't know if things are still the same / comparable, but judging from it Avalonia + Direct2d looks like a clear winner.

bj-rn avatar May 01 '23 13:05 bj-rn