Ab4d.SharpEngine 2.1.9118-beta2

This is a prerelease version of Ab4d.SharpEngine.
dotnet add package Ab4d.SharpEngine --version 2.1.9118-beta2                
NuGet\Install-Package Ab4d.SharpEngine -Version 2.1.9118-beta2                
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="2.1.9118-beta2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Ab4d.SharpEngine --version 2.1.9118-beta2                
#r "nuget: Ab4d.SharpEngine, 2.1.9118-beta2"                
#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.
// Install Ab4d.SharpEngine as a Cake Addin
#addin nuget:?package=Ab4d.SharpEngine&version=2.1.9118-beta2&prerelease

// Install Ab4d.SharpEngine as a Cake Tool
#tool nuget:?package=Ab4d.SharpEngine&version=2.1.9118-beta2&prerelease                

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)
  • Core SharpEngine objects (Scene, SceneView)
  • Many SceneNode objects (ported most of 3D objects from Ab3d.PowerToys)
  • Object instancing (InstancedMeshNode)
  • Cameras: TargetPositionCamera, FirstPersonCamera, FreeCamera, MatrixCamera
  • Lights: AmbientLight, DirectionalLight, PointLight, SpotLight, CameraLight
  • Effects: StandardEffect, SolidColorEffect, VertexColorEffect, ThickLineEffect
  • ReaderObj to read 3D models from obj files
  • Assimp importer that uses third-party library to import 3D models from almost any file format

Samples

Ab4d.SharpEngine.Samples on GitHub

Platforms and UI frameworks:

Windows:

  • WPF full composition support with SharpEngineSceneView control (Ab4d.SharpEngine.Wpf library)
  • AvaloniaUI support with SharpEngineSceneView control (Ab4d.SharpEngine.AvaloniaUI library)
  • WinUI 3 support with SharpEngineSceneView control (Ab4d.SharpEngine.WinUI library)
  • Using SDL or Glfw (using third-party Silk.Net library; the same project also works on Linux)
  • MAUI
  • WinForms support

Linux (including Raspberry PI 4):

  • AvaloniaUI support with SharpEngineSceneView control (Ab4d.SharpEngine.AvaloniaUI library)
  • Using SDL or Glfw (using third-party Silk.Net library; the same project also works on Windows)
  • See "Vulkan on Resberry Pi 4" guide on how to use SharpEngine on Resberry Pi 4 with an external monitor.

Android:

  • Using SurfaceView in C# Android Application
  • Using SDL (using third-party Silk.Net library)
  • 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:

  • Using MAUI - requires .Net 8 and MoltenVK library

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. 
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
2.1.9118-beta2 99 12/19/2024
2.1.9028-beta1 175 9/20/2024
2.0.8956 972 7/9/2024
2.0.8951 261 7/4/2024
2.0.8941-rc2 204 6/24/2024
2.0.8936-rc1 195 6/19/2024
1.0.8740 1,665 12/7/2023
0.9.20-rc1 263 11/15/2023
0.9.18-beta6 234 10/20/2023
0.9.16-beta5 206 9/15/2023
0.9.15-beta4 619 8/23/2023
0.9.14-beta3 264 8/4/2023
0.9.13-beta3 999 7/11/2023
0.9.11-beta3 201 5/11/2023
0.9.10-beta3 132 5/10/2023
0.9.8-beta2 575 4/16/2023
0.9.0-beta1 244 12/14/2022

