The effect compiler that MonoGame uses seems to be less optimized than the XNA one. Most of my effects were just below the 64 instruction limit, but with MonoGame they are over the limit.
This pixel shader input struct worked fine in XNA, but MonoGame gives the error “Input limit (8) exceeded, shader uses 9 inputs”. Why is that, and how do I fix it…
struct VertexShaderOutput
{
float4 PositionPS : POSITION; // POSITION may not be used in Pixel shader
float2 TexCoord : TEXCOORD0;
float4 PositionWS : TEXCOORD1;
float3 NormalWS : TEXCOORD2;
float4 Diffuse : COLOR0; // diffuse.rgb and alpha
float3 Reflection : TEXCOORD3; // for reflection/environment mapping
float3 Fresnel : COLOR1; // for reflection/environment mapping
float2 DistanceFromViewer : TEXCOORD4;
float4 ScreenPosition : TEXCOORD5; // copy the screen pos. info here...
float2 ScanLinesTexCoords : TEXCOORD6;
};