X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=footer.frag;fp=footer.frag;h=339ef7bbb335887fd36f4d209f03d3dfb6247618;hp=4976136abf07491c6e586fa6a9380d5878248f48;hb=2d3b64d51be3e8f38a8c224f558de4ceb222e799;hpb=34776d3ed2565ee834405e575bf3bfc7f7933e36 diff --git a/footer.frag b/footer.frag index 4976136..339ef7b 100644 --- a/footer.frag +++ b/footer.frag @@ -13,6 +13,10 @@ #define YCBCR_ALSO_OUTPUT_RGBA 0 #endif +#ifndef SQUARE_ROOT_TRANSFORMATION +#define SQUARE_ROOT_TRANSFORMATION 0 +#endif + #if YCBCR_OUTPUT_PLANAR out vec4 Y; out vec4 Cb; @@ -38,6 +42,11 @@ void main() vec4 color0 = INPUT(tc); #endif +#if SQUARE_ROOT_TRANSFORMATION + // Make sure we don't give negative values to sqrt. + color0.rgb = sqrt(max(color0.rgb, 0.0)); +#endif + #if YCBCR_OUTPUT_PLANAR Y = color0.rrra; Cb = color0.ggga;