diff --git a/gldefs.misc b/gldefs.misc index 0fe04ecc0..6e7959ad1 100644 --- a/gldefs.misc +++ b/gldefs.misc @@ -32,3 +32,51 @@ HardwareShader Sprite "MBRNB0" { Shader "shaders/glsl/Whew.fp" } +HardwareShader Texture "graphics/InterBG.png" +{ + Shader "shaders/glsl/Bilinear.fp" +} +HardwareShader Texture "graphics/Fanart/CaptainJ.png" +{ + Shader "shaders/glsl/Oversample.fp" +} +HardwareShader Texture "graphics/Fanart/CaptainJ2.png" +{ + Shader "shaders/glsl/Oversample.fp" +} +HardwareShader Texture "graphics/Fanart/Endie.jpg" +{ + Shader "shaders/glsl/Bilinear.fp" +} +HardwareShader Texture "graphics/Fanart/Marisa.jpg" +{ + Shader "shaders/glsl/Bilinear.fp" +} +HardwareShader Texture "graphics/Fanart/Marisa2.jpg" +{ + Shader "shaders/glsl/Bilinear.fp" +} +HardwareShader Texture "graphics/Fanart/Marisa3.jpg" +{ + Shader "shaders/glsl/Bilinear.fp" +} +HardwareShader Texture "graphics/Fanart/Marisa4.jpg" +{ + Shader "shaders/glsl/Bilinear.fp" +} +HardwareShader Texture "graphics/Fanart/Marisa5.jpg" +{ + Shader "shaders/glsl/Bilinear.fp" +} +HardwareShader Texture "graphics/Fanart/RedeadITA.png" +{ + Shader "shaders/glsl/Oversample.fp" +} +HardwareShader Texture "graphics/Fanart/S20TBL.jpg" +{ + Shader "shaders/glsl/Bilinear.fp" +} +HardwareShader Texture "graphics/Fanart/Shivers.png" +{ + Shader "shaders/glsl/Bilinear.fp" +} diff --git a/language.version b/language.version index 0fdcddf51..f6dc8d915 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r439 \cu(Sun 11 Apr 19:49:21 CEST 2021)\c-"; -SWWM_SHORTVER="\cw0.9.11b-pre r439 \cu(2021-04-11 19:49:21)\c-"; +SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r441 \cu(Sun 11 Apr 21:20:27 CEST 2021)\c-"; +SWWM_SHORTVER="\cw0.9.11b-pre r441 \cu(2021-04-11 21:20:27)\c-"; diff --git a/shaders/glsl/Bilinear.fp b/shaders/glsl/Bilinear.fp new file mode 100644 index 000000000..afb735fcf --- /dev/null +++ b/shaders/glsl/Bilinear.fp @@ -0,0 +1,17 @@ +// This should act as Bilinear filtering when texture filtering is disabled + +vec4 ProcessTexel() +{ + vec2 size = textureSize(tex,0); + vec2 pxsize = vec2(1./size.x,1./size.y); + vec2 pos = vTexCoord.st; + float a = fract(pos.x*size.x); + float b = fract(pos.y*size.y); + vec4 p0q0 = texture(tex,pos); + vec4 p1q0 = texture(tex,pos+vec2(pxsize.x,0)); + vec4 p0q1 = texture(tex,pos+vec2(0,pxsize.y)); + vec4 p1q1 = texture(tex,pos+vec2(pxsize.x,pxsize.y)); + vec4 pInterp_q0 = mix(p0q0,p1q0,a); + vec4 pInterp_q1 = mix(p0q1,p1q1,a); + return mix(pInterp_q0,pInterp_q1,b); +} diff --git a/shaders/glsl/Oversample.fp b/shaders/glsl/Oversample.fp new file mode 100644 index 000000000..f6e3adc1e --- /dev/null +++ b/shaders/glsl/Oversample.fp @@ -0,0 +1,14 @@ +// This should act as a virtual NormalNx upscaler when using texture filtering + +vec4 ProcessTexel() +{ + vec2 size = textureSize(tex,0); + vec2 pxsize = vec2(1./size.x,1./size.y); + vec2 pos = vTexCoord.st-vec2(.5)*pxsize; + vec2 fcoord = fract(pos*size-vec2(.5)); + vec2 coeff = fcoord*6.; // virtual upscale factor I guess? + float threshold = 0.; // this controls sharpness, kinda + coeff = (coeff-threshold)*1./(1.-2*threshold); + coeff = clamp(coeff,0.,1.); + return texture(tex,pos+pxsize*(coeff-fcoord)); +} diff --git a/zscript/menu/swwm_inter.zsc b/zscript/menu/swwm_inter.zsc index 6832a53dd..df3702fbb 100644 --- a/zscript/menu/swwm_inter.zsc +++ b/zscript/menu/swwm_inter.zsc @@ -76,15 +76,19 @@ Class SWWMStatScreen : StatusScreen abstract whichart = ents[Random[InterArt](0,ents.Size()-1)]; pdata.lastart.Push(whichart); } - if ( !bgtex ) bgtex = TexMan.CheckForTexture("graphics/InterBG.png",TexMan.Type_MiscPatch); - double ar = Screen.GetAspectRatio(); - Vector2 tsize = TexMan.GetScaledSize(bgtex); - double sar = tsize.x/tsize.y; - Vector2 vsize; - if ( sar > ar ) vsize = (tsize.y*ar,tsize.y); - else if ( sar < ar ) vsize = (tsize.x,tsize.x/ar); - else vsize = tsize; - Screen.DrawTexture(bgtex,false,(vsize.x-tsize.x)/2,(vsize.y-tsize.y)/2,DTA_VirtualWidthF,vsize.x,DTA_VirtualHeightF,vsize.y,DTA_KeepRatio,true); + double ar = Screen.GetAspectRatio(), sar; + Vector2 tsize, vsize; + if ( whichart ) Screen.Clear(0,0,Screen.GetWidth(),Screen.GetHeight(),"Black"); + else + { + if ( !bgtex ) bgtex = TexMan.CheckForTexture("graphics/InterBG.png",TexMan.Type_MiscPatch); + tsize = TexMan.GetScaledSize(bgtex); + sar = tsize.x/tsize.y; + if ( sar > ar ) vsize = (tsize.y*ar,tsize.y); + else if ( sar < ar ) vsize = (tsize.x,tsize.x/ar); + else vsize = tsize; + Screen.DrawTexture(bgtex,false,(vsize.x-tsize.x)/2,(vsize.y-tsize.y)/2,DTA_VirtualWidthF,vsize.x,DTA_VirtualHeightF,vsize.y,DTA_KeepRatio,true); + } Font fnt = LangFont(TewiFont); // background pics if ( whichart )