Hey guys,
I was just playing around with shaders in my little project and first I got an compiling error, that my PixelShader doesn’t support reading from position semantics.
So I changed the compiler version to ps_4_0, which supports that.
Well done, no compiling error!
But now on starting the game, when loading my effect, there occures an exception:
An unhandled exception of type 'SharpDX.SharpDXException' occurred in SharpDX.dll
Additional information: HRESULT: [0x80070057], Module: [General],
ApiCode: [E_INVALIDARG/Invalid Arguments], Message: The parameter is incorrect.
How can I solve this problem now? I need the position in pixel shader for calculating light and fog based on pixel.
Installed DirectX version is 12
Suggestions I found, like
effect = new Effect(this.GraphicsDevice, (byte[])File.ReadAllBytes(Content.RootDirectory + "\\Brightener.mgfx"));
for loading the effect don’t work, since I got .xnb files there, no mgfx…