1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
in vec4 fragTexCoord;
out vec4 fragOut0;
uniform sampler2DArray ytex;
uniform sampler2DArray utex;
uniform sampler2DArray vtex;
layout (std140) uniform movieData {
float alpha;
float pad[3];
};
void main()
{
float y = texture(ytex, vec3(fragTexCoord.st, 0.0)).r;
float u = texture(utex, vec3(fragTexCoord.st, 0.0)).r;
float v = texture(vtex, vec3(fragTexCoord.st, 0.0)).r;
vec3 val = vec3(y - 0.0625, u - 0.5, v - 0.5);
fragOut0.r = dot(val, vec3(1.1640625, 0.0, 1.59765625));
fragOut0.g = dot(val, vec3(1.1640625, -0.390625, -0.8125));
fragOut0.b = dot(val, vec3(1.1640625, 2.015625, 0.0));
fragOut0.a = alpha;
}
|