I hope you can help me. I developped a small application using MonoGame’s BasicEffect. Now, I want to learn about effects, but I can’t even run a simple example. First, I though I misunderstood something or made some mistakes in my code, but then, I downloaded the XNA Tutorial from Riemer source code in a new, empty MonoGame Windows project. I also downloaded the *.fx effect and converted it into a *.mgfxo file by using your 2MGFX tool. I load the effect with
System.IO.BinaryReader Reader = new System.IO.BinaryReader(System.IO.File.Open("C:\\Users\\Benjamin\\Desktop\\test123.mgfxo", System.IO.FileMode.Open));
this.effect = new Effect(graphics.GraphicsDevice, Reader.ReadBytes((int)Reader.BaseStream.Length));
Everything seems to work fine until the Draw function, which gets me an exception:
Please tell me, what I did wrong. I used exactly the same code as in Riemer’s Tutorial. I only changed the effect loading as explained earlier and I changed the vs_2_0 and ps_2_0 to make your 2MGFX happy.
can someone pleasehelp me? I highly assume, that all you are able to use shaders - otherwise the engine would be pretty useless. Has no one an idea what’s going wrong?
I am using exactly the same source code as Riemer in his XNA tutorial. I only exchanged the loading of the *.mgfxo file and created the *.mgfxo using the official converter tool 2MGFX.