Added Luma Sharpen. Rearranged filter chain. Set nicer defaults.
This commit is contained in:
parent
8cc1fc0169
commit
753a806b2e
6 changed files with 88 additions and 36 deletions
|
|
@ -3,11 +3,12 @@
|
||||||
Various fancy shaders for GZDoom.
|
Various fancy shaders for GZDoom.
|
||||||
|
|
||||||
Included:
|
Included:
|
||||||
- Film Grain.
|
- Luma Sharpen.
|
||||||
- Screen Dirt.
|
|
||||||
- Color Grading suite.
|
- Color Grading suite.
|
||||||
- BlurSharpShift.
|
|
||||||
- Vignette.
|
|
||||||
- Color Matrix.
|
- Color Matrix.
|
||||||
- Hue-Saturation.
|
- Hue-Saturation.
|
||||||
|
- BlurSharpShift.
|
||||||
|
- Film Grain.
|
||||||
|
- Screen Dirt.
|
||||||
|
- Vignette.
|
||||||
- Palette reduction+dither from RetroFX (has doom, heretic, hexen and strife palettes).
|
- Palette reduction+dither from RetroFX (has doom, heretic, hexen and strife palettes).
|
||||||
|
|
|
||||||
27
cvarinfo.txt
27
cvarinfo.txt
|
|
@ -1,11 +1,16 @@
|
||||||
user bool mfx_ne = true;
|
user bool mfx_lsharpenable = false;
|
||||||
|
user float mfx_lsharpradius = 0.8;
|
||||||
|
user float mfx_lsharpclamp = 0.05;
|
||||||
|
user float mfx_lsharpblend = 6.0;
|
||||||
|
|
||||||
|
user bool mfx_ne = false;
|
||||||
user float mfx_ni = 0.05;
|
user float mfx_ni = 0.05;
|
||||||
|
|
||||||
user bool mfx_dirtenable = false;
|
user bool mfx_dirtenable = false;
|
||||||
user float mfx_dirtcfactor = 0.1;
|
user float mfx_dirtcfactor = 0.05;
|
||||||
user float mfx_dirtmc = 3.0;
|
user float mfx_dirtmc = 3.0;
|
||||||
|
|
||||||
user bool mfx_gradeenable = true;
|
user bool mfx_gradeenable = false;
|
||||||
user float mfx_grademul_r = 1.0;
|
user float mfx_grademul_r = 1.0;
|
||||||
user float mfx_grademul_g = 1.0;
|
user float mfx_grademul_g = 1.0;
|
||||||
user float mfx_grademul_b = 1.0;
|
user float mfx_grademul_b = 1.0;
|
||||||
|
|
@ -57,27 +62,27 @@ user float mfx_hssat_m = 0.0;
|
||||||
user float mfx_hsval_m = 0.0;
|
user float mfx_hsval_m = 0.0;
|
||||||
|
|
||||||
user bool mfx_bssblurenable = false;
|
user bool mfx_bssblurenable = false;
|
||||||
user float mfx_bssblurradius = 0.25;
|
user float mfx_bssblurradius = 0.15;
|
||||||
user bool mfx_bsssharpenable = false;
|
user bool mfx_bsssharpenable = false;
|
||||||
user float mfx_bsssharpradius = 1.0;
|
user float mfx_bsssharpradius = 1.0;
|
||||||
user float mfx_bsssharpamount = 3.0;
|
user float mfx_bsssharpamount = 2.0;
|
||||||
user bool mfx_bssshiftenable = false;
|
user bool mfx_bssshiftenable = false;
|
||||||
user float mfx_bssshiftradius = 0.75;
|
user float mfx_bssshiftradius = 0.75;
|
||||||
|
|
||||||
user bool mfx_bblurenable = false;
|
user bool mfx_bblurenable = false;
|
||||||
user float mfx_bblurpow = 1.0;
|
user float mfx_bblurpow = 2.0;
|
||||||
user float mfx_bblurmul = 1.0;
|
user float mfx_bblurmul = 1.5;
|
||||||
user float mfx_bblurbump = 0.0;
|
user float mfx_bblurbump = -0.5;
|
||||||
user float mfx_bblurradius = 1.0;
|
user float mfx_bblurradius = 1.0;
|
||||||
|
|
||||||
user bool mfx_vigenable = false;
|
user bool mfx_vigenable = false;
|
||||||
user float mfx_vigcolor_r = -1.0;
|
user float mfx_vigcolor_r = -1.0;
|
||||||
user float mfx_vigcolor_g = -1.0;
|
user float mfx_vigcolor_g = -1.0;
|
||||||
user float mfx_vigcolor_b = -1.0;
|
user float mfx_vigcolor_b = -1.0;
|
||||||
user float mfx_vigpow = 1.0;
|
user float mfx_vigpow = 3.0;
|
||||||
user float mfx_vigmul = 1.0;
|
user float mfx_vigmul = 0.65;
|
||||||
user float mfx_vigbump = 0.0;
|
user float mfx_vigbump = 0.0;
|
||||||
|
|
||||||
user bool mfx_palenable = false;
|
user bool mfx_palenable = false;
|
||||||
user int mfx_palnum = 1;
|
user int mfx_palnum = 1;
|
||||||
user float mfx_paldither = 0.02;
|
user float mfx_paldither = 0.05;
|
||||||
|
|
|
||||||
49
gldefs.txt
49
gldefs.txt
|
|
@ -1,3 +1,12 @@
|
||||||
|
HardwareShader postprocess scene
|
||||||
|
{
|
||||||
|
Name "mfx_lumasharp"
|
||||||
|
Shader "shaders/glsl/mfx_lumasharp.fp" 330
|
||||||
|
Uniform float sharpradius
|
||||||
|
Uniform float sharpclamp
|
||||||
|
Uniform float sharpblend
|
||||||
|
}
|
||||||
|
|
||||||
HardwareShader postprocess scene
|
HardwareShader postprocess scene
|
||||||
{
|
{
|
||||||
Name "mfx_grading"
|
Name "mfx_grading"
|
||||||
|
|
@ -49,6 +58,26 @@ HardwareShader postprocess scene
|
||||||
Uniform float hsval_m
|
Uniform float hsval_m
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HardwareShader postprocess scene
|
||||||
|
{
|
||||||
|
Name "mfx_bss_blur"
|
||||||
|
Shader "shaders/glsl/mfx_bss_blur.fp" 330
|
||||||
|
Uniform float bssblurradius
|
||||||
|
}
|
||||||
|
HardwareShader postprocess scene
|
||||||
|
{
|
||||||
|
Name "mfx_bss_sharp"
|
||||||
|
Shader "shaders/glsl/mfx_bss_sharp.fp" 330
|
||||||
|
Uniform float bsssharpradius
|
||||||
|
Uniform float bsssharpamount
|
||||||
|
}
|
||||||
|
HardwareShader postprocess scene
|
||||||
|
{
|
||||||
|
Name "mfx_bss_shift"
|
||||||
|
Shader "shaders/glsl/mfx_bss_shift.fp" 330
|
||||||
|
Uniform float bssshiftradius
|
||||||
|
}
|
||||||
|
|
||||||
HardwareShader postprocess scene
|
HardwareShader postprocess scene
|
||||||
{
|
{
|
||||||
Name "mfx_borderblur"
|
Name "mfx_borderblur"
|
||||||
|
|
@ -77,26 +106,6 @@ HardwareShader postprocess scene
|
||||||
Texture NoiseTexture "textures/mfxnoise.png"
|
Texture NoiseTexture "textures/mfxnoise.png"
|
||||||
}
|
}
|
||||||
|
|
||||||
HardwareShader postprocess scene
|
|
||||||
{
|
|
||||||
Name "mfx_bss_blur"
|
|
||||||
Shader "shaders/glsl/mfx_bss_blur.fp" 330
|
|
||||||
Uniform float bssblurradius
|
|
||||||
}
|
|
||||||
HardwareShader postprocess scene
|
|
||||||
{
|
|
||||||
Name "mfx_bss_sharp"
|
|
||||||
Shader "shaders/glsl/mfx_bss_sharp.fp" 330
|
|
||||||
Uniform float bsssharpradius
|
|
||||||
Uniform float bsssharpamount
|
|
||||||
}
|
|
||||||
HardwareShader postprocess scene
|
|
||||||
{
|
|
||||||
Name "mfx_bss_shift"
|
|
||||||
Shader "shaders/glsl/mfx_bss_shift.fp" 330
|
|
||||||
Uniform float bssshiftradius
|
|
||||||
}
|
|
||||||
|
|
||||||
HardwareShader postprocess scene
|
HardwareShader postprocess scene
|
||||||
{
|
{
|
||||||
Name "mfx_vignette"
|
Name "mfx_vignette"
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,14 @@ OptionMenu "MFXOptionsMenu"
|
||||||
{
|
{
|
||||||
Title "MariFX Options"
|
Title "MariFX Options"
|
||||||
StaticText " "
|
StaticText " "
|
||||||
|
StaticText "Luma Sharpen", "Gold"
|
||||||
|
StaticText " "
|
||||||
|
Option "Enable", "mfx_lsharpenable", "YesNo"
|
||||||
|
Slider "Sharpen Radius", "mfx_lsharpradius", 0, 1, 0.01, 2
|
||||||
|
Slider "Sharpen Threshold", "mfx_lsharpclamp", 0, 1, 0.01, 2
|
||||||
|
Slider "Sharpen Strength", "mfx_lsharpblend", 0, 8, 0.1, 1
|
||||||
|
Command "Reset to Default", "event resetmfxvars 9"
|
||||||
|
StaticText " "
|
||||||
StaticText "Film Grain", "Gold"
|
StaticText "Film Grain", "Gold"
|
||||||
StaticText " "
|
StaticText " "
|
||||||
Option "Enable", "mfx_ne", "YesNo"
|
Option "Enable", "mfx_ne", "YesNo"
|
||||||
|
|
|
||||||
18
shaders/glsl/mfx_lumasharp.fp
Normal file
18
shaders/glsl/mfx_lumasharp.fp
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
#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;
|
||||||
|
}
|
||||||
13
zscript.txt
13
zscript.txt
|
|
@ -2,8 +2,11 @@ version "3.3"
|
||||||
|
|
||||||
Class MariFXHandler : StaticEventHandler
|
Class MariFXHandler : StaticEventHandler
|
||||||
{
|
{
|
||||||
|
// luma sharpen
|
||||||
|
transient ui CVar mfx_lsharpenable, mfx_lsharpradius,
|
||||||
|
mfx_lsharpclamp, mfx_lsharpblend,
|
||||||
// noise
|
// noise
|
||||||
transient ui CVar mfx_ne, mfx_ni,
|
mfx_ne, mfx_ni,
|
||||||
// dirt
|
// dirt
|
||||||
mfx_dirtenable, mfx_dirtcfactor, mfx_dirtmc,
|
mfx_dirtenable, mfx_dirtcfactor, mfx_dirtmc,
|
||||||
// grading
|
// grading
|
||||||
|
|
@ -37,6 +40,14 @@ Class MariFXHandler : StaticEventHandler
|
||||||
override void RenderOverlay( RenderEvent e )
|
override void RenderOverlay( RenderEvent e )
|
||||||
{
|
{
|
||||||
PlayerInfo p = players[consoleplayer];
|
PlayerInfo p = players[consoleplayer];
|
||||||
|
if ( !mfx_lsharpenable ) mfx_lsharpenable = CVar.GetCVar('mfx_lsharpenable',p);
|
||||||
|
if ( !mfx_lsharpradius ) mfx_lsharpradius = CVar.GetCVar('mfx_lsharpradius',p);
|
||||||
|
if ( !mfx_lsharpclamp ) mfx_lsharpclamp = CVar.GetCVar('mfx_lsharpclamp',p);
|
||||||
|
if ( !mfx_lsharpblend ) mfx_lsharpblend = CVar.GetCVar('mfx_lsharpblend',p);
|
||||||
|
Shader.SetEnabled(p,"mfx_lumasharp",mfx_lsharpenable.GetBool());
|
||||||
|
Shader.SetUniform1f(p,"mfx_lumasharp","sharpradius",mfx_lsharpradius.GetFloat());
|
||||||
|
Shader.SetUniform1f(p,"mfx_lumasharp","sharpclamp",mfx_lsharpclamp.GetFloat());
|
||||||
|
Shader.SetUniform1f(p,"mfx_lumasharp","sharpblend",mfx_lsharpblend.GetFloat());
|
||||||
if ( !mfx_ne ) mfx_ne = CVar.GetCVar('mfx_ne',p);
|
if ( !mfx_ne ) mfx_ne = CVar.GetCVar('mfx_ne',p);
|
||||||
if ( !mfx_ni ) mfx_ni = CVar.GetCVar('mfx_ni',p);
|
if ( !mfx_ni ) mfx_ni = CVar.GetCVar('mfx_ni',p);
|
||||||
Shader.SetEnabled(p,"mfx_grain",mfx_ne.GetBool());
|
Shader.SetEnabled(p,"mfx_grain",mfx_ne.GetBool());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue