I'm mostly guessing here, but it appears to me that you want to apply the inverse transform to the one that LÖVE uses, to the screen coordinates passed in the shader's effect().
If so, you can do something like this:
In the shader:
Code: Select all
extern mat3 tf;
...
vec4 effect(vec4 col, Image texture, vec2 texpos, vec2 origscrpos)
{
vec2 scrpos = (tf * vec3(origscrpos, 1)).xy;
...
}
And in the Lua side, when you have the transformation ready:
Code: Select all
-- at the top of the file:
local tf = {0,0,0,0,0,0,0,0,1}
...
-- probably in love.draw:
local ox, oy = love.graphics.inverseTransformPoint(0, 0)
local ix, iy = love.graphics.inverseTransformPoint(1, 0)
local jx, jy = love.graphics.inverseTransformPoint(0, 1)
ix, iy = ix - ox, iy - oy
jx, jy = jx - ox, jy - oy
tf[1] = ix; tf[2] = jx; tf[3] = ox; tf[4] = iy; tf[5] = jy; tf[6] = oy
shader:send('tf', tf)
I can't offer better help without a more specific question, sorry.
Edit: Added example.