summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/main.c b/main.c
index 95abb3b..6c87cbe 100644
--- a/main.c
+++ b/main.c
@@ -415,14 +415,11 @@ void main() {\n\
y1 = mix(t01.z, t11.x, tcfrac.x * 2.0 - 1.0);\n\
}\n\
float y = mix(y0, y1, tcfrac.y);\n\
- //y = t00.x;\n\
- //cbcr = t00.yw;\n\
- y -= 16.0 / 255.0;\n\
- float cb = cbcr.x - 128.0 / 255.0;\n\
- float cr = cbcr.y - 128.0 / 255.0;\n\
- color = vec3(y+255.0/224.0*1.402*cr,\n\
- 255.0/219.0*y-255.0/224.0*1.772*0.11/0.587*cb-255.0/224.0*1.402*0.299/0.587*cr,\n\
- 255.0/219.0*y+255.0/224.0*1.772*cb);\n\
+ float cb = cbcr.x;\n\
+ float cr = cbcr.y;\n\
+ color = vec3((y-0.0627)+255.0/224.0*1.402*(cr-0.502),\n\
+ 255.0/219.0*(y-0.0627)-255.0/224.0*1.772*0.11/0.587*(cb-0.502)-255.0/224.0*1.402*0.299/0.587*(cr-0.502),\n\
+ 255.0/219.0*(y-0.0627)+255.0/224.0*1.772*(cb-0.502));\n\
//color = vec3(y);\n\
color = clamp(color, 0.0, 1.0);\n\
} break;\n\