- MonoGame.Framework.Content.Pipeline.dll from MonoGame
- fxc.exe from the DirectX Software Development Kit
- Add a reference to MonoGame.Framework.Content.Pipeline.dll to your Class Library project
- Compile the 2 classes to a DLL
- Make sure fxc.exe is at the same location as the resulting DLL
- Add a reference to your .mgcb file, eg.
/reference:ContentPipeline.dll
, this can also be a relative path to the .mgcb file. - Make sure your .mgcb file is set to the Windows platform:
/platform:Windows
- Change all your songs to "Ogg Song - MonoGame"
- Change all your shaders to "Effect - Fxc"
- Compile your assets! The resulting files for the songs and effects will be compatible with FNA on any platform.
This class will generate a .hash and a .ogg at the location of the asset included in the .mgbc file. This is because the output of .ogg files are not determinstic. Meaning given the same input, you get a different output every time you run the compiler. This is annoying since songs can be rather large in filesize, needlessly inflating patch sizes. In case of source control, be sure to commit these files as part of your assets! They will automatically update if you change the original song file.
This class will generate a .fxc file at the location of the asset included in the .mgcb file. This is to ensure you can also run the compiler on other platforms than Windows, given you have compiled your assets on Windows once first. In case of source control, be sure to commit this file as part of your assets! It will automatically update if you change the original .fx file.
The FxcEffectProcessor implementation doesn't support fxh imports correctly. If anyone else encounters this, update the Process method to the following to fix: