The first beta version of a new cross-platform rendering engine has been published

by abenedik 15. December 2022 14:03

I am really glad to inform you that the first beta version of the Ab4d.SharpEngine has been published. 

Ab4d.SharpEngine logo

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

The existing rendering engine, Ab3d.DXEngine, uses DirectX 11. Because of that, it can only be used on Windows. The new engine uses Vulkan API.  And because it is built using .NET 6, the new engine is truly cross-platform and can be used on Windows, Linux (including Raspberry PI 4), macOS, Android and iOS. 

I know that now you would want to ask me: what about web? I am monitoring the status of Blazor with WebAssembly. I think that things are developing in the right direction but currently this technology is not yet capable enough for a more complex application with 3D graphics. The main problem is that WebAssembly does not have direct access to the Canvas, so each call needs to go through java script. Because 3D rendering engine needs to execute a lot of WebGL (or WebGPU) calls, this would be very slow. Also, in my opinion web will always be slow for high end and demanding 3D graphics. Anyway, the long time plan is to also provide support for web so that the same c# code could also run in a browser.

Vulkan is also an API with very little overhead, which makes it much faster than DirectX 11. What is more, Vulkan supports all new features that are added to new graphics cards, including ray tracing. This does not mean that Ab3d.DXEngine already supports ray tracing, but it is possible to add that and other new features in the future.

Because the new rendering engine was built from the ground up, it was possible to use all the know-how and experience from Ab3d.PowerToys and Ab3d.DXEngine to make its programming API clean and very easier to use. I admit that when using Ab3d.DXEngine and Ab3d.PowerToys, the API is not very nice in all cases. The Ab3d.PowerToy was built on top of WPF 3D objects that are not very extendable, so some compromises were needed (for example, cameras are derived from FrameworkElement and not from Camera). Also, Ab3d.DXEngine converts all WPF 3D and Ab3d.PowerToys objects into its own objects. This means that the application has two versions of each object. In other cases, some tricks must be used to provide Ab3d.DXEngine features to Ab3d.PowerToys and WPF 3D objects (for example using SetDXAttribute). Therefore, having an easy-to-use API was one of the primary goals of the new engine. Please contact me if you have any recommendations or find something that bothers you. 

 

I hope that you are already excited about the new rendering engine.
In that case, just jump into the samples page on GitHub: Ab4d.SharpEngine.Samples

There you will find solutions that show how to use the Ab4d.SharpEngine with WPF, AvaloniaUI, WinUI 3, SDL, Glfw. Some samples will run only on Windows; some will also run on Linux and macOS. Some will run on Android. iOS samples are coming in the near future. I also plan to add support for WinForms and MAUI. If you know of any other well know UI framework, please let me know and I will try to provide support for that too.

Check also the readme on GitHub as it provides a lot of other information.

 

Because you are an existing user of Ab3d.PowerToys and Ab3d.DXEngine, you are probably very interested in comparing the new engine with the current libraries.

Let's start with advantages of Ab3d.DXEngine and Ab3d.PowerToys:

  • Ab3d.DXEngine and Ab3d.PowerToys are very mature products that are tested and proven in the "field" by many customers.
  • Those two libraries currently provide more features and come with more samples that can be used as code templates for your needs.
  • Ab3d.DXEngine supports multi-threading and currently provides faster 3D rendering in many use cases.
  • Ab3d.DXEngine can use software rendering when there is no graphics card present (for example in virtual machines or on a server).
  • Ab3d.DXEngine and Ab3d.PowerToys can run on older .Net versions, including .Net Framework 4.5+.

Advantages of Ab4d.SharpEngine:

  • Ab4d.SharpEngine can run on multiple platforms. You can start writing code for Windows and later simply add support for Linux, macOS, Android and iOS. Or port just a smaller part of the application to other platforms.
  • Ab4d.SharpEngine uses Vulkan API that is the most advanced graphics API. It is actively developed and gets new features as new versions of graphics cards are released. This provides options to support all current and future graphics features (for example Ray tracing - not possible with DirectX 11).
  • As mentioned before, Ab4d.SharpEngine has a very clean and easy to use programming API. 
  • Working with WPF objects is very slow (accessing DependencyProperties has a lot of overhead). Also, Ab3d.DXEngine needs to convert all WPF objects into its own objects. Working with objects in Ab4d.SharpEngine is much faster.
  • Vulkan is a significantly faster graphics API than DirectX 11. Though the Ab4d.SharpEngine does not use all the fastest algorithms yet (no multi-threading), in the future the engine will be significantly faster than Ab3d.DXEngine.
  • Ab4d.SharpEngine is built on top of .NET 6 and that provides many performance benefits because of using System.Numerics, Span and other improved .NET features.
  • In the future Ab4d.SharpEngine will provide more functionality than Ab3d.DXEngine with Ab3d.PowerToys.

 

So, if you have a big and complex application that uses Ab3d.PowerToys and Ab3d.DXEngine, I would not recommend you to try to port it to the new engine. You could not just copy and paste the code to the new engine. Though the ideas and principles of both engines are still the same, for example there are TargetPositionCamera and MouseCameraController - both with almost the same properties and methods. But there are many smaller differences, for example BoxVisual3D is now BoxModelNode. Anyway, if you know how to use the existing engine, you will feel very familiar with the new engine also.

But if you are starting to build a new application with 3D graphics or would like to port some smaller part of your big application (for example a viewer with a few additional functionalities) to a more mobile format, then the new engine is a perfect choice for that. Also, if you are curious about how to program in .NET for other platforms or will have a little bit more time in December, I would be really glad if you could try the new engine and provide some feedback (you can also use Discussions or Issues on GitHub, or simply use email, forum or feedback form).

But please don't be too demanding. This is the first open beta and some things may not work as expected. In those cases, please see the Troubleshooting section on GitHub for more info.

 

Let me also share the planned road map for the new engine.

In the following weeks and months I will try to release new beta versions with fixes and improvements. After a few months, probably in Q2 or maybe in Q3 2023, the first production-ready versions should be released. Maybe some parts of the engine will remain in beta, for example AvaloniaUI, MAUI, macOS and iOS support. The plan is to have the main and most common parts ready for production: Windows (WPF, WinForms, SDL, Glfw), major Linux distributions (SDL, Glfw) and Android. 

 

And finally, I would like to assure you that Ab3d.PowerToys and Ab3d.DXEngine will still be actively developed, will get new releases and features and will have full support in the future!

 

I hope that the new engine will allow developers to use the beautiful c# language to create amazing apps with 3D graphics that could run on all possible platforms. If you have the right tools, then even 3D graphics is not hard!

And of course: Merry Christmas and happy new year!

Tags: , ,

Ab3d.PowerToys | DXEngine | SharpEngine