*/}}
Jelajahi Sumber

use smoother texture

YimingWu 4 bulan lalu
induk
melakukan
5533956fc2
1 mengubah file dengan 5 tambahan dan 4 penghapusan
  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;}
     }