Ah, I currently have a MonoGame Content Project to compile my content. I also have a .fx file in there, which I would like to load using ContentManager.Load<Effect>("Effects/Test")
. However, when running the project, it tells me that
The MGFX file is corrupt!
I’ve read that I have to use the MGFX tool to compile the file. However, I thought that the MonoGame Content Project is already supposed to do that. I created and linked it like explained here: http://rbwhitaker.wikidot.com/monogame-managing-content
I also have XNA installed, so it’s probably (most certainly) using the XNA build tools to create the .xnb file (which is not through the MGFX tool). Since I only want to run the project on Windows, I would not neccesarily need the compatibility to other plattforms. Is there an easy way to set it up, so that it will automatically compile the content files using the MonoGame Content Project? Having to run another tool whenever I change my shader, could be very annoying.
Update: I probably have to reference the C:\Program Files (x86)\MSBuild\MonoGame\v3.0
, which is where the 2MGFX tool is located. I can change the “Content Processor” of the .fx file to “MonoGame Effect” instead of “XNA Effect”, but then it tells me
The MGFX effect is the wrong profile for this platform!
which happens because I’m using a MonoGame DirectX (Windows8) project. I read that I have to set the Shader Model to 4.0 or higher (because I’m using a DirectX project meaning Windows8 target). However, when I do that, it tells me that…
Vertex shader ‘VertexShaderFunction’ must be SM 3.0 or lower!
Which would only be correct for OpenGL targets, according to this: GitHub - MonoGame/MonoGame: One framework for creating powerful cross-platform games.
Final Update:
It’s working now. I did not actually set the target/configuration to Windows8, it was the default “Debug” option. Now, after setting the shader model for Pixel and Vertex shader to 4.0, it works correctly under Windows 8.