Enforce intermission bg filtering through shaders, to fix jaggies at certain resolutions.
This commit is contained in:
parent
4d319e6a8a
commit
bbd43c58e4
5 changed files with 94 additions and 11 deletions
48
gldefs.misc
48
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"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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-";
|
||||
|
|
|
|||
17
shaders/glsl/Bilinear.fp
Normal file
17
shaders/glsl/Bilinear.fp
Normal file
|
|
@ -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);
|
||||
}
|
||||
14
shaders/glsl/Oversample.fp
Normal file
14
shaders/glsl/Oversample.fp
Normal file
|
|
@ -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));
|
||||
}
|
||||
|
|
@ -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 )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue