Created
August 7, 2017 18:13
-
-
Save sortofsleepy/d9ea294cd674c256bae9c3e1061d70ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// yMap is the Y texture, uvMap is the CrCb texture | |
vec4 capturedImageTextureY = texture2D(yMap, uv); | |
vec4 capturedImageTextureCbCr = texture2D(uvMap, uv); | |
mat4 transform = mat4( | |
1.0000, 1.0000, 1.0000, 0.0000, | |
0.0000, -0.3441, 1.7720, 0.0000, | |
1.4020, -0.7141, 0.0000, 0.0000, | |
-0.7010, 0.5291, -0.8860, 1.0000 | |
); | |
vec4 ycbr = vec4(capturedImageTextureY.r,capturedImageTextureCbCr.rg,1.); | |
gl_FragColor = transform * ycbr; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment