From: Steinar H. Gunderson Date: Sat, 7 Jul 2018 10:54:00 +0000 (+0200) Subject: Correct the sampling of the flow in the densification vertex shader. X-Git-Tag: 1.8.0~76^2~231 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=957d873c387993c711249657f3080c5d686d7ea1;p=nageru Correct the sampling of the flow in the densification vertex shader. --- 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: //