Cleanup, added palette filter.
BIN
Logo.png
|
Before Width: | Height: | Size: 2.7 MiB After Width: | Height: | Size: 343 KiB |
BIN
Logo_Small.png
|
Before Width: | Height: | Size: 795 KiB After Width: | Height: | Size: 116 KiB |
|
|
@ -10,3 +10,4 @@ Included:
|
||||||
- Vignette.
|
- Vignette.
|
||||||
- Color Matrix.
|
- Color Matrix.
|
||||||
- Hue-Saturation.
|
- Hue-Saturation.
|
||||||
|
- Palette reduction+dither from RetroFX (has doom, heretic, hexen and strife palettes).
|
||||||
|
|
|
||||||
|
|
@ -77,3 +77,7 @@ user float mfx_vigcolor_b = -1.0;
|
||||||
user float mfx_vigpow = 1.0;
|
user float mfx_vigpow = 1.0;
|
||||||
user float mfx_vigmul = 1.0;
|
user float mfx_vigmul = 1.0;
|
||||||
user float mfx_vigbump = 0.0;
|
user float mfx_vigbump = 0.0;
|
||||||
|
|
||||||
|
user bool mfx_palenable = false;
|
||||||
|
user int mfx_palnum = 1;
|
||||||
|
user float mfx_paldither = 0.02;
|
||||||
|
|
|
||||||
|
|
@ -106,3 +106,12 @@ HardwareShader postprocess scene
|
||||||
Uniform float vigmul
|
Uniform float vigmul
|
||||||
Uniform float vigbump
|
Uniform float vigbump
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HardwareShader postprocess scene
|
||||||
|
{
|
||||||
|
Name "mfx_palette"
|
||||||
|
Shader "shaders/glsl/mfx_palette.fp" 330
|
||||||
|
Texture PalLUTTexture "textures/mfxpal.png"
|
||||||
|
Uniform float paldither
|
||||||
|
Uniform int palnum
|
||||||
|
}
|
||||||
|
|
|
||||||
27
menudef.txt
|
|
@ -4,6 +4,26 @@ AddOptionMenu "OptionsMenu"
|
||||||
SubMenu "MariFX Options", "MFXOptionsMenu"
|
SubMenu "MariFX Options", "MFXOptionsMenu"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OptionValue "MFXPalette"
|
||||||
|
{
|
||||||
|
0, "Standard VGA"
|
||||||
|
1, "Doom"
|
||||||
|
2, "Heretic"
|
||||||
|
3, "Hexen"
|
||||||
|
4, "Strife"
|
||||||
|
5, "Hacx"
|
||||||
|
6, "Wolf3D"
|
||||||
|
7, "Rise of the Triad"
|
||||||
|
8, "Duke Nukem 3D"
|
||||||
|
9, "Blood"
|
||||||
|
10, "Shadow Warrior"
|
||||||
|
11, "Quake"
|
||||||
|
12, "Hexen 2"
|
||||||
|
13, "Quake 2"
|
||||||
|
14, "Amulets & Armor"
|
||||||
|
15, "Project .Blank"
|
||||||
|
}
|
||||||
|
|
||||||
OptionMenu "MFXOptionsMenu"
|
OptionMenu "MFXOptionsMenu"
|
||||||
{
|
{
|
||||||
Title "MariFX Options"
|
Title "MariFX Options"
|
||||||
|
|
@ -114,4 +134,11 @@ OptionMenu "MFXOptionsMenu"
|
||||||
Slider "Vignette Intensity", "mfx_vigmul", 0, 2, 0.01, 2
|
Slider "Vignette Intensity", "mfx_vigmul", 0, 2, 0.01, 2
|
||||||
Slider "Vignette Offset", "mfx_vigbump", -1, 1, 0.01, 2
|
Slider "Vignette Offset", "mfx_vigbump", -1, 1, 0.01, 2
|
||||||
Command "Reset to Default", "event resetmfxvars 7"
|
Command "Reset to Default", "event resetmfxvars 7"
|
||||||
|
StaticText " "
|
||||||
|
StaticText "Palette", "Gold"
|
||||||
|
StaticText " "
|
||||||
|
Option "Enable", "mfx_palenable", "YesNo"
|
||||||
|
Option "Palette", "mfx_palnum", "MFXPalette"
|
||||||
|
Slider "Dithering", "mfx_paldither", 0, 1, 0.01, 2
|
||||||
|
Command "Reset to Default", "event resetmfxvars 8"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
25
shaders/glsl/mfx_palette.fp
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
#define d(x) x/64.0
|
||||||
|
float dither8[64] =
|
||||||
|
{
|
||||||
|
d( 0),d(48),d(12),d(60),d( 3),d(51),d(15),d(63),
|
||||||
|
d(32),d(16),d(44),d(28),d(35),d(19),d(47),d(31),
|
||||||
|
d( 8),d(56),d( 4),d(52),d(11),d(59),d( 7),d(55),
|
||||||
|
d(40),d(24),d(36),d(20),d(43),d(27),d(39),d(23),
|
||||||
|
d( 2),d(50),d(14),d(62),d( 1),d(49),d(13),d(61),
|
||||||
|
d(34),d(18),d(46),d(30),d(33),d(17),d(45),d(29),
|
||||||
|
d(10),d(58),d( 6),d(54),d( 9),d(57),d( 5),d(53),
|
||||||
|
d(42),d(26),d(38),d(22),d(41),d(25),d(37),d(21)
|
||||||
|
};
|
||||||
|
#undef d
|
||||||
|
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;
|
||||||
|
vec3 lc = clamp(floor(res.rgb*64),0,63);
|
||||||
|
ivec2 lcoord = ivec2(lc.r,lc.g+lc.b*64);
|
||||||
|
lcoord.x += 64*palnum;
|
||||||
|
res.rgb = texelFetch(PalLUTTexture,lcoord,0).rgb;
|
||||||
|
FragColor = res;
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 107 KiB |
BIN
textures/mfxpal.png
Normal file
|
After Width: | Height: | Size: 827 KiB |
18
zscript.txt
|
|
@ -30,7 +30,9 @@ Class MariFXHandler : StaticEventHandler
|
||||||
mfx_hshue_y, mfx_hssat_y, mfx_hsval_y, mfx_hshue_g,
|
mfx_hshue_y, mfx_hssat_y, mfx_hsval_y, mfx_hshue_g,
|
||||||
mfx_hssat_g, mfx_hsval_g, mfx_hshue_c, mfx_hssat_c,
|
mfx_hssat_g, mfx_hsval_g, mfx_hshue_c, mfx_hssat_c,
|
||||||
mfx_hsval_c, mfx_hshue_b, mfx_hssat_b, mfx_hsval_b,
|
mfx_hsval_c, mfx_hshue_b, mfx_hssat_b, mfx_hsval_b,
|
||||||
mfx_hshue_m, mfx_hssat_m, mfx_hsval_m;
|
mfx_hshue_m, mfx_hssat_m, mfx_hsval_m,
|
||||||
|
// palette
|
||||||
|
mfx_palenable, mfx_palnum, mfx_paldither;
|
||||||
|
|
||||||
override void RenderOverlay( RenderEvent e )
|
override void RenderOverlay( RenderEvent e )
|
||||||
{
|
{
|
||||||
|
|
@ -166,6 +168,12 @@ Class MariFXHandler : StaticEventHandler
|
||||||
Shader.SetUniform1f(p,"mfx_vignette","vigpow",mfx_vigpow.GetFloat());
|
Shader.SetUniform1f(p,"mfx_vignette","vigpow",mfx_vigpow.GetFloat());
|
||||||
Shader.SetUniform1f(p,"mfx_vignette","vigmul",mfx_vigmul.GetFloat());
|
Shader.SetUniform1f(p,"mfx_vignette","vigmul",mfx_vigmul.GetFloat());
|
||||||
Shader.SetUniform1f(p,"mfx_vignette","vigbump",mfx_vigbump.GetFloat());
|
Shader.SetUniform1f(p,"mfx_vignette","vigbump",mfx_vigbump.GetFloat());
|
||||||
|
if ( !mfx_palenable ) mfx_palenable = CVar.GetCVar('mfx_palenable',p);
|
||||||
|
if ( !mfx_palnum ) mfx_palnum = CVar.GetCVar('mfx_palnum',p);
|
||||||
|
if ( !mfx_paldither ) mfx_paldither = CVar.GetCVar('mfx_paldither',p);
|
||||||
|
Shader.SetEnabled(p,"mfx_palette",mfx_palenable.GetBool());
|
||||||
|
Shader.SetUniform1i(p,"mfx_palette","palnum",mfx_palnum.GetInt());
|
||||||
|
Shader.SetUniform1f(p,"mfx_palette","paldither",mfx_paldither.GetFloat());
|
||||||
}
|
}
|
||||||
override void ConsoleProcess( ConsoleEvent e )
|
override void ConsoleProcess( ConsoleEvent e )
|
||||||
{
|
{
|
||||||
|
|
@ -334,6 +342,14 @@ Class MariFXHandler : StaticEventHandler
|
||||||
mfx_vigmul.ResetToDefault();
|
mfx_vigmul.ResetToDefault();
|
||||||
mfx_vigbump.ResetToDefault();
|
mfx_vigbump.ResetToDefault();
|
||||||
break;
|
break;
|
||||||
|
case 8:
|
||||||
|
if ( !mfx_palenable ) mfx_palenable = CVar.GetCVar('mfx_palenable',p);
|
||||||
|
if ( !mfx_palnum ) mfx_palnum = CVar.GetCVar('mfx_palnum',p);
|
||||||
|
if ( !mfx_paldither ) mfx_paldither = CVar.GetCVar('mfx_paldither',p);
|
||||||
|
mfx_palenable.ResetToDefault();
|
||||||
|
mfx_palnum.ResetToDefault();
|
||||||
|
mfx_paldither.ResetToDefault();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||