Perfomance of Monogame

C# is my favorite language and monogame is the best game development tool for me. I have a lot of experience with graphics in different languages ​​like C, C++ and Rust. And also on different apis such as Vulkan, DX11, OpenGL. I’m going to start developing a big game with the same graphics. I already have my own OpenGL/Rust engine and would like to port it to the great Monogame. But the question is about performance. Porting is due to a lack of OpenGL perfomance. I’m about to choose DirectX 11 on the Windows platform and would like to ask: Does Monogame dx11 fully support and is it multi-threaded? What I need: DirectX 11 (feature level 11.0), multi-threaded calculations from the framework side. Does Monogame have it?

P.S: 2D graphics

I don’t know much about working with DX in the manner you suggested, With MonoGame I developed some prototypes of 2D pixel art games in openGL that involved tiling sprites and I can say that when I kept my complex calculations in the update loop and had the draw loop simply render scenes based on states calculated in the update loop I had excellent performance. Rich scenes up to 1000 tiles would still yield a more than comfortable 350-500 fps on a decent CPU/video card. Since you’d be limiting that to 60 fps anyway, I think you don’t really need to worry about a thing.
Now, it also depends on how complex you want your 2D game to be. On-the-spot rotations and complex sprite manipulation would take a toll, but you can also always use shaders.
Hope this helps a bit.

Recently I 've done some comparison between XNA/FNA/MonoGame and KNI.
The code is available to GitHub if you want to perform the benchmarks on your system.

In monogame the performance of the OpenGL backend is slower that the DX11 backend,
but FNA -which is OpenGL- exceed the performance of both when it comes to draw calls.

When it comes to Multithreading, The WindowsDX allows you to access the graphics Context from other threads to do simple things like loading content from a second thread. However recently someone tried to use ContentManager simultaneously from multiple threads and that didn’t seem to work. Generally you shouldn’t assume that something is thread safe unless it it stated so.
As for DX11 Shared contexts, etc there isn’t any extensions to the API to allow that.

In the OpenGL backend loading content is dispatch to the main thread internal, so it’s not very efficiently, and as a result they do very questionable things when it comes to disposing graphics resources. I don’t know about FNA, but a quick review of the source code suggest that they still have a lot in common.

1 Like