Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #version 330
- uniform sampler2D texA;
- in vec2 ftexcoord;
- layout(location = 0) out vec4 rgbColour;
- //layout(location = 0) out vec4 yuvColour;
- void main()
- {
- float y;
- float cb;
- float cr;
- vec2 txc = gl_FragCoord.xy;
- ivec2 texSize = textureSize(texA, 0);
- vec2 texOffset = 1 / vec2(texSize.xy);
- y = texture(texA, ftexcoord).r;
- if (mod(txc.x, 2) > 1)
- {
- cb = texture(texA, ftexcoord.xy + texOffset * vec2(1.0, 0.0)).g - 0.5;
- cr = texture(texA, ftexcoord).g - 0.5;
- }
- else
- {
- cb = texture(texA, ftexcoord).g - 0.5;
- cr = texture(texA, ftexcoord.xy + texOffset * vec2(-1.0, 0.0)).g - 0.5;
- }
- rgbColour.r = y + 1.5958* cr;
- rgbColour.g = y - 0.39173 * cb - 0.81290 * cr;
- rgbColour.b = y + 2.017*cb;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement