// Densification.
- // Set up an output texture.
+ // Set up an output texture (initially zero).
GLuint dense_flow_tex;
glCreateTextures(GL_TEXTURE_2D, 1, &dense_flow_tex);
//glTextureStorage2D(dense_flow_tex, 1, GL_RGB16F, level_width, level_height);
float w = dense_flow[(yy * level_width + x) * 3 + 2];
du = (du / w) * level_width;
- dv = (dv / w) * level_height;
+ dv = (-dv / w) * level_height;
uint8_t r, g, b;
flow2rgb(du, dv, &r, &g, &b);