From 957d873c387993c711249657f3080c5d686d7ea1 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 7 Jul 2018 12:54:00 +0200 Subject: [PATCH] Correct the sampling of the flow in the densification vertex shader. --- densify.vert | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/densify.vert b/densify.vert index 6a02041..e4db8fb 100644 --- a/densify.vert +++ b/densify.vert @@ -19,8 +19,7 @@ void main() image_pos = patch_spacing * ivec2(patch_x, patch_y) + patch_size * position; // Find the flow value for this patch, and send it on to the fragment shader. - vec2 patch_center = patch_spacing * ivec2(patch_x, patch_y) + patch_size * vec2(0.5, 0.5); - flow_du = texture(flow_tex, patch_center).xy; + flow_du = texelFetch(flow_tex, ivec2(patch_x, patch_y), 0).xy; // The result of glOrtho(0.0, 1.0, 0.0, 1.0, 0.0, 1.0) is: // -- 2.39.2