Having trouble following a shader tutorial.

Hello everyone, I recently started programming shaders for MonoGame and I’ve been watching this tutorial for a shockwave shader. It’s not in HLSL but I’ve been able to translate everything. The problem I have is that when I pass in the position of my mouse, it draws it in a weird down-left arc.
Here’s the C# code:
Vector2 mouse = Mouse.GetState().Position.ToVector2(); shockwave.Parameters["center"].SetValue(Vector2.Normalize(mouse));

And here’s the shader:
float4 PixelShaderFunction(float2 UV : TEXCOORD0) : COLOR0
float ratio = res.x / res.y;
float2 scaled_UV = (UV - float2(0.5, 0)) * float2(ratio, 1) + float2(0.5, 0);
float2 disp = normalize(scaled_UV - center) * force / 10;
float4 color = tex2D(s, UV - disp);

return color;


Here’s a video of the problem.

Instead of normalizing the mouse position, divide it by the screen resolution.

mouse.x /= screenWidth
mouse.y /= screenHeight

That should get you the mouse position ranging from 0 to 1, matching the UV coordinates.

If necessary, you can do the same thing to the mouse position as you do with scaled_UV.