]> git.sesse.net Git - nageru/blobdiff - flow.cpp
Visualize the flow consistently with .flo files (which have y = down).
[nageru] / flow.cpp
index 47cebba7918c84471583629367192795b7aff19b..205b24f098e4035f9f725a2f16e0c8b493fe6289 100644 (file)
--- a/flow.cpp
+++ b/flow.cpp
@@ -494,7 +494,7 @@ int main(void)
 
                // 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);
@@ -523,7 +523,7 @@ int main(void)
                        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);