Ab4d.SharpEngine v2.1.9118-beta2
This is an intermediate beta version with the following new features (compared to v2.1.9028-beta1):
- Added support for super-sampling anti-aliasing (SSAA) that can significantly improve the quality of rendered 3D lines. On SharpEngineSceneView control the super-sampling is defined by the SupersamplingCount property. On SceneView object,the initial multisample count and supersample count is set by calling SceneView.Initialize method. To change the MSAA and SSAA, call SceneView.Resize method. Default value for dedicated desktop devices is 4, for integrated desktop devices is 2, for mobile and low-end devices the default value is 1.
- Added support for hardware accelerated line caps rendering. Before only Flat and ArrowAnchor were available. Now the following new line caps are supported: WideArrowAnchor, WiderArrowAnchor, ShortArrowAnchor, StealthArrowAnchor, ReverseArrowAnchor, ReverseShortArrowAnchor, BoxAnchor, DiamondAnchor. This allows rendering of millions of lines with line caps.
- Added support for rendering hidden lines - lines that are rendered only when they are behind 3D objects. This can be used to render doted or thinner hidden lines (compared to visible lines).
- Added MeshTrianglesSorter that can be used to sort triangles by camera distance.
- Added support to for rendering to bitmap without multi-sampling (MSAA) even if it is enabled in the SceneView. This is required to render correct ID bitmap that can be used for hit-testing.
- Added PointerWheelChanged event to ManualInputEventsManager. It can be used to get generic pointer or mouse wheel events.
- Added VulkanDevice.CopyBuffer and GpuBuffer.CopyToBuffer methods.
- Added new overloads to VulkanDevice.CreateBuffer method that takes custom bufferSize or Span as parameters.
- Fixed running on Linux Wayland by enabling VK_KHR_wayland_surface instance extension when supported.
- Added static GetDpiScale to SharpEngineSceneView.
- Added optional name parameter to the SharpEngineSceneView constructor.
- Added virtual GetDefaultMultiSampleCount and GetDefaultSuperSamplingCount methods to SharpEngineSceneView. The methods can be overridden to provide custom multi-sampling and super-sampling based on the used VulkanDevice.
- Added SetCustomVertexBuffer and SetCustomIndexBuffer to Mesh. They can be used to set custom vertex or index buffer for the Mesh. This allows the buffers to be reused on different Scene objects (but the buffers need to be created by the same VulkanDevice).
- Added CustomMesh which is defined by custom vertex and index buffers.
- Added GetViewMatrix and GetInvertedViewMatrix methods to Camera class.
- Added TorusKnotModelNode class and MeshFactory.CreateTorusKnotMesh method. They can be used to render torus and torus knot 3D objects.
- Added EngineCreateOptions.Use32BitDepthFormat property (default value is false - this uses D24UnormS8Uint depth-stencil format that is recommended by NVIDIA).
- Added support for setting memory priority and pagable device-local memory. This helps the engine work in situations where GPU memory is heavily used by many apps in the OS. See VK_EXT_memory_priority and VK_EXT_pageable_device_local_memory Vulkan device extensions for more info. This can disabled by new EnableMemoryPrioritiesFeature and EnablePageableDeviceLocalMemoryFeature properties to EngineCreateOptions. Also added IsMemoryPrioritiesFeatureEnabled and IsPageableDeviceLocalMemoryFeatureEnabled properties to PhysicalDeviceDetails.
- Renamed CameraAnimatedProperties.CameraWidth enum name to ViewWidth. The ViewWidth is still available but is marked as Obsolete.
- Fixed processing the change of CustomRenderingLayer property after the SceneNode was already rendered.
- Fixed rendering poly-lines when VulkanLineRasterizer is used (on older ARM graphics cards that do not support geometry shader). Before, the first and the last positions were not rendered.
- Added DefaultTransparentDepthStencilState, DefaultOpaqueDepthStencilState, DefaultBlendState and DefaultRasterizerState properties to Scene object. The DefaultTransparentDepthStencilState can be changed from CommonStatesManager.DepthReadWrite to DepthRead to solve problems with transparent objects in some cases.
- Fixed rendering poly-lines when monitor dpi-scale is more than 1.
- Added "HitTesting and imput processing / Rectangular Selection" sample.
- Set BackgroundColor to Transparent by default.
- Added IsCaptureFrameAvailable method to SceneView. Renamed CaptureNextFrameInRenderDoc method to CaptureNextFrame.
- Added support for manually capturing a frame with RenderDoc on Linux. Frame capture is initiated by calling SceneView.CaptureNextFrame method.
- Added RecreateVertexBuffer and RecreateIndexBuffer to TriangleMesh (base class for StandardMesh).
- Fixed getting the correct value from IsDeviceLUIDValid and IsDeviceUUIDValid properties in PhysicalDeviceDetails.
- Added support for checking memory budgets before memory allocations (requires API 1.1 and VK_EXT_memory_budget device extension). This can be disabled by setting VulkanMemoryAllocator.CheckMemoryBudget to false.
- Added GetMemoryBudget and GetMemoryBudgetInfo methods to VulkanDevice. Also, calling Scene.DumpFullMemoryUsage or Scene.GetFullMemoryUsageInfo will get info about the memory budget.
- SharpEngineSceneView control for WPF, AvaloniaUI and WinForms now implement IDisposable interface (the Dispose method was already available but the IDisposable interface was not specified).
- Fixed GetAllHitResults that sometimes did not return all the hit results.
- Added Log.IsLoggingToDiagnosticsTrace property that can enable SharpEngine logs to be written to the trace listeners in the System.Diagnostics.Trace.Listeners collection.
- Renamed dataLength parameter to dataItemsCount in WriteToBuffer and ReadFromBuffer methods in GpuBuffer.
- Fixed using EngineCreateOptions.DesiredInstanceExtensionNames.
- The PreferredMultiSampleCount property on SceneView and SharpEngineSceneView is replaced by a new MultisampleCount property. The old property is marked as obsolete.
- Marked the SceneView.UsedMultiSampleCount and SceneView.UsedMultiSampleCountFlags properties as obsolete. To set the initial multisample count and the supersample count call SceneView.Initialize method and set multisampleCount and supersamplingCount. To change the MSAA and SSAA, call SceneView.Resize method.
- Updated the SceneView.Resize method that has all the parameters optional so you can update only the parameters that you want, for example, change multisample could and supersample count.
- Improved ModelUtils.PositionAndScaleSceneNode method so that it does not produce an invalid transformation when it is called on SceneNode without a valid bounding box.
- Improved handling of ErrorOutOfDate and ErrorSurfaceLost results that indicate that the current present surface is not valid anymore.
- Set the default value of WaitForVSync to true.
- Fixed updating LocalBoundingBox and WorldBoundingBox on MeshModelNode after the mesh is manually updated by calling UpdateMesh method.
- Improved using BoundingBox.Undefined for BoundingBox when the mesh is empty.
- Removed adjustForSupersamplingFactor parameter from GetRayFromNearPlane and GetRayFromCamera. This parameter is not needed because the x and y coordinates from SharpEngineSceneView and SceneView are not multiplied by super-sampling factor. Methods with that parameter will still work, but they are marked as obsolete.
- Added AdditionalInstanceLayers list to EngineCreateOptions. It can be used to enable additional instance layers.
- Use only 1 SwapChain image (instead of 2) when using SharedTexture or WritableBitmap. When rendering and presenting to a surface, the SwapChain images count is defined from the surface's images count min and max value. This also changes the default value of the EngineCreateOptions.PreferredSwapChainImagesCount to 1.
- Updated BitmapTextSample by adding an option to align the text to the camera (so the text always faces the camera) and an option to set the text size in screen space coordinates (define how large the text will look on screen regardless of the camera's zoom level).
- Added initial support for Uno platform (see new Ab4d.SharpEngine.Samples.UnoPlatform project).