Ab4d.SharpEngine.Samples
Samples for Ab4d.SharpEngine (cross-platform 3D rendering engine)
Install / Use
/learn @ab4d/Ab4d.SharpEngine.SamplesREADME
Ab4d.SharpEngine.Samples

Welcome to the Samples for Ab4d.SharpEngine.
Ab4d.SharpEngine is a cross-platform 3D rendering engine for desktop, mobile and browser .Net applications.
<br/>The engine uses Vulkan for desktop and mobile apps (use Ab4d.SharpEngine NuGet package).<br/> For the browser and browser based apps like Electron, the engine uses WebGL (use Ab4d.SharpEngine.WebGL NuGet package).
<br/>Key features of the engine:
- Using any coordinate system (y-up or z-up, right-handed or left-handed)
- Many SceneNode objects (boxes, spheres, planes, cones, lines, poly-lines, curves, etc.)
- Render line caps (arrows, etc.), line with pattern, poly-lines with miter or bevel connections, hidden lines <sup>*</sup>
- Object instancing (InstancedMeshNode)
- Render vector and bitmap text
- Advanced mesh generation: Boolean operations, extrusions, lathe, triangulation with holes.
- Cameras: TargetPositionCamera, FirstPersonCamera, FreeCamera, MatrixCamera
- Camera controllers that can rotate the camera around the mouse position, zoom to position and other advanced functions
- Lights: AmbientLight, DirectionalLight, PointLight, SpotLight, CameraLight
- Effects: StandardEffect, SolidColorEffect, VertexColorEffect, ThickLineEffect, PixelEffect, PhysicallyBasedRenderingEffect <sup>*</sup>
- Improved visual quality with super-sampling and multi-sampling <sup>*</sup>
- Render CT and MRI scans by using Volume rendering <sup>*</sup>
- Included reader and writer for .obj and .stl files
- Import 3D objects from glTF files and export the scene to glTF file by using Ab4d.SharpEngine.glTF
- Assimp importer that uses a third-party library to import 3D models from almost any file format <sup>*</sup>
<sup>*</sup> Some features are not available for the browser (WebGL) version of the engine. See Ab4d.SharpEngine.WebGL implementation details.
<br/>Ab4d.SharpEngine library is a commercial library, but it is also free for non-commercial open-source projects.
The commercial license can be purchased from purchase web page. With a commercial license, you also get priority email support and other benefits (feature requests, online support on your projects with screen sharing, etc.). To get a trial license for your own projects (not needed for the sample projects in this repo) or to apply for the free open-source license, see the ab4d.com/trial.
Platforms and UI frameworks
Desktop and mobile platforms
Desktop and mobile platforms require Ab4d.SharpEngine NuGet package that uses Vulkan for rendering. For the browser and browser based apps like Electron, the engine uses WebGL (use Ab4d.SharpEngine.WebGL NuGet package) - see below.
Windows:
- AvaloniaUI support with SharpEngineSceneView control (Ab4d.SharpEngine.AvaloniaUI library)
- WPF full composition support with SharpEngineSceneView control (Ab4d.SharpEngine.Wpf library)
- WinUI 3 support with SharpEngineSceneView control (Ab4d.SharpEngine.WinUI library)
- WinForms support with SharpEngineSceneView control (Ab4d.SharpEngine.WinForms library)
- Uno Platform
- MAUI
- Using SDL or Glfw (using a third-party Silk.Net library; the same project also works on Linux)
- ImGui (using a third-party ImGui.NET library)
Linux (including Raspberry PI 4 and similar devices):
- AvaloniaUI support with SharpEngineSceneView control (Ab4d.SharpEngine.AvaloniaUI library)
- Uno Platform
- Using SDL or Glfw (using third-party Silk.Net library; the same project also works on Windows)
- Off-screen rendering combined with Linux framebuffer display (FbDev or DRM/KMS).
- ImGui (using a third-party ImGui.NET library)
- See "Vulkan on Raspberry Pi 4" guide on how to use SharpEngine on Raspberry Pi 4 with an external monitor.
Android:
- Using AvaloniaUI with SharpEngineSceneView control (Ab4d.SharpEngine.AvaloniaUI library).
- Using SurfaceView in C# Android Application
- MAUI
macOS:
- Using AvaloniaUI with SharpEngineSceneView control (Ab4d.SharpEngine.AvaloniaUI library). It requires the MoltenVK library. See "Building for macOS and iOS" below.
- Using MAUI - requires MoltenVK library - see "Building for macOS and iOS" below.
iOS:
- AvaloniaUI with SharpEngineSceneView control (Ab4d.SharpEngine.AvaloniaUI library). It requires the MoltenVK library. See "Building for macOS and iOS" below.
- Using MAUI - requires MoltenVK library - see "Building for macOS and iOS" below.
Browser platform
Browser and browser based apps like Electron require Ab4d.SharpEngine.WebGL NuGet package that uses WebGL rendering.
-
Blazor WebAssembly provided the best integration and is the only platform that supports full debugging.
-
HTML and JavaScript are enough to run the project with Ab4d.SharpEngine.WebGL that was compiled into wasm. To show the 3D scene in the browser, you can use any web server. The samples for the following web servers are provided:
- ASP.NET Core
- Node.js with Express
- Python SocketServer
-
Electron app can use the same wasm build as the browser
Dependencies:
- The core Ab4d.SharpEngine library has NO EXTERNAL dependencies.
- The core Ab4d.SharpEngine.WebGL library has NO EXTERNAL dependencies.
- The Ab4d.SharpEngine.Wpf has NO EXTERNAL dependencies.
- The Ab4d.SharpEngine.WinUI has NO EXTERNAL dependencies.
- The Ab4d.SharpEngine.WinForms has NO EXTERNAL dependencies.
- The Ab4d.SharpEngine.AvaloniaUI library requires Avalonia library.
- The Ab4d.SharpEngine.glTF has NO EXTERNAL dependencies. But to load draco compressed meshes, the draco library is required (for example, Openize.Drako).
System requirements to run the samples:
- NET 6.0+
- NET 8.0+ is required to use MAUI
- NET 9.0+ is required to use Ab4d.SharpEngine.WebGL (for the browser)
System requirements to open the sample projects:
- Visual Studio 2026 on Windows to open all the projects because they use .Net 10 by default (by lowering the TargetFramework to .Net 8 or 9, you can also use Visual Studio 2022).
- Rider from JetBrains on Windows, Linux and macOS
- Visual Studio Code on Windows, Linux and macOS
Sample solutions
Desktop and mobile samples
The following .Net solutions (.sln files) are available for desktop and mobile platforms:
-
Ab4d.SharpEngine.Samples.AvaloniaUI
This sample uses Avalonia UI (https://avaloniaui.net/) that provides WPF-like object model to build UI controls and can run on Windows, Linux and macOS. This sample uses Ab4d.SharpEngine.AvaloniaUI library that provides SharpEngineSceneView control. The SharpEngineSceneView provides an Avalonia control that is very easy to use and can compose the 3D scene with the Avalonia UI objects (for example, showing buttons on top of the 3D scene). The sample can be started on Windows, Linux, and macOS. See also "Building for macOS and iOS" section for more information on how to compile for macOS. -
Ab4d.SharpEngine.Samples.AvaloniaUI.VulkanBackend
This sample uses Avalonia UI, which uses Vulkan as a backend, so the whole application is using Vulkan API (the UI controls are also rendered by Vulkan instead of DirectX or OpenGL as by default). Vulkan backend is setup in the Program.cs file. This provides the best integration of 2D UI and 3D graphics. This sample can run only on Windows. -
Ab4d.SharpEngine.Samples.AvaloniaUI.CrossPlatform
This sample shows how to create an Avalonia app that can run on Windows, Linux, macOS, Android and iOS. This sample uses Ab4d.SharpEngine.AvaloniaUI library that provides SharpEngineSceneView control. Because Vulkan is not natively supported on macOS and iOS, the MoltenVK library is required to translate the Vulkan calls to Molten API calls. See also "Building for macOS and iOS" section for more information on how to compile for iOS. Note that folder and file names in this solution have been shortened to prevent problems with max path size on Windows (260 chars). -
Ab4d.SharpEngine.Samples.Wpf
This solution provides the samples for WPF and can run only on Windows. The samples also use Ab4d.SharpEngine.Wpf library that provides SharpEngineSceneView control for WPF. The SharpEngineSceneView provides a WPF control that is very easy to use and can compose the 3D scene with the WPF objects (for example, showing buttons on top of the 3D scene). -
Ab4d.SharpEngine.Samples.WinUI
This sample uses WinUI 3.0, which provides the latest UI technology to create applications for Windows. This sample uses Ab4d.SharpEngine.WinUI library that provides SharpEngineSceneView control. The SharpEngineSceneView provides a WinUI control that is very easy to use and can compose the 3D scene with the WinUI UI objects (for example, showing buttons on top of the 3D scene). -
Ab4d.SharpEngine.Samples.UnoPlatform
This sample uses Uno Platform, which provides a cross-plaform UI technology to create applications. Ab4d.SharpEngine samples for Uno Platform can run on Windows, macOS and Linux. Because this sample uses centralized .Net project configuration, the solution file (.sln) is located in the Ab4d.SharpEngine.Samples.UnoPlatform folder. -
Ab4d.SharpEngine.Samples.WinForms
This solution provides the samples for WinForms and can run only on Windows. The samples also use A
