Fix colorspace on headset

This commit is contained in:
Patrick Nicolas
2022-11-14 19:41:17 +01:00
parent 9dce5e933b
commit dc7f2cda21
6 changed files with 33 additions and 18 deletions
@@ -38,12 +38,7 @@ vec4 gamma4(vec4 x)
return vec4(gamma(x.r), gamma(x.g), gamma(x.b), gamma(x.a));
}
float reduce_range(float x)
{
return (16 + x * 219) / 256;
}
void main() {
vec4 rgba = gamma4(texture(image, pos));
y = reduce_range(rgba.r * 0.2126 + rgba.g * 0.7152 + rgba.b * 0.0722);
y = rgba.r * 0.2126 + rgba.g * 0.7152 + rgba.b * 0.0722;
}