X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=flat_input.frag;h=007675e848fc08aec4ced29015ad61a078ae4b6c;hp=d7c04cc5718f7fc5f0d38923932a601751426f41;hb=67b2debafd624d3be66588171d6ec677b54247ba;hpb=ef82f39846c48a654b63797b78bf8b0b8935d348 diff --git a/flat_input.frag b/flat_input.frag index d7c04cc..007675e 100644 --- a/flat_input.frag +++ b/flat_input.frag @@ -6,5 +6,17 @@ vec4 FUNCNAME(vec2 tc) { // we flip the y coordinate. tc.y = 1.0 - tc.y; - return texture2D(PREFIX(tex), tc); + vec4 pixel = texture2D(PREFIX(tex), tc); + + // These two are #defined to 0 or 1 in flat_input.cpp. +#if FIXUP_SWAP_RB + pixel.rb = pixel.br; +#endif +#if FIXUP_RED_TO_GRAYSCALE + pixel.gb = pixel.rr; +#endif + return pixel; } + +#undef FIXUP_SWAP_RB +#undef FIXUP_RED_TO_GRAYSCALE