*/}}
瀏覽代碼

use smoother texture

YimingWu 4 月之前
父節點
當前提交
5533956fc2
共有 1 個文件被更改,包括 5 次插入4 次删除
  1. 5 4
      resources/la_tns_shaders.cpp

+ 5 - 4
resources/la_tns_shaders.cpp

@@ -745,17 +745,18 @@ void main(){
 		ivec2 tsize = textureSize(TexColor,0);
 		vec2 pixel = fUV.st * vec2(tsize);
 		ivec2 tpixel = ivec2(pixel);
-        vec4 yuyv = texelFetch(TexColor,tpixel,0);
+        vec4 yuyv = texture(TexColor,fUV.st); //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);
+		vec2 pixel = fUV.st * vec2(tsize);
+		ivec2 tpixel = ivec2(pixel);
+        vec4 uyvy = texture(TexColor,fUV.st); //texelFetch(TexColor,tpixel,0);
 		vec3 yuv; yuv.yz=uyvy.xz;
-		if((tpixel.x % 2) !=0){ yuv.x=uyvy.y; }else{ yuv.x=uyvy.w; }
+		if(fract(pixel.x)<=1.){ yuv.x=uyvy.y; }else{ yuv.x=uyvy.w; }
 		color=vec4(YUV2sRGB(yuv),1.0f);
         if(MultiplyColor!=0){color*=fColor;}
     }