float2 bottom = PositionToTexCoord(input.position.xy + float2(0.0f, 1.0f)); float2 top = PositionToTexCoord(input.position.xy - float2(0.0f, 1.0f));
and you are doingfloat div = 0.5f * ((r.x - l.x) + (t.y - b.y));
try swapping the +/- where you define bottom and top
YES! Thank you so much! I guess debugging something for several hours has a tendency to turn out like this >.<
The result: http://postimg.org/image/v9kgv9m2b/
To be honest though, doesn't the SV_Position semantic go from [0, screenWidth] x [0, screenHeight] from the top left corner? If so, if there's a pixel at (10,10), the bottom one would be (10,11) and top (10,9), wouldn't it?