X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=motion_search.frag;h=188f5c3da22b73361a810d382cd8d83cbdab0433;hb=d6cb36dd1f71c55cb70baf8cafd71bad5e48a96d;hp=769038977bd97b5724e70716e8e4770dc33c7f9d;hpb=1ed10162dcc208c0f95da7f203f51be6ccea0900;p=nageru diff --git a/motion_search.frag b/motion_search.frag index 7690389..188f5c3 100644 --- a/motion_search.frag +++ b/motion_search.frag @@ -90,16 +90,8 @@ void main() mat2 H_inv = inverse(H); - // Fetch the initial guess for the flow. (We need the normalization step - // because densification works by accumulating; see the comments on the - // Densify class.) - vec3 prev_flow = texture(flow_tex, flow_tc).xyz; - vec2 initial_u; - if (prev_flow.z < 1e-3) { - initial_u = vec2(0.0, 0.0); - } else { - initial_u = prev_flow.xy / prev_flow.z; - } + // Fetch the initial guess for the flow. + vec2 initial_u = texture(flow_tex, flow_tc).xy; // Note: The flow is in OpenGL coordinates [0..1], but the calculations // generally come out in pixels since the gradient is in pixels,