+ // Make sure the smoothness on the right and upper borders is zero.
+ // We could have done this by making (W-1)xH and Wx(H-1) textures instead
+ // (we're sampling smoothness with all-zero border color), but we'd
+ // have to adjust the sampling coordinates, which is annoying.
+ glClearTexSubImage(smoothness_x_tex, 0, level_width - 1, 0, 0, 1, level_height, 1, GL_RED, GL_FLOAT, nullptr);
+ glClearTexSubImage(smoothness_y_tex, 0, 0, level_height - 1, 0, level_width, 1, 1, GL_RED, GL_FLOAT, nullptr);