|
@@ -530,6 +530,15 @@ vec3 XYZ2Clay(vec3 xyz){
|
|
|
vec3(0.0134474,-0.1183897,1.0154096));
|
|
|
return xyz*mat;
|
|
|
}
|
|
|
+vec3 YUV2sRGB(vec3 yuv){
|
|
|
+ yuv[0]=1.1643*(yuv[0]-0.0625);
|
|
|
+ yuv[1]-=0.5; yuv[2]-=0.5;
|
|
|
+ vec3 rgb;
|
|
|
+ rgb[0] = (yuv[0] + 1.28033 * yuv[2]);
|
|
|
+ rgb[1] = (yuv[0] - 0.21482 * yuv[1] - 0.38059 * yuv[2]);
|
|
|
+ rgb[2] = (yuv[0] + 2.12798 * yuv[1]);
|
|
|
+ return rgb;
|
|
|
+}
|
|
|
|
|
|
#define htsize HalftoneSize
|
|
|
vec4 rgb2cmyk(vec3 rgb){
|
|
@@ -732,7 +741,24 @@ void main(){
|
|
|
}else if(TextureMode==4){
|
|
|
color=vec4(texture(TexColorUI,fUV.st))/vec4(65535.);
|
|
|
if(MultiplyColor!=0){color*=fColor;}
|
|
|
- }
|
|
|
+ }else if(TextureMode==101){ // YUYV
|
|
|
+ ivec2 tsize = textureSize(TexColor,0);
|
|
|
+ vec2 pixel = fUV.st * vec2(tsize);
|
|
|
+ ivec2 tpixel = ivec2(pixel);
|
|
|
+ vec4 yuyv = texelFetch(TexColor,tpixel,0);
|
|
|
+ vec3 yuv; yuv.yz=yuyv.yw;
|
|
|
+ if(fract(pixel.x)<=1.){ yuv.x=yuyv.x; }else{ yuv.x=yuyv.z; }
|
|
|
+ color=vec4(YUV2sRGB(yuv),1.0f);
|
|
|
+ if(MultiplyColor!=0){color*=fColor;}
|
|
|
+ }else if(TextureMode==102){ // UYVY
|
|
|
+ ivec2 tsize = textureSize(TexColor,0);
|
|
|
+ ivec2 tpixel = ivec2(fUV.st * vec2(tsize));
|
|
|
+ vec4 uyvy = texelFetch(TexColor,tpixel,0);
|
|
|
+ vec3 yuv; yuv.yz=uyvy.xz;
|
|
|
+ if((tpixel.x % 2) !=0){ yuv.x=uyvy.y; }else{ yuv.x=uyvy.w; }
|
|
|
+ color=vec4(YUV2sRGB(yuv),1.0f);
|
|
|
+ if(MultiplyColor!=0){color*=fColor;}
|
|
|
+ }
|
|
|
if(UseNormal!=0){
|
|
|
color.a=HalftoneSingle(color.a,htsize,rad(7.),0.);
|
|
|
if(color.a==0.) discard;
|