]> git.sesse.net Git - nageru/commitdiff
Correct the sampling of the flow in the densification vertex shader.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 7 Jul 2018 10:54:00 +0000 (12:54 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 7 Jul 2018 10:54:00 +0000 (12:54 +0200)
densify.vert

index 6a02041a78dc6811aa0309cc0e3d52055f07ff10..e4db8fba94789e57145d7da20f1ccae455342290 100644 (file)
@@ -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:
        //