Ab4d.SharpEngine
3.1.9316
dotnet add package Ab4d.SharpEngine --version 3.1.9316
NuGet\Install-Package Ab4d.SharpEngine -Version 3.1.9316
<PackageReference Include="Ab4d.SharpEngine" Version="3.1.9316" />
<PackageVersion Include="Ab4d.SharpEngine" Version="3.1.9316" />
<PackageReference Include="Ab4d.SharpEngine" />
paket add Ab4d.SharpEngine --version 3.1.9316
#r "nuget: Ab4d.SharpEngine, 3.1.9316"
#:package Ab4d.SharpEngine@3.1.9316
#addin nuget:?package=Ab4d.SharpEngine&version=3.1.9316
#tool nuget:?package=Ab4d.SharpEngine&version=3.1.9316
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) that allows rendering millions of mesh instances
- Simple to use 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
- Improved visual quality with super-sampling and multi-sampling
- Many post-processing effects
- Render vector and bitmap text
- 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
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
Product | Versions 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. |
-
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.9316 | 251 | 7/7/2025 |
3.1.9300-rc3 | 177 | 6/18/2025 |
3.1.9299-rc2 | 165 | 6/17/2025 |
3.1.9287-rc1 | 172 | 6/5/2025 |
3.0.9208 | 455 | 3/19/2025 |
3.0.9196 | 693 | 3/6/2025 |
3.0.9195-rc4 | 249 | 3/5/2025 |
3.0.9175-rc3 | 192 | 2/13/2025 |
3.0.9173-rc2 | 144 | 2/11/2025 |
3.0.9169-rc1 | 174 | 2/7/2025 |
2.1.9118-beta2 | 178 | 12/19/2024 |
2.1.9028-beta1 | 203 | 9/20/2024 |
2.0.8956 | 1,356 | 7/9/2024 |
2.0.8951 | 305 | 7/4/2024 |
2.0.8941-rc2 | 222 | 6/24/2024 |
2.0.8936-rc1 | 211 | 6/19/2024 |
1.0.8740 | 1,728 | 12/7/2023 |
0.9.20-rc1 | 281 | 11/15/2023 |
0.9.18-beta6 | 255 | 10/20/2023 |
0.9.16-beta5 | 226 | 9/15/2023 |
0.9.15-beta4 | 647 | 8/23/2023 |
0.9.14-beta3 | 288 | 8/4/2023 |
0.9.13-beta3 | 1,034 | 7/11/2023 |
0.9.11-beta3 | 233 | 5/11/2023 |
0.9.10-beta3 | 177 | 5/10/2023 |
0.9.8-beta2 | 613 | 4/16/2023 |
0.9.0-beta1 | 285 | 12/14/2022 |
Ab4d.SharpEngine v3.1.9316:
- Removed "Additional mobile developer license" that needed to be purchased in the previous version to use the SharpEngine on mobile devices. The standard license now also supports mobile development. Users with an existing standard license just need to start using v3.1 to be able to use the library on mobile devices.
- Improved rendering of semi-transparent objects:
- When using StandardMaterial or SolidColorMaterial with alpha values between 0 and 1, the objects are now correctly rendered - before, the rendered colors were too dark because the alpha value was applied twice.
- Added IsPreMultipliedAlphaColor property to VertexColorMaterial, PixelMaterial and PixelsNode (false by default) so the user can device whether the alpha value is pre-multiplied or not. If it is set to true, then the red, green and blue color values are multiplied with the alpha value.
- Added IsPreMultipliedAlphaColor property to InstancedMeshNode.
- Added ModelOptimizer class that can be used to optimize the GroupNode by combining meshes in SceneNodes with the same materials. This can be used on static 3D models and can significantly improve rendering performance by reducing the number of draw calls.
- 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-process effect, create an instance of a post-process class and add it to SceneView.PostProcesses collection.
- 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 support for rendering object outlines that can be shown over rendered objects. See the new "Advanced / Outlines over objects" sample.
- 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.
- 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 widths and heights. The TextureMapping can be changed from the default Rectangular to RadialFromCenter or to RadialFromInnerRadius which can be used to create a radial gradient effect.
- 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.
- Added DepthOnlyMaterial and DepthOnlyEffect that can be used to create depth pre-pass rendering (can improve performance by reducing the number of fragment shader invocations on 3D scenes with a lot of overdraw). See comments in new Advanced / DepthPrePassSample for more info.
- Added Color4.SetAlpha overload that also takes premultiplyAlpha parameter and can also pre-multiply red, green and blue color values with the alpha value.
- Added IsTwoSided property to SolidColorMaterial. When it is true, then the front and the backside of the triangles are rendered with one draw call.
- 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, this can happen when the samples app is started from "dotnet run .". In this case the CurrentDirectory is set to the csproj path and not to the output folder.
- Added TextureLoader.CreateTextureAsync that takes RawImageData instead of a file name or file stream.
- Added VulkanDevice.GetDeviceLocalMemoryBudget and GetHostVisibleMemoryBudget to easily query for the available memory.
- 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.
- 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 in the event args 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.
- Added PngBitmapIO.FileNotSupportedResolver property that can be assigned to a callback function that replaces the unsupported file (not in .png format) with an alternative file in .png file format.
- Added MeshUtils.GetStandardVerticesArray method.
- Added ModelUtils.MakeTwoSidedMaterial and ModelUtils.SetAlphaClipThreshold methods.
- 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.
- Added UseTwoSidedMaterials property to ObjImporter.
- 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 (currently, the default sempler 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.
- In WPF improved handling situations when the primary monitor is changed (for example, if the external monitor is the primary monitor and it is disconnected). Also, if the primary graphics card is changed, then the SharpEngineSceneView can automatically switch to using WritableBitmap).
- 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.
- Removed CommonStatesManager.DepthWrite because depth write without depth read is not supported.
- Updated StandardEffect and SolidColorEffect by changing many private fields to protected. This simplifies creating derived types, for example, to create an effect with special pipeline settings.
- By default, the VK_EXT_custom_border_color extension is not enabled (this prevents a preformance warning). 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.
- When float color value in Color3 and Color4 is converted into byte values, the byte values are 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) - this is closer to 1/4 * 255.
- 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.
- Improved PointerCameraController when Orthographic camera is used, ZoomMode is set to PointerPosition and the user zooms to an area without any 3D objects. Now, the PointerCameraController zooms to a 3D point under the mouse instead of zooming to the center.
- Improved allocating host memory when GPU runs out of device local memory.
- 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).
- 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.
- Improved MeshFactory.CreateCircleMesh methods by adding innerRadius, startAngle, heightScaleFactor and textureMapping properties
- Improved LineUtils.GetWireframeLinePositions and EdgeLinesFactory to generate line positions also when the mesh does not have TriangleIndices defined.
- 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 / copy 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).
- 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.
- Removed CameraLight when the camera object that created the CameraLight is removed from the SceneView.Camera.
- When disposing SceneNode, the Tag property is set to null. This disconnects any user object so the GC can collect the object.
- GpuImage.Resize now resets the CurrentImageLayout, CurrentImageAccessMask and CurrentImageStageMask.
- Fixed disposing Vulkan DescriptorSets in PixelEffect when pixels with textures are rendered.
- 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.
- 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.
- 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 existing file is longer than the new file, then some data is 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 divisible by 3.
- 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.
Breaking changes (renamed parameters and classes):
- Renamed parameter name checkMaterials to removeUnusedMaterials in MultiMaterialModelNode.RemoveSubMesh method. Reason: the new name more clearly defines the purpose of the parameter.
- Renamed the textureWidth to textureSize parameter name in the TextureFactory.CreateGradientTexture method. Reason: after an optional isHorizontal parameter is added to the method, the parameter can also define the texture height.
- ReaderObj was renamed to ObjImporter. Also, its ReadSceneNodes method was renamed to Import method. The ReaderObj class and its ReadSceneNodes method are still available but are marked as obsolete. Reason: this makes the names more consistent with AssimpImporter and glTFImporter.