marifx_m/shaders/glsl/mfx_lumasharp.fp
Marisa Kirisame 232ec85941 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.
2021-10-07 19:51:47 +02:00

22 lines
738 B
GLSL

/*
LumaSharpen from MariENB
(C)2012-2021 Marisa Kirisame
*/
#define luminance(x) dot(x,vec3(0.2126,0.7152,0.0722))
void main()
{
vec2 coord = TexCoord;
vec4 res = texture(InputTexture,coord);
vec2 bof = (1.0/textureSize(InputTexture,0))*sharpradius;
vec4 crawling = texture(InputTexture,coord+vec2(0,-1)*bof);
crawling += texture(InputTexture,coord+vec2(-1,0)*bof);
crawling += texture(InputTexture,coord+vec2(1,0)*bof);
crawling += texture(InputTexture,coord+vec2(0,1)*bof);
crawling *= 0.25;
vec4 inmyskin = res-crawling;
float thesewounds = luminance(inmyskin.rgb);
thesewounds = clamp(thesewounds,-sharpclamp*0.01,sharpclamp*0.01);
vec4 theywillnotheal = res+thesewounds*sharpblend;
FragColor = theywillnotheal;
}