Major MariFX update:

- Complete RetroFX filter (downscale+palette).
 - Additional palettes, extending to the full range of 64.
 - Localization support (just English for now).
 - Better slider input (shift for 10x increments, alt for 5x increments)
 - Use nosave cvars for performance and so they don't end up in savegames.
 - A lot of cleanup.
This commit is contained in:
Marisa the Magician 2021-10-07 19:51:47 +02:00
commit 232ec85941
19 changed files with 689 additions and 591 deletions

View file

@ -1,6 +1,6 @@
/*
Border blur from MariENB
(C)2012-2019 Marisa Kirisame
(C)2012-2021 Marisa Kirisame
*/
void main()
{

View file

@ -1,6 +1,6 @@
/*
BlurSharpShift blur from MariENB
(C)2012-2019 Marisa Kirisame
(C)2012-2021 Marisa Kirisame
*/
void main()
{

View file

@ -1,6 +1,6 @@
/*
BlurSharpShift sharpen from MariENB
(C)2012-2019 Marisa Kirisame
(C)2012-2021 Marisa Kirisame
*/
void main()
{

View file

@ -1,6 +1,6 @@
/*
BlurSharpShift shift from MariENB
(C)2012-2019 Marisa Kirisame
(C)2012-2021 Marisa Kirisame
*/
void main()
{

View file

@ -1,6 +1,6 @@
/*
Simple color matrix from MariENB
(C)2012-2019 Marisa Kirisame
(C)2012-2021 Marisa Kirisame
*/
void main()
{

View file

@ -1,6 +1,6 @@
/*
Dirty camera effect from MariENB
(C)2012-2019 Marisa Kirisame
(C)2012-2021 Marisa Kirisame
*/
vec3 lensdirt( in vec3 res, in vec2 coord )
{

View file

@ -1,6 +1,6 @@
/*
Math color grading from MariENB
(C)2012-2019 Marisa Kirisame
(C)2012-2021 Marisa Kirisame
*/
#define luminance(x) dot(x,vec3(0.2126,0.7152,0.0722))

View file

@ -1,6 +1,6 @@
/*
Complex grain shader ported over from MariENB
(C)2012-2019 Marisa Kirisame
(C)2012-2021 Marisa Kirisame
*/
const float nf = 0.0005;
const vec3 nm1 = vec3(2.05,3.11,2.22);

View file

@ -1,7 +1,7 @@
/*
Hue-Saturation filter from MariENB, ported over from GIMP
(C)2007 Michael Natterer
(C)2012-2019 Marisa Kirisame
(C)2012-2021 Marisa Kirisame
*/
vec3 rgb2hsv( vec3 c )
{

View file

@ -1,6 +1,6 @@
/*
LumaSharpen from MariENB
(C)2012-2019 Marisa Kirisame
(C)2012-2021 Marisa Kirisame
*/
#define luminance(x) dot(x,vec3(0.2126,0.7152,0.0722))
@ -19,4 +19,4 @@ void main()
thesewounds = clamp(thesewounds,-sharpclamp*0.01,sharpclamp*0.01);
vec4 theywillnotheal = res+thesewounds*sharpblend;
FragColor = theywillnotheal;
}
}

View file

@ -1,7 +1,23 @@
/*
RetroFX palette reduction from MariENB
(C)2012-2019 Marisa Kirisame
(C)2012-2021 Marisa Kirisame
*/
vec3 rgb2hsv( vec3 c )
{
vec4 K = vec4(0.0,-1.0/3.0,2.0/3.0,-1.0);
vec4 p = (c.g<c.b)?vec4(c.bg,K.wz):vec4(c.gb,K.xy);
vec4 q = (c.r<p.x)?vec4(p.xyw,c.r):vec4(c.r,p.yzx);
float d = q.x-min(q.w,q.y);
float e = 1.0e-10;
return vec3(abs(q.z+(q.w-q.y)/(6.0*d+e)),d/(q.x+e),q.x);
}
vec3 hsv2rgb( vec3 c )
{
vec4 K = vec4(1.0,2.0/3.0,1.0/3.0,3.0);
vec3 p = abs(fract(c.xxx+K.xyz)*6.0-K.www);
return c.z*mix(K.xxx,clamp(p-K.xxx,0.0,1.0),c.y);
}
void main()
{
#define d(x) x/64.0
@ -18,8 +34,11 @@ void main()
);
#undef d
vec2 coord = TexCoord;
vec2 sfact = textureSize(InputTexture,0);
vec4 res = texture(InputTexture,coord);
vec3 hsv = rgb2hsv(res.rgb);
hsv.y = clamp(hsv.y*palsat,0.,1.);
hsv.z = pow(max(hsv.z,0.),palpow);
res.rgb = hsv2rgb(hsv);
if ( res.r <= 0.0 ) res.r -= paldither;
if ( res.g <= 0.0 ) res.g -= paldither;
if ( res.b <= 0.0 ) res.b -= paldither;

View file

@ -0,0 +1,10 @@
/*
RetroFX downscaling from MariENB
(C)2012-2021 Marisa Kirisame
*/
void main()
{
// far more simplified when the actual scale calculations are on the zscript side
ivec2 ncoord = ivec2((floor(TexCoord*bresl)/bresl)*textureSize(InputTexture,0));
FragColor = texelFetch(InputTexture,ncoord,0);
}

View file

@ -1,6 +1,6 @@
/*
Vignette filter from MariENB
(C)2012-2019 Marisa Kirisame
(C)2012-2021 Marisa Kirisame
*/
void main()
{