X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=motion_search.vert;h=ba21b846d8b98fe0484556351264e68f8479e340;hb=9c75a0fcc4d9dba5604a4939de21e943e63f739e;hp=28b65c225bfafdb2ab0d5f0678175ab978472930;hpb=670611b5a707fb8dcebf60fcfcd0930545d14875;p=nageru diff --git a/motion_search.vert b/motion_search.vert index 28b65c2..ba21b84 100644 --- a/motion_search.vert +++ b/motion_search.vert @@ -1,10 +1,11 @@ #version 450 core -in vec2 position; +layout(location=0) in vec2 position; 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: