Compute, Tessellation & Geometry Shader

I’ve been working on this custom fork off and on for quite some time now. I finally got around to making the new shader compiler work natively on Linux, as well as publish NuGet packages, which should make this a lot more approachable for those who shy away from building from source.

You get the newest development build, with added support for compute, tessellation and geometry shaders. Additionally you get a new shader compiler for OpenGL, replacing the outdated MojoShader with ShaderConductor, which opens up shader model 4 and 5.

Have a look at those sample projects to see the new shader stages in action. They should just launch without any additional setup.

For more info check out those links:

NuGet Packages, Platform Support and Build Requirements
Compute Shader Guide
Shader migration Guide for OpenGL
Shader model support for OpenGL
Pull Request for main MonoGame Repo

14 Likes

This is exciting to say the least. :slight_smile:

3 Likes

Are there any plans to distribute an official NuGet package for Android?
In Android and DesktopGL, the vertex and pixel shaders work better with this compute shader fork than with the official MonoGame implementation.

1 Like

I should look into Android again. I remember the last time I looked into this I came to the conclusion that I should wait for .NET 6. Well, MG is .NET 6 now.

2 Likes

I am very much looking forward to it.

I finally updated the compute fork to the new MonoGame version (3.8.1).
The Samples have been updated to .NET 6 and the new compute Nugets (3.8.2).
There’s now also a Nuget for Android (MonoGame.Framework.Compute.Android) and some Android Samples.

A few more changes:

  • Shader files that only contain shader model 2 and 3 shaders will now be compiled by MojoShader instead of ShaderConductor. Check the Shader Migration Guide for more details and a way to override this.
  • Added integer surface formats, which can be used for per-pixel atomic operations.
  • Assigning default values to shader parameters in HLSL will now also work for OpenGL. This is limited to assigning simple values though, no expressions or identifiers.
  • Pixel shaders can now also write to buffers and textures (UAV) like compute shaders. This is DirectX only for now. With OpenGL that’s possible too, but a bit more complicated.
6 Likes

Excellent!
I will use the Andorid version right away.

I published new MGCB Nugets. This fixes an issue where content wasn’t built, when building from within the MGCB editor. The new version is 3.8.2.3. This affects the Nugets that go into dotnet-tools.json

5 Likes

do you think this would work with console ports too? like ps or switch?

No, consoles are not supported. Here is more info on platform support.