X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=motion_search.vert;h=ba21b846d8b98fe0484556351264e68f8479e340;hb=9c75a0fcc4d9dba5604a4939de21e943e63f739e;hp=0e782aa8c2fcab55267b9cf67608768bce01f39e;hpb=d88cb2ee9ddf6dff5428fd593afddf1384b185e8;p=nageru diff --git a/motion_search.vert b/motion_search.vert index 0e782aa..ba21b84 100644 --- a/motion_search.vert +++ b/motion_search.vert @@ -5,6 +5,7 @@ out vec2 flow_tc; out vec2 patch_center; uniform sampler2D flow_tex; +uniform vec2 out_flow_size; void main() { @@ -23,9 +24,8 @@ void main() // // a = 1 / (w - 1) // b = w / 2 (w - 1) - vec2 flow_size = textureSize(flow_tex, 0); - vec2 a = flow_size / (flow_size - 1); - vec2 b = -1.0 / (2 * (flow_size - 1.0)); + vec2 a = out_flow_size / (out_flow_size - 1); + vec2 b = -1.0 / (2 * (out_flow_size - 1.0)); patch_center = a * position + b; // The result of glOrtho(0.0, 1.0, 0.0, 1.0, 0.0, 1.0) is: