@Jjagg wrote:
Two interesting developments regarding upgrading MonoGame for the newer graphics API's
- Microsoft just open-sourced a DirectX Shader Compiler (like a couple hours ago): https://blogs.msdn.microsoft.com/directx/2017/01/23/new-directx-shader-compiler-based-on-clangllvm-now-available-as-open-source/
That might help with getting shaders working fully cross platform and with getting reliable tools that translate HLSL to GLSL.- I recently did some work for the pure OpenGL runtime (build system is already working, but only robust for old glsl versions because it uses glsl-optimizer). The current runtime is a bit different because MojoShader does some specific things. I got it running, but currently have some issues that I haven't really investigated yet. PR: https://github.com/MonoGame/MonoGame/pull/5354
I've already talked about this a lot on the forum, but here we go again
![]()
When we have both the HLSL -> GLSL translation and the pure OpenGL runtime in place MG can drop MojoShader and expand with things Mojo doesn't support like geometry and compute shaders. Regarding the new API's, from pure OpenGL it's easy to go to SPIR-V (the Vulkan shading language) using glslang and from that to MSL (Metal Shading Language) using SPIRV-Cross (experimental). Since as a MonoGame user you don't write MSL or SPIR-V directly, but HLSL or GLSL our effects parser can stay in place mostly as is meaning nothing changes for the end user (but at this point you can write your shaders in GLSL too! So that covers most of the shader side of things.Of course then there's the MG runtime side. The API needs to be designed and implemented for all three backends which is a lot of work. There's no one really working on this right now. If there's anyone that has some experience or interest in working with Vulkan or DX12, don't hesitate to contribute if you'd like!
Posts: 1
Participants: 1