Shaders work in Direct3D but not in DesktopGL

I was able to solve the problem with the compute shader version you gave me below.

In the official MonoGame version, the presence of “constants used only by pixel shaders” resulted in an error at runtime.
This problem was solved by using the Compute Shader version.

Note that the compute shader version also had some limitations, such as not being able to use arrays, so some tweaking was necessary.

Note that the problem has been resolved for Windows and DesktopGL, but is still trial and error for Android (OpenGL ES).