+ // Increase the patch size a bit; since patch spacing is not necessarily
+ // an integer number of pixels, and we don't use conservative rasterization,
+ // we could be missing the outer edges of the patch. And it seemingly helps
+ // a little bit in general to have some more candidates as well -- although
+ // this is measured without variational refinement, so it might be moot
+ // with it.
+ //
+ // This maps [0.0,1.0] to [-0.25,1.25], ie. extends the patch by 25% in
+ // all directions.
+ vec2 grown_pos = (position * 1.5) - 0.25;
+
+ image_pos = patch_center + patch_size * (grown_pos - 0.5f);