Various touchups in preparation for a first release.
This commit is contained in:
parent
dafbde8e99
commit
5c368503e5
20 changed files with 279 additions and 78 deletions
|
|
@ -1,11 +1,26 @@
|
|||
/*
|
||||
Border blur from MariENB
|
||||
(C)2012-2019 Marisa Kirisame
|
||||
*/
|
||||
void main()
|
||||
{
|
||||
float gauss4[4] = { 0.270682, 0.216745, 0.111281, 0.036633 };
|
||||
vec2 coord = TexCoord;
|
||||
vec4 res = texture(InputTexture,coord);
|
||||
vec2 bresl = textureSize(InputTexture,0);
|
||||
vec2 uv = ((coord-0.5)*vec2(1.0,bresl.y/bresl.x))*2.0;
|
||||
float bfact = clamp(pow(dot(uv,uv),bblurpow)*bblurmul+bblurbump,0.0,1.0);
|
||||
float vigdata = 0.0;
|
||||
if ( vigshape == 0 )
|
||||
{
|
||||
vec2 uv = ((coord-0.5)*vec2(1.0,bresl.y/bresl.x))*2.0;
|
||||
vigdata = clamp(pow(dot(uv,uv),vigpow)*vigmul+vigbump,0.0,1.0);
|
||||
}
|
||||
else if ( vigshape == 1 )
|
||||
{
|
||||
vec2 uv = coord.xy*(1.0-coord.yx)*4.0;
|
||||
vigdata = clamp(pow(max(1.0-(uv.x*uv.y),0.0),vigpow)*vigmul+vigbump,0.0,1.0);
|
||||
}
|
||||
else vigdata = texture(VignetteTexture,coord).a;
|
||||
float bfact = clamp(pow(max(vigdata,0.0),bblurpow)*bblurmul+bblurbump,0.0,1.0);
|
||||
vec2 bof = (1.0/bresl)*bblurradius*bfact;
|
||||
res.rgb *= 0;
|
||||
int i,j;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
BlurSharpShift blur from MariENB
|
||||
(C)2012-2019 Marisa Kirisame
|
||||
*/
|
||||
void main()
|
||||
{
|
||||
vec2 coord = TexCoord;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
BlurSharpShift sharpen from MariENB
|
||||
(C)2012-2019 Marisa Kirisame
|
||||
*/
|
||||
void main()
|
||||
{
|
||||
vec2 coord = TexCoord;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
BlurSharpShift shift from MariENB
|
||||
(C)2012-2019 Marisa Kirisame
|
||||
*/
|
||||
void main()
|
||||
{
|
||||
vec2 coord = TexCoord;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
Simple color matrix from MariENB
|
||||
(C)2012-2019 Marisa Kirisame
|
||||
*/
|
||||
void main()
|
||||
{
|
||||
vec2 coord = TexCoord;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,14 @@
|
|||
/*
|
||||
Dirty camera effect from MariENB
|
||||
(C)2012-2019 Marisa Kirisame
|
||||
*/
|
||||
vec3 lensdirt( in vec3 res, in vec2 coord )
|
||||
{
|
||||
vec2 nr = textureSize(InputTexture,0)/textureSize(NoiseTexture,0);
|
||||
vec3 ncolc = texture(NoiseTexture,coord*dirtmc*nr).rgb;
|
||||
vec2 bresl = textureSize(InputTexture,0);
|
||||
vec2 nr = vec2(1.0,bresl.y/bresl.x);
|
||||
float ncol = texture(NoiseTexture,coord*dirtmc*nr).x;
|
||||
vec2 ds = vec2(res.r+res.g,res.g+res.b)/2.0;
|
||||
res = mix(res,(ncolc.r+1.0)*res,dirtcfactor*clamp(1.0-(ds.x+ds.y)*0.25,0.0,1.0));
|
||||
res = mix(res,(ncol+1.0)*res,dirtcfactor*clamp(1.0-(ds.x+ds.y)*0.25,0.0,1.0));
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
/* math color grading from MariFX */
|
||||
/*
|
||||
Math color grading from MariENB
|
||||
(C)2012-2019 Marisa Kirisame
|
||||
*/
|
||||
#define luminance(x) dot(x,vec3(0.2126,0.7152,0.0722))
|
||||
|
||||
vec3 rgb2hsv( vec3 c )
|
||||
|
|
|
|||
|
|
@ -1,15 +1,13 @@
|
|||
/*
|
||||
Complex grain shader ported over from MariENB
|
||||
(C)2012-2018 Marisa Kirisame
|
||||
(C)2012-2019 Marisa Kirisame
|
||||
*/
|
||||
const float nf = 0.000005;
|
||||
const float nf = 0.0005;
|
||||
const vec3 nm1 = vec3(2.05,3.11,2.22);
|
||||
const float nk = 0.04;
|
||||
const vec3 nm2 = vec3(4.25,9.42,6.29);
|
||||
const float ns = -0.08;
|
||||
const float np = 3.95;
|
||||
const float bnp = 1.7;
|
||||
|
||||
#define overlay(a,b) (a<0.5)?(2.0*a*b):(1.0-(2.0*(1.0-a)*(1.0-b)))
|
||||
#define darkmask(a,b) (a>0.5)?(2.0*a*(0.5+b)):(1.0-2.0*(1.0-a)*(1.0-((0.5+b))))
|
||||
|
||||
vec3 grain( in vec3 res, in vec2 coord )
|
||||
|
|
@ -19,7 +17,9 @@ vec3 grain( in vec3 res, in vec2 coord )
|
|||
vec2 s2 = coord+vec2(ts,0.0);
|
||||
vec2 s3 = coord+vec2(ts,ts);
|
||||
float n1, n2, n3;
|
||||
vec2 nr = textureSize(NoiseTexture,0);
|
||||
vec2 bresl = textureSize(InputTexture,0);
|
||||
vec2 nr = vec2(7.5);
|
||||
nr.y *= bresl.y/bresl.x;
|
||||
n1 = texture(NoiseTexture,s1*nm1.x*nr).r;
|
||||
n2 = texture(NoiseTexture,s2*nm1.y*nr).g;
|
||||
n3 = texture(NoiseTexture,s3*nm1.z*nr).b;
|
||||
|
|
@ -33,12 +33,22 @@ vec3 grain( in vec3 res, in vec2 coord )
|
|||
vec3 ng = vec3(n4);
|
||||
vec3 nc = vec3(n1,n2,n3);
|
||||
vec3 nt = pow(clamp(mix(ng,nc,ns),0.0,1.0),vec3(np));
|
||||
float bn = 1.0-clamp((res.r+res.g+res.b)/3.0,0.0,1.0);
|
||||
bn = pow(bn,bnp);
|
||||
vec3 nn = clamp(nt*bn,vec3(0.0),vec3(1.0));
|
||||
res.r = darkmask(res.r,(nn.r*ni));
|
||||
res.g = darkmask(res.g,(nn.g*ni));
|
||||
res.b = darkmask(res.b,(nn.b*ni));
|
||||
if ( nb == 0 ) res.rgb += nt*ni;
|
||||
else if ( nb == 1 )
|
||||
{
|
||||
res.r = overlay(res.r,(nt.r*ni+0.5));
|
||||
res.g = overlay(res.g,(nt.g*ni+0.5));
|
||||
res.b = overlay(res.b,(nt.b*ni+0.5));
|
||||
}
|
||||
else
|
||||
{
|
||||
float bn = 1.0-clamp((res.r+res.g+res.b)/3.0,0.0,1.0);
|
||||
bn = pow(bn,bnp);
|
||||
vec3 nn = clamp(nt*bn,vec3(0.0),vec3(1.0));
|
||||
res.r = darkmask(res.r,(nn.r*ni));
|
||||
res.g = darkmask(res.g,(nn.g*ni));
|
||||
res.b = darkmask(res.b,(nn.b*ni));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
Hue-Saturation filter from MariENB, ported over from GIMP
|
||||
(C)2007 Michael Natterer
|
||||
(C)2012-2019 Marisa Kirisame
|
||||
*/
|
||||
vec3 rgb2hsv( vec3 c )
|
||||
{
|
||||
vec4 K = vec4(0.0,-1.0/3.0,2.0/3.0,-1.0);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
LumaSharpen from MariENB
|
||||
(C)2012-2019 Marisa Kirisame
|
||||
*/
|
||||
#define luminance(x) dot(x,vec3(0.2126,0.7152,0.0722))
|
||||
|
||||
void main()
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
RetroFX palette reduction from MariENB
|
||||
(C)2012-2019 Marisa Kirisame
|
||||
*/
|
||||
void main()
|
||||
{
|
||||
#define d(x) x/64.0
|
||||
|
|
@ -16,7 +20,13 @@ void main()
|
|||
vec2 coord = TexCoord;
|
||||
vec2 sfact = textureSize(InputTexture,0);
|
||||
vec4 res = texture(InputTexture,coord);
|
||||
res.rgb += paldither*dither8[int(coord.x*sfact.x)%8+int(coord.y*sfact.y)%8*8]-paldither*0.5;
|
||||
if ( res.r <= 0.0 ) res.r -= paldither;
|
||||
if ( res.g <= 0.0 ) res.g -= paldither;
|
||||
if ( res.b <= 0.0 ) res.b -= paldither;
|
||||
if ( res.r >= 1.0 ) res.r += paldither;
|
||||
if ( res.g >= 1.0 ) res.g += paldither;
|
||||
if ( res.b >= 1.0 ) res.b += paldither;
|
||||
res.rgb += paldither*dither8[int(coord.x*sfact.x)%8+int(coord.y*sfact.y)%8*8]-0.5*paldither;
|
||||
vec3 lc = clamp(floor(res.rgb*64),0,63);
|
||||
ivec2 lcoord = ivec2(lc.r,lc.g+lc.b*64);
|
||||
lcoord.x += 64*palnum;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,28 @@
|
|||
/*
|
||||
Vignette filter from MariENB
|
||||
(C)2012-2019 Marisa Kirisame
|
||||
*/
|
||||
void main()
|
||||
{
|
||||
vec2 coord = TexCoord;
|
||||
vec4 res = texture(InputTexture,coord);
|
||||
vec2 bresl = textureSize(InputTexture,0);
|
||||
vec2 uv = ((coord-0.5)*vec2(1.0,bresl.y/bresl.x))*2.0;
|
||||
vec4 vigdata = vec4(vigcolor,clamp(pow(dot(uv,uv),vigpow)*vigmul+vigbump,0.0,1.0));
|
||||
vec3 outcol = clamp(res.rgb+vigdata.rgb,0.0,1.0);
|
||||
res.rgb = mix(res.rgb,outcol,vigdata.a);
|
||||
vec4 vigdata = vec4(0.0);
|
||||
if ( vigshape == 0 )
|
||||
{
|
||||
vec2 uv = ((coord-0.5)*vec2(1.0,bresl.y/bresl.x))*2.0;
|
||||
vigdata = vec4(vigcolor,clamp(pow(dot(uv,uv),vigpow)*vigmul+vigbump,0.0,1.0));
|
||||
}
|
||||
else if ( vigshape == 1 )
|
||||
{
|
||||
vec2 uv = coord.xy*(1.0-coord.yx)*4.0;
|
||||
vigdata = vec4(vigcolor,clamp(pow(max(1.0-(uv.x*uv.y),0.0),vigpow)*vigmul+vigbump,0.0,1.0));
|
||||
}
|
||||
else vigdata = texture(VignetteTexture,coord);
|
||||
vec3 outcol;
|
||||
if ( vigmode == 0 ) outcol = vigdata.rgb;
|
||||
else if ( vigmode == 1 ) outcol = res.rgb+vigdata.rgb;
|
||||
else outcol = res.rgb*vigdata.rgb;
|
||||
res.rgb = mix(res.rgb,clamp(outcol,0.0,1.0),vigdata.a);
|
||||
FragColor = res;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue