Ab4d.SharpEngine 3.1.9300-rc3

This is a prerelease version of Ab4d.SharpEngine.
dotnet add package Ab4d.SharpEngine --version 3.1.9300-rc3
                    
NuGet\Install-Package Ab4d.SharpEngine -Version 3.1.9300-rc3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ab4d.SharpEngine" Version="3.1.9300-rc3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ab4d.SharpEngine" Version="3.1.9300-rc3" />
                    
Directory.Packages.props
<PackageReference Include="Ab4d.SharpEngine" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ab4d.SharpEngine --version 3.1.9300-rc3
                    
#r "nuget: Ab4d.SharpEngine, 3.1.9300-rc3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Ab4d.SharpEngine&version=3.1.9300-rc3&prerelease
                    
Install Ab4d.SharpEngine as a Cake Addin
#tool nuget:?package=Ab4d.SharpEngine&version=3.1.9300-rc3&prerelease
                    
Install Ab4d.SharpEngine as a Cake Tool

Ab4d.SharpEngine

Ab4d.SharpEngine is a cross-platform Vulkan based 3D rendering engine for desktop and mobile .Net applications.

Vulkan is a high performance graphics and cross-platform API that is similar to DirectX 12 but can run on multiple platforms.

The following features are supported by the current version:

  • 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 mitter or bevel connections, hidden lines
  • Object instancing (InstancedMeshNode)
  • Cameras: TargetPositionCamera, FirstPersonCamera, FreeCamera, MatrixCamera
  • Camera controllers with rotate around mouse position, zoom to position and other advanced functions
  • Lights: AmbientLight, DirectionalLight, PointLight, SpotLight, CameraLight
  • Effects: StandardEffect, SolidColorEffect, VertexColorEffect, ThickLineEffect
  • Improved visual quality with super-sampling and multi-sampling
  • Render vector and bitmap text
  • ReaderObj to read 3D models from obj 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

Samples

Ab4d.SharpEngine.Samples on GitHub

Platforms and UI frameworks:

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). Requires MoltenVK library - see special project for macos.
  • Using MAUI - requires MoltenVK library - see Building for macOS and iOS below.

iOS:

  • AvaloniaUI with SharpEngineSceneView control (Ab4d.SharpEngine.AvaloniaUI library). Requires MoltenVK library - see Building for macOS and iOS below.
  • Using MAUI - requires MoltenVK library - see "Building for macOS and iOS" below.

Online help

Online Ab4d.SharpEngine Reference help

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (7)

Showing the top 5 NuGet packages that depend on Ab4d.SharpEngine:

Package Downloads
Ab4d.SharpEngine.AvaloniaUI

Ab4d.SharpEngine.AvaloniaUI defines Avalonia controls that can show 3D scene rendered by Ab4d.SharpEngine rendering engine

Ab4d.SharpEngine.WinUI

Ab4d.SharpEngine.WinUI defines WinUI controls that can show 3D scene rendered by Ab4d.SharpEngine rendering engine

Ab4d.SharpEngine.Assimp

Ab4d.SharpEngine.Assimp provides classes that can use Assimp importer to import 3D objects into Ab4d.SharpEngine 3D rendering engine

Ab4d.SharpEngine.Wpf

Ab4d.SharpEngine.Wpf defines WPF controls that can show 3D scene rendered by Ab4d.SharpEngine rendering engine

Ab4d.SharpEngine.glTF

Ab4d.SharpEngine.glTF library provides a glTF 2.0 importer that can import 3D objects from glTF files to Ab4d.SharpEngine 3D objects. The library also provides a glTF exporter that can export the 3D scene created by Ab4d.SharpEngine to the glTF file.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.1.9300-rc3 33 6/18/2025
3.1.9299-rc2 50 6/17/2025
3.1.9287-rc1 162 6/5/2025
3.0.9208 413 3/19/2025
3.0.9196 608 3/6/2025
3.0.9195-rc4 240 3/5/2025
3.0.9175-rc3 184 2/13/2025
3.0.9173-rc2 133 2/11/2025
3.0.9169-rc1 164 2/7/2025
2.1.9118-beta2 166 12/19/2024
2.1.9028-beta1 194 9/20/2024
2.0.8956 1,334 7/9/2024
2.0.8951 288 7/4/2024
2.0.8941-rc2 214 6/24/2024
2.0.8936-rc1 205 6/19/2024
1.0.8740 1,709 12/7/2023
0.9.20-rc1 271 11/15/2023
0.9.18-beta6 243 10/20/2023
0.9.16-beta5 215 9/15/2023
0.9.15-beta4 631 8/23/2023
0.9.14-beta3 275 8/4/2023
0.9.13-beta3 1,017 7/11/2023
0.9.11-beta3 220 5/11/2023
0.9.10-beta3 156 5/10/2023
0.9.8-beta2 598 4/16/2023
0.9.0-beta1 269 12/14/2022

Ab4d.SharpEngine v3.1.9300-RC3:
- Fixed disposing Vulkan DescriptorSets in PixelEffect when pixels with textures are rendered.    

   
Ab4d.SharpEngine v3.1.9299 (RC2):
- Fixed applying pre-multiplied alpha value when using StandardEffect. Before the semi-transparent colors may be rendered too dark when using black background color.
- Fixed using KeyboardModifiers for Shift and Alt in PointerCameraController. This bug was introduced in v3.1.9287-RC1.
- Prevented zooming with PointerCameraController when using horizontal scroll wheel.
- Prevented creating too many Vulkan Semaphore and Fence objects when using Avalonia with Vulkan backend.
- Fixed rendering rapidly changing texture that is set to a SolidColorMaterial. Before such texture may be blinking.ž
- By defautl the VK_EXT_custom_border_color extension is not enabled. This may be needed when using ExpandPostProcess and when the SceneView's BackgroundColor is not transparent, white or black but some other custom color. In this case the extension can be enabled by setting the EngineCreateOptions.EnableCustomBorderColors to true.
- Added a default implementation for PngBitmapIO.FileNotFoundResolver that tries to resolve the file name by combining it with the base directory of the application. This can help to load texture from samples if they are specified relative to the output folder and the samples app is not started from the output folder, for example from "dotnet run ." that preserves the CurrentDirectory to the csproj path.
- Improved rendering lines with line caps (e.g. arrows and other line endings): fixed hiding lines with line caps when Visibility is set to Hidden; prevented renderning only line cap when line cap when LineThickness is set to 0; fixed transforming the line with line caps when Transformation is set after the line was already rendered.
- When float color value in Color3 and Color4 is converted into byte value, the byte value is now rounded (using ToArgb, ToBgra, and similar methods). For example, before the 0.25f value was converted into 63 (0.25f * 255f = 63.75f) and now it is converted into 64 (rounded value); now the 0.25f is converted to 64 which is closer to 1/4 * 255.
- Fixed rendering pixles with PixelsNode when per-pixel colors with semi-transparent colors are used. The PixelColors should not be alpha pre-multiplied because they are now pre-multiplied in the shader.

- Improved glTFImporter from Ab4d.SharpEngine.glTF library to support using thrid-party draco compression decoder (for example Openize.Drako). See the updated Importers/GltfImporterExporterSample on how to support Draco compressed glTF files.
   
   
Ab4d.SharpEngine v3.1.9287 (RC1):
- Added support for PostProcess effects. The following post-process effects are included in this version: SobelEdgeDetectionPostProcess, BlackAndWhitePostProcess, ToonShadingPostProcess, GammaCorrectionPostProcess, ColorOverlayPostProcess, ExpandPostProcess and GaussianBlurPostProcess. HsvColorPostProcess is available with full source code in the samples project. To add a post-proces effect, create an instance of a post process class and add it to SceneView.PostProcesses collection.
- Added support for rendering object outlines that can be shown over rendered objects. See the new "Advanced / Outlines over objects" sample.
- Added InstancedTextNode that can render millions of characters by using very efficient mesh instancing.
- Added support for rendering textures on instanced models. To use texture, call the new SetDiffuseTexture method on InstancedMeshNode.
- Added support for rendering textures for each pixel that is rendered by PixelsNode. This can be used to render millions of billboards.
- Added StlImporter and StlExporter that can import and export .stl files.
- Added ObjExporter that can export the Scene or individual SceneNodes to .obj file (note: ObjImporter was already available).
- Added new overloads to GetAllHitObjects method in SceneView and Scene objects. The new overloads take a List of RayHitTestResult as the first parameter. This allows reusing the list and prevents creating a new list on each hit test.
- Added new overload to Scene.GetHitSceneNodeBounds that takes a List of SceneNode as the first parameter.
- Added ModelOptimizer class that can be used to optimize the GroupNode by combining meshes in SceneNodes with the same materials. This can significantly reduce the number of draw calls.
- Added support for rendering wide lines when using macOS. This requires a special build of libMoltenVK.dylib that supports wide lines (see https://github.com/KhronosGroup/MoltenVK#metal_private_api). You can get the precompiled dylib file from the "lib\MoltenVK\macos-arm64_x86_64\widelines-v1.3 folder" in the sample repo.
- Improved VulkanDevice.GetMemoryBudget method to return a list of MemoryHeapBudget records. Each record contains information about the memory heap, its size, used size and available size. The previous method returned the PhysicalDeviceMemoryBudgetPropertiesEXT struct that required unsafe code to be read.
- Added VulkanDevice.GetDeviceLocalMemoryBudget and GetHostVisibleMemoryBudget to easily query for the available memory.
- Improved PointerCameraController when Orthographic camera is used, ZoomMode is set to PointerPosition and the user zooms to an area without any 3D object. Now, the PointerCameraController zooms to a 3D point under the mouse instead of zooming to the center.
- Added CameraController.CustomRotationCenterPositionProvider Func that can be used to provide custom rotation center position and zoom to position when using PointerCameraController. It can be used instead of overriding the virtual GetRotationCenterPositionFromPointerPosition method.
- Improved allocating host memory when GPU runs out of device local memory.
- Added TextureLoader.CreateTextureAsync that takes RawImageData instead of a file name or file stream.
- Improved CreateHeightMapSurfaceMesh method so it correctly defines the Y value for the BoudingBox. Also, the generated mesh is now precisely the required size. Before, the size was smaller for 1 / segments_count.
- Show an error message with detailed instructions when the Vulkan device is not available (for example, when MoltenVK is not present on macOS or iOS).
- Added GpuDevice.OutOfMemoryOccured event. It is triggered when a memory allocation fails with OutOfMemory error. The user can subscribe to this event and manually free the required memory and then set the IsMemoryFreed property to true. This will try to allocate the memory again.
- Added SceneView.DisposeBackBuffers method that can be used to dispose the back buffers (GPU images that are used as render targets).
- Added SharpEngineSceneView.DisposeBackBuffersWhenHidden property that can be used to dispose the back buffers when the control is hidden. This can be used to free memory when the control is not visible. The default value is true.
- To improve memory usage, allocate images bigger than 64 MB to a dedicated memory block (instead of using a shared memory block for multiple images - in this case, some memory may be left unused). The default threshold value is 64 MB. This can be adjusted by changing the static EngineRuntimeOptions.ImageDedicatedMemoryAllocationThreshold.
- Removed setter from Transform.Value property. To set the matrix, use the MatrixTransform and its SetMatrix method.
- Added PngBitmapIO.FileNotSupportedResolver property that can be assigned to a callback function that replaces the unsupported file (not in .png format) to an alternative file in .png file format.
- Added MeshUtils.GetStandardVerticesArray method.
- Added ModelUtils.MakeTwoSidedMaterial and ModelUtils.SetAlphaClipThreshold methods.
- Improved CircleModelNode: added InnerRadius, StartAngle, HeightScaleFactor and TextureMapping properties and set default values to Normal and UpDirection. Added CreateRectangle method to create a rectangle from CircleModelNode. The InnerRadius can be used to create a circle that is hollow in the center. The StartAngle specified the start angle of the first position. HeightScaleFactor can be used to create an ellipse or rectangle (when Segments = 4) with different width and height. The TextureMapping can changed from default Rectangular to RadialFromCenter or RadialFromInnerRadius that can be used to create a radial gradient effect.
- Added an optional isHorizontal parameter to TextureFactory.CreateGradientTexture. It can be set to false to create a vertical texture (size: 1 x textureSize). This is needed to create a radial gradient effect on CircleModelNode.
- Improved MeshFactory.CreateCircleMesh methods by adding innerRadius, startAngle, heightScaleFactor and textureMapping properties
- Added UseTwoSidedMaterials property to ObjImporter.
- Improved LineUtils.GetWireframeLinePositions and EdgeLinesFactory to generate line positions also when the mesh does not have TriangleIndices defined.
- Added static BitmapTextCreator.GetDefaultBitmapFont and BitmapTextCreator.GetDefaultBitmapFontAsync methods.
- Added BitmapFont.GetFontPageGpuImage and BitmapFont.GetFontPageGpuImageAsync methods that can be used to get the GpuImage for the specified font page.
- Added PushConstantsBytes to RenderingItem. It can be used to easily assign push constants that can be used in the shader for a custom effect.
- Added Utilities.GpuSamplerManager.DefaultSampler that can be used to change the default texture sampler (the default semper is set to Mirror).
- Added ToRbgaArray, ToBgraArray and ToArgbArray methods to Color4 and Color3 classes. Also added ToRbgArray and ToBgrArray to Color3 class. Those methods return an array of 4 or 3 bytes with red, green, blue and alpha colors.
- Improved RawImageData by adding a constructor that takes a fillColor and creates a RawImageData with the specified color. Also, added a Clear method to clear the RawImageData and DrawImage method that can draw pixels from one RawImageData to another.

- Improved async methods to run on the UI thread when background upload is not supported (when SynchronizationContext is null).
- Fixed WireBoxNode, CornerWireBoxNode, WireCrossNode, RectangleNode, CircleLineNode, EllipseLineNode and EllipseArcLineNode when only a constructor was used to create the object (no property was set). In this case, the positions were not defined and no object was rendered.
- Fixed rendering MultiLineNode that uses PositionColoredLineMaterial with transparent colors.
- Swap the enum values for the KeyboardModifiers.ShiftKey and KeyboardModifiers.AltKey to match the values in WPF (ModifierKeys) and Avalonia (KeyModifiers). ShiftKey now has a value of 4, and AltKey has a value of 1.
- Fixed MeshFactory.SetBoxVerticesArray method.
- When VK_EXT_pageable_device_local_memory extension is available, then the "No compatible memory type" exception was prevented when resizing the SceneView control, and the GPU ran out of the device's local memory.
- Fixed PngBitmapIO to prevent throwing an exception if there are some invalid chunks present after the "IEND" chunk.
- Fixed PngBitmapIO.SaveBitmap when saving to a file name of an existing file. The new method always creates a new file and does not overwrite the data in the existing file. This prevents that if the exiting file is longer than the new file, then some data are left from the previous file.
- Fixed rendering MultiLineNode with PositionColoredLineMaterial that defines transparent line colors.
- Fixed positioning text when using VectorFontFactory.CreateIndividualTextMeshes and when positionType is not Baseline.
- Fixed rendering SubMeshes in MultiMaterialModelNode when some of them are removed and then added again.
- Fixed ReaderObj when the obj file does not define normals. In this case, they are automatically calculated (this prevents showing black models).
- Fixed setting VertexCount and IndexCount in ModelNode when the positions and triangle indices are defined and not only when the VertexBuffer and IndexBuffer are created.
- Fixed reporting a duplicate number of draw calls, vertex count and some other statistics in RenderingStatistics when CameraAxisPanel or some other Overlay Panel was rendered.
- Fixed using SharpEngineSceneView for WPF when PresentationType is set to OverlayTexture and when SharpEngineSceneView's Visibility is set to Collapsed or Hidden and then back to Visible.
- Prevent "Index out of bounds" exception in EdgeLinesFactory if triangle indices count is not dividable by 3.
- Removed CameraLight when the camera object that created the CameraLight is removed from the SceneView.Camera.
- GpuImage.Resize now resets the CurrentImageLayout, CurrentImageAccessMask and CurrentImageStageMask.

- Renamed parameter name checkMaterials to removeUnusedMaterials in MultiMaterialModelNode.RemoveSubMesh method.
- Renamed the textureWidth to textureSize parameter name in the TextureFactory.CreateGradientTexture method.
- ReaderObj was renamed to ObjImporter. Also, its ReadSceneNodes method was renamed to Import method. This makes the names more consistent with AssimpImporter and glTFImporter. The ReaderObj class and its ReadSceneNodes method are still available but are marked as obsolete.