glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
}
-// Calculate the smoothness constraints between neighboring pixels;
-// s_x(x,y) stores smoothness between pixel (x,y) and (x+1,y),
-// and s_y(x,y) stores between (x,y) and (x,y+1). We'll sample with
-// border color (0,0) later, so that there's zero diffusion out of
-// the border.
+// Actually solve the equation sets made by SetupEquations, by means of
+// successive over-relaxation (SOR).
//
// See variational_refinement.txt for more information.
class SOR {
for (int i = 0; i < timer.level * 2; ++i) {
fprintf(stderr, " ");
}
- fprintf(stderr, "%-30s %4.1f ms\n", timer.name.c_str(), (time_end - time_start) / 1e6);
+ fprintf(stderr, "%-30s %4.1f ms\n", timer.name.c_str(), GLint64(time_end - time_start) / 1e6);
}
}
GLuint initial_flow_tex;
glCreateTextures(GL_TEXTURE_2D, 1, &initial_flow_tex);
glTextureStorage2D(initial_flow_tex, 1, GL_RG16F, 1, 1);
+ glClearTexImage(initial_flow_tex, 0, GL_RG, GL_FLOAT, nullptr);
int prev_level_width = 1, prev_level_height = 1;
GLuint prev_level_flow_tex = initial_flow_tex;