Monogame 3.8.1 Shader Compiling on Linux

Hello all,

Is it possible to compile a HLSL .fx file in the MGCB on linux without requiring Wine configuration? Or if there is Wine configuration required, are there any easy steps that I can follow to get a shader into my project?

I’ve recently switched across my machine to Linux Mint and I’m using vscode with .NET9. It’s very difficult to get a straight working answer on this topic. Would I have to switch to .NET8 where I’ve read it’s more stable?

Any help is appreciated.

Not without Wine, unfortunately. I haven’t been able to get it working with Wine either (also on Linux Mint, though I’m using dotnet 10. I hadn’t considered that that might be causing the issues).

That said, when MonoGame 3.8.5 releases, it will include a new Vulkan backend that will support native shader compilation for both Linux and Mac, so I’ve been holding out for that.

Thanks very much for your response @greenstack

I’ve managed to figure it out and have gotten a OpenGL shader effect working in my game.

It’s quite complicated to get everything working, but a key thing was me going back to Monogame University tutorials about 2D shaders where Simon quite clearly mentioned that you have to get the syntax of the shader exactly correct.

I ended up doing a fresh install of linux to try it again and installed .NET 10 targeting net9.0 and it works too.