// DIRECTION_VERTICAL will be #defined to 1 if we are expanding vertically,
// and 0 otherwise.
#if DIRECTION_VERTICAL
- float sliced_coord = tc.y;
+ float sliced_coord = 1.0 - tc.y;
#else
float sliced_coord = tc.x;
#endif
float input_coord = slice_num * PREFIX(slice_num_to_input_coord) + slice_offset * PREFIX(slice_offset_to_input_coord);
#if DIRECTION_VERTICAL
- return INPUT(vec2(tc.x, input_coord));
+ return INPUT(vec2(tc.x, 1.0 - input_coord));
#else
return INPUT(vec2(input_coord, tc.y));
#endif
// discard roles, where one does convolutions by means of many small FFTs, but
// could also work as a (relatively boring) video effect on its own.
//
-// Note that vertical slices happen from the bottom, not the top, due to the
-// OpenGL coordinate system.
+// Note that vertical slices happen from the top, consistent with the rest of
+// Movit.
#include <GL/glew.h>
#include <string>
expect_equal(expected_data, out_data, 4, 2);
}
-TEST(SliceEffectTest, VerticalOverlapSlicesFromBottom) {
+TEST(SliceEffectTest, VerticalOverlapSlicesFromTop) {
float data[2 * 3] = {
0.0f, 0.1f,
-
0.4f, 0.3f,
+
0.6f, 0.2f,
};
float expected_data[2 * 6] = {
- 0.0f, 0.1f,
- 0.0f, 0.1f,
- 0.0f, 0.1f,
-
0.0f, 0.1f,
0.4f, 0.3f,
0.6f, 0.2f,
+
+ 0.6f, 0.2f,
+ 0.6f, 0.2f,
+ 0.6f, 0.2f,
};
float out_data[2 * 6];