On Windows, is MonoGame+OpenGL as stable as MG+DirectX?

My primary focus is on Windows PCs, but I have an interest in supporting iOS and Android tablets in the future. Also contemplating software rendering on a Linux server farm (that my company already owns for Maya rendering) for making ultra-high-quality video flyovers of 3D landscapes.

Currently I have XNA 3.1+managed DirectX code that I am updating to MonoGame + SharpDX.

Given that Microsoft doesn’t even support Windows 7 in DX 12, and that I have no interest in console platforms, I’m starting to consider abandoning DX (even though my primary target today is Windows PCs)!

Wondering if this makes any sense.

I’m fine with DX 11 functionality for now. Or whatever the comparable version of OpenGL would be. Not concerned yet with the close-to-the-metal options of DX 12 or Vulkan. Just trying to get up to reasonably modern capabilities.

My main question in this forum is what downside there might be to switching from MonoGame.Framework.WindowsDX to the version based on OpenGL?

If you stick with the MonoGame APIs, there is little to no difference between the two. We try hard to keep them functionally the same and produce the same output, and have unit tests to ensure this. You mention here and in your other thread that you use SharpDX directly for some features. This is something that you won’t be able to take across to the OpenGL version. It would have to re-implemented in a very different manner.

What are you wanting to gain by switching? Is it having a common graphics API across all platforms so you can do the same low-level graphics operations?

If you stick with the MonoGame APIs, there is little to no difference between the two.

@KonajuGames OK, that is good to know.

Yes, single code base cross-platform. Where “cross-platform” means Windows + iOS + Android.

Currently I have a relatively small amount of DirectX code; most graphics code is XNA.
But fairly soon, will be writing more 3D code; likely some of that new code will be low-level.
If I was ever going to switch, now would be the best time.

The catch is that my company doesn’t need this code on iOS + Android any time soon, but it does need new 3D code. So there is a short-term vs long-term trade-off here.

Based on your reassurance that the platforms are in sync (I’m unlikely to do anything so cutting edge that it hits any rare differences), it is worth taking a couple of days next month to try OpenGL versions of what my company did in DX. If that goes smoothly, then I will likely continue with OpenGL. (I have previously done some OpenGL ES 2.0 coding, so I wouldn’t be starting from zero knowledge.)

I’m interested in what low level graphics API things you need to do that is not possible with the MonoGame API.

1 Like

Hmm. The DX code I have now is not code that I wrote, so I don’t know yet whether it could have been done with MonoGame calls. Now that you said that, I’ll examine [when I get back to this another day] whether some of that code could be MonoGame instead, for portability.

I do know that there is some 2D (Direct2D) stuff, though I expect to replace all that eventually with 3D (because we want a 3D view now anyway, so the 2D view just becomes “zero the altitudes” and look at it from above).

For new code, I was just assuming that I’d have to do something at a lower level. I’ll post again on this thread after I investigate - may not be for a month though.

Just a heads up in case you do not know this. MG translates HLSL shaders to GLSL so you do not have to do that manually. There are a few pitfalls though, which are listed in the docs: http://www.monogame.net/documentation/?page=Custom_Effects

1 Like