XNA Effect port not working

Yes… the basic thing you are missing is that there is always a vertex shader. In this case I assume you are rendering with SpriteBatch. When you provide SpriteBatch with a custom effect with only a pixel shader, the vertex shader from the stock SpriteBatch effect is used.

You can see here how the pixel shader for the stock SpriteBatch effect is defined:

https://github.com/mono/MonoGame/blob/develop/MonoGame.Framework/Graphics/Effect/Resources/SpriteEffect.fx#L41

… you can see how it takes a position a color and a tex coord. You need your pixel shader signature to look something like that:

float4 MyPixelShader( float4 position : SV_Position, 
                                    float4 color : COLOR0, 
                                    float2 texCoord : TEXCOORD0)
{
1 Like