Ab4d.SharpEngine
4.0.9584
dotnet add package Ab4d.SharpEngine --version 4.0.9584
NuGet\Install-Package Ab4d.SharpEngine -Version 4.0.9584
<PackageReference Include="Ab4d.SharpEngine" Version="4.0.9584" />
<PackageVersion Include="Ab4d.SharpEngine" Version="4.0.9584" />
<PackageReference Include="Ab4d.SharpEngine" />
paket add Ab4d.SharpEngine --version 4.0.9584
#r "nuget: Ab4d.SharpEngine, 4.0.9584"
#:package Ab4d.SharpEngine@4.0.9584
#addin nuget:?package=Ab4d.SharpEngine&version=4.0.9584
#tool nuget:?package=Ab4d.SharpEngine&version=4.0.9584
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 miter 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 that can rotate the camera around the 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
- Render CT and MRI scans by using Volume rendering
- 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" on Ab4d.SharpEngine.Samples on GitHub.
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" on Ab4d.SharpEngine.Samples on GitHub.
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 is compatible. 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. |
-
net10.0
- No dependencies.
-
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.Assimp
Ab4d.SharpEngine.Assimp provides classes that can use Assimp importer to import 3D objects into Ab4d.SharpEngine 3D rendering engine |
|
|
Ab4d.SharpEngine.WinUI
Ab4d.SharpEngine.WinUI defines WinUI controls that can show 3D scene rendered by Ab4d.SharpEngine 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 |
|---|---|---|
| 4.0.9584 | 27 | 3/31/2026 |
| 3.2.9509 | 737 | 1/13/2026 |
| 3.2.9386 | 1,324 | 9/12/2025 |
| 3.2.9364-beta | 263 | 8/21/2025 |
| 3.1.9316 | 928 | 7/7/2025 |
| 3.1.9300-rc3 | 287 | 6/18/2025 |
| 3.1.9299-rc2 | 287 | 6/17/2025 |
| 3.1.9287-rc1 | 262 | 6/5/2025 |
| 3.0.9208 | 636 | 3/19/2025 |
| 3.0.9196 | 827 | 3/6/2025 |
| 3.0.9195-rc4 | 355 | 3/5/2025 |
| 3.0.9175-rc3 | 294 | 2/13/2025 |
| 3.0.9173-rc2 | 246 | 2/11/2025 |
| 3.0.9169-rc1 | 273 | 2/7/2025 |
| 2.1.9118-beta2 | 283 | 12/19/2024 |
| 2.1.9028-beta1 | 313 | 9/20/2024 |
| 2.0.8956 | 1,589 | 7/9/2024 |
Ab4d.SharpEngine v4.0.9584
- Added support for rendering in the browser by using WebGL instead of Vulkan. This requires referencing the new Ab4d.SharpEngine.WebGL NuGet package (and Ab4d.SharpEngine.glTF.WebGL for glTF importer). See “Ab4d.SharpEngine.WebGL implementation details” (https://github.com/ab4d/Ab4d.SharpEngine.Samples/doc/ab4d-sharpengine-webgl-implemented-features.md) for supported features in the browser.
- Added support for rendering PhysicallyBasedRendering (PBR) materials with support for environment mapping. This is supported by the new PhysicallyBasedMaterial.
- Improved glTFImporter to support reading PBR textures (metalness, roughness, base color and environment maps). To load those textures and use PhysicallyBasedMaterial, set the new glTFImporter .UsePbrMaterial property to true.
- Added camera rotation, movement and zoom smoothing to CameraController (and derived classes like PointerCameraController). It can be enabled by setting the new CameraSmoothing property on the CameraController. There are also SetAdvancedSmoothSettings methods to manually control the smoothing.
- Added CameraZoomStarted and CameraZoomEnded events to ManualMouseCameraController. They are useful when camera smoothing is enabled and zooming with the mouse wheel is not a one-time event.
- Added AxisWithLabelsNode and AxisBoxNode. They can be used to show highly customizable graph axes.
- Added support for hit testing of rendered pixels. This can be done by using pixel index color and rendering it to an ID bitmap. To enable that, create a new PixelEffect instance and set the new UsePixelIndexColor to true. Another option is to call the new PixelsNode.UsePixelIndexColor method.
- Added BoundingFrustum struct that can be used to check if an object's bounding box is currently visible by the current camera.
- StandardMaterial now also implements ITwoSidedMaterial interface. When IsTwoSided is set to true, then the front and back sides of the triangles are rendered with a single draw call (doubles the performance compared to the previous version when Material and BackMaterial were set to the same material). Note that it may still be useful to set both Material and BackMaterial instead of setting IsTwoSided to true because this guarantees that back sides are rendered before the front side materials, so when rendering semi-transparent objects, the inside is always visible. See the new Materials/TransparencySortingSample and its comments for more.
- Added support for text alignment (Left, Right, Center) when creating vector text meshes. This is done by using the new textAlignment parameter in the VectorFontFactory methods.
- Added PlanarShadowNode that provides a faster option to render planar shadows.
- Added TriangleMesh.CreateGpuBuffersAsync that creates the vertex buffer, index buffer, calculates the bounding box and generates the Octree in the background thread.
- Added ImportAsync to ObjImporter - the new method loads the obj file in the background thread and also generates the vertex and index buffer in the background thread.
- Added CreateContourLine and CreateContourLines methods to HeightMapContoursNode that can generate a single or multiple contour lines for the height map or any other mesh.
- Added FlattenContours method to HeightMapContoursNode that can be used to flatten the contour lines to a specified height. This can be used to create contour lines on a flat plane.
- Added GetCustomLineThicknessCallback and GetCustomLineColorCallback properties to HeightMapContoursNode. They can be used to set custom line thickness and line color for each contour line based on the height of the contour line.
- Added support to force starting the Avalonia with Vulkan backend app with a dedicated GPU (instead of an integrated GPU). This way the SharpEngine can use a shared texture even when the app is not using the primary system graphics card (even if the application was not set to use "High performance" graphics card in Windows Graphics Settings). To do that, update the app initialization code to set PreferDiscreteGpu to true. See Program.cs in Ab4d.SharpEngine.Samples.AvaloniaUI and the new "Performance tips" (https://github.com/ab4d/Ab4d.SharpEngine.Samples/doc/performance.md).
- Improved BezierCurve and BSpline classes by adding methods that use an adaptive algorithm that generates the curve position based on angle change, so more positions are generated at sharper curve bends and fewer positions at straighter curve segments. This requires fewer positions and improves the quality of the generated curve compared to the previous method with a fixed number of positions per curve segment. To support this, the GenerationAlgorithm, AngleThreshold, MinSegmentLength and MaxSubdivisionsCount were added to the CurveLineNode.
- Added GetFirstMeshModelNode, GetFirstModelNode, GetFirstStandardMesh and GetFirstMesh to GroupNode. They can be used to simplify getting the first model or mesh from a GroupNode. For example, if you know that a file contains only one model, you can use: var meshModelNode = importer.Import(fileName).GetFirstMeshModelNode();
- Added SetVisibility method to SceneNode to set the Visibility based on a Boolean isVisible parameter.
- Added TriangleModelNode that can show a single triangle model. It can be created from three positions or from an existing mesh by specifying the triangle index and the mesh. The TriangleModelNode also supports an Offset property that moves the triangle along its normal vector to avoid z-fighting.
- Added an indexer to the Scene objects that allows getting SceneNodes by their name. For example, you can get a SceneNode with name "MyNode" by using: scene["MyNode"]. This is a shortcut for scene.RootNode.GetChild("MyNode").
- Added IsAnimationEnabled property to SceneView. It can be set to false to disable all animations.
- Added MeshFactory.CreateSkyBoxMesh method that returns a cube mesh with inverted normals and adjusted texture coordinates that can be used as a skybox.
- Added CubeMapLoader that can be used to load cube map textures from 6 separate image files or from a single image file with all 6 faces.
- Added GpuImage.CopyWithNewImageView method that creates a new GpuImage with the same Vulkan image but with a new image view. This is used by a new CubeMapLoader.CreateIndividualFaceImages method that creates individual face images from a cube map.
- Improved the png reader that is included in the library (PngBitmapIO) to correctly read png files with filtered scanline data.
- Improved VertexColorEffect so it can also render VertexColorMaterials with shading based on lights and specular data (used when VertexColorMaterial.IsSolidColor is set to false). Before, VertexColorMaterials were rendered as solid color materials but with per-vertex colors.
- Added ISolidColorMaterial interface with IsSolidColor property. It is implemented by SolidColorMaterial (always true) and by VertexColorMaterial (true by default, but can be set to false to use light shading and specular material properties).
- Implemented IDiffuseMaterial with VertexColorMaterial. The new DiffuseColor and Opacity values are multiplied by the colors and alpha values in the per-vertex color array. By default, DiffuseColor is set to White and Opacity is set to 1 to preserve per-vertex colors, but the user can change them.
- Implemented ISpecularMaterial with VertexColorMaterial. When also IsSolidColor is set to true, then the material is rendered with light shading and specular effects that are defined by the SpecularPower and SpecularColor.
- Added PreventSceneUpdateOnTransformOrMeshChange property to SceneNode. It can be set to true to improve performance by preventing calling Scene.Update method when the SceneNode's transformation or mesh (assigning a new mesh and not changing the buffers for the existing mesh) is changed.
- Allowed user to control which SceneDirtyFlags and SceneViewDirtyFlags require regenerating command buffers, rendering layers and calling Update method. This is achieved by removing the const keyword from the following fields: Scene.RequireCommandBuffersRecodingDirtyFlags, Scene.RequireRenderingLayersCreationDirtyFlags, Scene.RequireSceneNodeUpdateDirtyFlags, Scene.RequireUpdateBeforeHitTestingFlags, Scene.RequireDisposeAllRenderingItemsFlags, SceneView.RequireCommandBuffersRecodingDirtyFlags, SceneView.RequireRenderingLayersCreationDirtyFlags.
- Added Scene.UpdateHiddenGroupNodes property that can be set to false, to prevent calling the Update method on the child SceneNode of a hidden GroupNode object. For example, this can improve performance when using frustum culling.
- Prevented calling SceneNode.Dispose method from the background thread.
- Added GetOrCreate method to EffectsManager. It returns the effect with the specified effect name and type. The difference between the new method GetOrCreate and the CreateNew method is that when calling CreateNew, you need to dispose the created effect, but with GetOrCreate the created effect is disposed when the EffectsManager is disposed.
- Fixed showing parentSceneNode.Name in Scene.DumpRenderingLayers and Scene.GetRenderingLayersInfo.
- Improved Utilities.Dumper.GetMatrixText, GetMatrixOneLineText, so when its numberOfDecimals is set to int.MaxValue, then the number of decimals is not limited.
- Added DumpCSharpString extension methods to Matrix4x4, Vector3[] and Vector2[] - the methods writes the c# code to initialized the Matrix4x4 or array to the Visual Studio Output window.
- Fixed calculating edge lines for meshes with 4 positions when the positions are not defined in a clockwise or counter-clockwise direction (this is also used by PlaneModelNode).
- When the camera is changed, the SceneView.DirtyFlags is set to CameraChanged before any user CameraChanged event is called.
- Added triggerCameraChangedEvent optional parameter to ICamera.Update method. It can be used to trigger CameraChanged event when the Update method is called.
- Trigger CameraChanged event when the coordinate system is changed by calling Scene.SetCoordinateSystem method.
- Fixed updating RenderingStatistics.CommandBuffersRecordedCount value.
- Prevented updating the mesh when the property is set to the same value (this check was not done in some SceneNode objects).
- Added CreateGradientRawImageData, CreateHeightRawImageData and Create1x1RawImageData methods to TextureFactory. They can be used to create RawImageData instead of GpuImage (for example, to update an existing GpuImage).
- Added NotifyTextureChange method to SpriteBatch that can be used to render a new frame without recreating the command buffers.
- CameraAxisPanel is calling the new SpriteBatch.NotifyTextureChange method. This prevents recreating the command buffers when CameraAxisPanel is shown and when only the camera is changed.
- Added support for rotation animation by using quaternions in TransformationAnimation.
- Added CalculateNormals property to StlImporter.
- Fixed SpotLight when InnerConeAngle and OuterConeAngle are set in the constructor.
- Fixed hit-testing of very small meshes (small bounding box size) with many triangles. In that case, the size of one triangle could be so small that some calculated values may be considered zero (when using a fixed-size zero tolerance). Now the zero-tolerance value is defined by the bounding box size of the mesh.
- Fixed putting InstancedMeshNode with transparent colors into TransparentRenderingLayer instead of ComplexGeometryRenderingLayer. This correctly renders the InstancedMeshNode after other non-transparent objects.
- Improved defining the length of the space character in VectorFontFactory. Now the length of the space character is read from the font data. This can be overwritten by setting the SpaceSize property. This property is now nullable (when null, the size from the font is used). Before this property defined the space size (0.333 EM by default).
- Fixed MathUtils.GetPointOnPlane when Plane.Normal.Z is zero.
- Prevented using the same Vulkan memory on two different threads - for example, while the BG thread is writing to the memory (content of the first GpuBuffer) the UI thread is trying to bind the same memory (with a different offset) to another GpuBuffer.
- Added GetPositionAndScaleTransform to ModelUtils.
- Added GetNormalizedDirection to IDirectionalLight. Added GetSpotLightPhi and GetSpotLightTheta to ISpotLight. This gets the precalculated light values, so the values do not need to be calculated for each frame.
- Improved performance of height map mesh generation and generation of height map wireframe and contour lines. Also, changing the HeightMapSurfaceNode, HeightMapWireframeNode and HeightMapContoursNode properties does not automatically call UpdateMesh on each change. Now the UpdateMesh is called when in the Scene's Update pass. If you want to manually update the mesh, call the Update method after changing the properties.
- Prevented "No compatible memory type" exception on older GPU devices.
- Added InvertYTextureCoordinate property to ObjImporter. Before this, it was available only on ObjFileToSceneNodesConverter class. By default, the InvertYTextureCoordinate is set to true.
- Improved ObjImporter to correctly invert y texture coordinate (when InvertYTextureCoordinate is true) when the max y value of texture coordinates is bigger than 1.
- Improved ObjImporter to correctly read materials for obj groups (line starts with 'g' in the obj file) that use materials defined in the previous obj group.
- Fixed calculating the Mesh's BoundingBox when using MeshUtils.CreateOutlinePositionsMesh and the mesh uses MeshTransform.
- Fixed firing PointerExited event from InputEventsManager when no object was hit.
- Fixed SecurityException with code 96 when using AOT and .Net 10.
- Fixed setting pixels to SKBitmap in the MAUI's SharpEngineSceneView.
- Correctly regenerates all EffectTechniques when DefaultBlendState, DefaultOpaqueDepthStencilState, DefaultTransparentDepthStencilState or DefaultRasterizerState property on the Scene object is changed.
- Improved TransformationUtils.CombineTransformations by adding a new updateExistingTransform parameter (true by default). The method works better because it tries to reuse existing StandardTransform, StandardQuaternionTransform, TranslateTransform, or ScaleTransform.
- Added createStandardTransform optional parameter to ModelUtils.PositionAndScaleSceneNode. When true, it creates a new StandardTransform instead of a TransformGroup with ScaleTransform and TranslateTransform.
- Fixed positioning the model after its parent GroupNode is moved from one GroupNode to another GroupNode, and the new GroupNode has a different transformation.
- Fixed calling material.Clone method. Now, the correct material settings are applied to the cloned material.
- Correctly render 3D objects if the SceneNode's Update method is manually called before the SceneNode is initialized (before Scene object is set).
- Improved stability of the engine when an exception happens in user code (in event handlers) during the update or rendering process.
- Fixed calculating BoundingBox for HeightMapSurfaceNode when the height data are not in the range from 0 to 1.
- Removed Async name suffix from all methods that are not awaitable and use a callback parameter. The old methods are still available but are marked as obsolete. The renamed methods are defined in the TextureLoader and GpuImage classes.