1
Fork 0

MariENB 1.2015.9.16

This commit is contained in:
Marisa the Magician 2019-04-07 17:23:08 +02:00
commit a5a0e876a7
36 changed files with 1666 additions and 1475 deletions

View file

@ -10,7 +10,7 @@
Vorontsov and the major breakage of his ENB project.
Lots of blind debugging are necessary to get the goddamn thing to compile,
and from the looks of it the filter, which works flawlessly on MariEFX, is
and from the looks of it the filter, which worked flawlessly on MariEFX, is
completely unportable to this massive bag of dicks. After DAYS of
selectively commenting out code, the only way it can compile is if the
shader does NOTHING. For ever minor change to the code, five minutes of

View file

@ -34,7 +34,7 @@ float3 hsv2rgb( float3 c )
float3 p = abs(frac(c.x+K.xyz)*6.0-K.w);
return c.z*lerp(K.x,saturate(p-K.x),c.y);
}
/* pre-pass bloom texture preparation, nothing is done */
/* pre-pass bloom texture preparation */
float4 PS_BloomPrePass(VS_OUTPUT_POST In) : COLOR
{
float2 coord = In.txcoord0.xy;
@ -60,7 +60,7 @@ float4 PS_BloomPrePass(VS_OUTPUT_POST In) : COLOR
res.a = 1.0;
return res;
}
/* Thankfully this allows for separate axis blur */
/* Horizontal blur step goes here */
float4 PS_BloomTexture1(VS_OUTPUT_POST In) : COLOR
{
float2 coord = In.txcoord0.xy;
@ -72,6 +72,7 @@ float4 PS_BloomTexture1(VS_OUTPUT_POST In) : COLOR
res.a = 1.0;
return res;
}
/* This is the vertical step */
float4 PS_BloomTexture2(VS_OUTPUT_POST In) : COLOR
{
float2 coord = In.txcoord0.xy;
@ -95,7 +96,21 @@ float4 PS_BloomTexture2(VS_OUTPUT_POST In) : COLOR
res.a = 1.0;
return res;
}
/* Anamorphic bloom */
/*
Horizontal anamorphic bloom step. This is somewhat realistic except that
most lenses (e.g.: glasses, both convex and concave) cause VERTICAL
anamorphic bloom due to their curvature. However since ENB doesn't let me
switch the order of the blurring, it's impossible to do so. I don't really
have a problem with that, this also looks nice.
I've seen that some ENBs do something almost-maybe-possibly-slightly-similar
they call "anamorphic lens flare", which has an ass-backwards-retarded
implementation, which serves to showcase their incompetence. Rather than use
a single-axis massive-scale blur like I do, they simply awkwardly stretch
sampling coordinates along one axis, which doesn't even have the same effect
as it just makes it so bright areas ONLY at the very middle of the screen
produces sharp bright lines extending towards the sides.
*/
float4 PS_AnamPass(VS_OUTPUT_POST In) : COLOR
{
if ( !alfenable ) return float4(0,0,0,1);
@ -121,7 +136,7 @@ float4 PS_AnamPass(VS_OUTPUT_POST In) : COLOR
res.a = 1.0;
return res;
}
/* end pass */
/* end pass, mix it all up */
float4 PS_BloomPostPass(VS_OUTPUT_POST In) : COLOR
{
float2 coord = In.txcoord0.xy;
@ -140,7 +155,7 @@ float4 PS_BloomPostPass(VS_OUTPUT_POST In) : COLOR
res.a = 1.0;
return res;
}
/* crappy lens filter */
/* crappy lens filter, useful when playing characters with glasses */
float4 PS_LensDirtPass(VS_OUTPUT_POST In) : COLOR
{
float4 mud = float4(0,0,0,0);
@ -149,11 +164,6 @@ float4 PS_LensDirtPass(VS_OUTPUT_POST In) : COLOR
float2 ccoord = coord;
if ( dirtaspect ) ccoord.y = (coord.y-0.5)*ScreenSize.w+0.5;
float4 crap = tex2D(SamplerLens,ccoord);
float4 crapb = tex2D(SamplerLensbump,ccoord);
float craps = tex2D(SamplerLensdiff,coord).x;
craps = (1.0-lstarf)+lstarf*craps;
float bump = max(crapb.w+1.0-abs(dot(abs(0.5-coord.xy),crapb.xy)),0.0);
bump = pow(bump,crapb.w*ldirtbumpx);
mud += dirtmix1*tex2D(SamplerBloom1,coord); // P1
mud += dirtmix2*tex2D(SamplerBloom2,coord); // P2
mud += dirtmix3*tex2D(SamplerBloom3,coord); // P3
@ -168,7 +178,7 @@ float4 PS_LensDirtPass(VS_OUTPUT_POST In) : COLOR
float mudmax = luminance(mud.rgb);
float mudn = max(mudmax/(1.0+mudmax),0.0);
mudn = pow(mudn,max(ldirtpow-crap.a,0.0));
mud.rgb *= mudn*ldirtfactor*craps*crap.rgb*bump;
mud.rgb *= mudn*ldirtfactor*crap.rgb;
mud.a = 1.0;
return mud;
}

View file

@ -62,14 +62,6 @@ texture2D texLens
<
string ResourceName = "menblens.png";
>;
texture2D texLensbump
<
string ResourceName = "menblensbump.png";
>;
texture2D texLensdiff
<
string ResourceName = "menblensdiff.png";
>;
sampler2D SamplerBloom1 = sampler_state
{
Texture = <texBloom1>;
@ -178,30 +170,6 @@ sampler2D SamplerLens = sampler_state
MaxMipLevel = 0;
MipMapLodBias = 0;
};
sampler2D SamplerLensbump = sampler_state
{
Texture = <texLensbump>;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = NONE;
AddressU = Clamp;
AddressV = Clamp;
SRGBTexture = FALSE;
MaxMipLevel = 0;
MipMapLodBias = 0;
};
sampler2D SamplerLensdiff = sampler_state
{
Texture = <texLensdiff>;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = NONE;
AddressU = Clamp;
AddressV = Clamp;
SRGBTexture = FALSE;
MaxMipLevel = 0;
MipMapLodBias = 0;
};
/* whatever */
struct VS_OUTPUT_POST
{

View file

@ -4,475 +4,470 @@
Part of MariENB, the personal ENB of Marisa.
Released under the GNU GPLv3 (or later).
*/
/* bloom blur radius */
float bloomradius
<
string UIName = "BloomRadius";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
/* bloom mix factors */
float bloommix1
<
string UIName = "BloomMix1";
string UIWidget = "Spinner";
> = {0.75};
float bloommix2
<
string UIName = "BloomMix2";
string UIWidget = "Spinner";
> = {0.8};
float bloommix3
<
string UIName = "BloomMix3";
string UIWidget = "Spinner";
> = {0.85};
float bloommix4
<
string UIName = "BloomMix4";
string UIWidget = "Spinner";
> = {0.9};
float bloommix7
<
string UIName = "BloomMix7";
string UIWidget = "Spinner";
> = {0.95};
float bloommix8
<
string UIName = "BloomMix8";
string UIWidget = "Spinner";
> = {1.0};
float bloommix5
<
string UIName = "BloomMixNoBlur";
string UIWidget = "Spinner";
> = {0.0};
float bloommix6
<
string UIName = "BloomMixBaseImage";
string UIWidget = "Spinner";
> = {0.0};
string str_bloompre = "Bloom Prepass";
/* bloom intensity */
float bloomintensity_n
<
string UIName = "BloomIntensityNight";
string UIName = "Bloom Intensity Night";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float bloomintensity_d
<
string UIName = "BloomIntensityDay";
string UIName = "Bloom Intensity Day";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float bloomintensity_in
<
string UIName = "BloomIntensityInteriorNight";
string UIName = "Bloom Intensity Interior Night";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float bloomintensity_id
<
string UIName = "BloomIntensityInteriorDay";
string UIName = "Bloom Intensity Interior Day";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
/* bloom power (contrast) */
float bloompower_n
<
string UIName = "BloomPowerNight";
string UIName = "Bloom Contrast Night";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float bloompower_d
<
string UIName = "BloomPowerDay";
string UIName = "Bloom Contrast Day";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float bloompower_in
<
string UIName = "BloomPowerInteriorNight";
string UIName = "Bloom Contrast Interior Night";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float bloompower_id
<
string UIName = "BloomPowerInteriorDay";
string UIName = "Bloom Contrast Interior Day";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
/* bloom saturation */
float bloomsaturation_n
<
string UIName = "BloomSaturationNight";
string UIName = "Bloom Saturation Night";
string UIWidget = "Spinner";
> = {0.75};
float bloomsaturation_d
<
string UIName = "BloomSaturationDay";
string UIName = "Bloom Saturation Day";
string UIWidget = "Spinner";
> = {0.75};
float bloomsaturation_in
<
string UIName = "BloomSaturationInteriorNight";
string UIName = "Bloom Saturation Interior Night";
string UIWidget = "Spinner";
> = {0.75};
float bloomsaturation_id
<
string UIName = "BloomSaturationInteriorDay";
string UIName = "Bloom Saturation Interior Day";
string UIWidget = "Spinner";
> = {0.75};
/* bloom offset (negative values keep dark areas from muddying up) */
float bloombump_n
<
string UIName = "BloomBumpNight";
string UIName = "Bloom Offset Night";
string UIWidget = "Spinner";
> = {-0.5};
float bloombump_d
<
string UIName = "BloomBumpDay";
string UIName = "Bloom Offset Day";
string UIWidget = "Spinner";
> = {-0.5};
float bloombump_in
<
string UIName = "BloomBumpInteriorNight";
string UIName = "Bloom Offset Interior Night";
string UIWidget = "Spinner";
> = {-0.5};
float bloombump_id
<
string UIName = "BloomBumpInteriorDay";
string UIName = "Bloom Offset Interior Day";
string UIWidget = "Spinner";
> = {-0.5};
/* bloom cap (maximum brightness samples can have) */
float bloomcap_n
<
string UIName = "BloomCapNight";
string UIName = "Bloom Intensity Cap Night";
string UIWidget = "Spinner";
> = {20.0};
float bloomcap_d
<
string UIName = "BloomCapDay";
string UIName = "Bloom Intensity Cap Day";
string UIWidget = "Spinner";
> = {20.0};
float bloomcap_in
<
string UIName = "BloomCapInteriorNight";
string UIName = "Bloom Intensity Cap Interior Night";
string UIWidget = "Spinner";
> = {20.0};
float bloomcap_id
<
string UIName = "BloomCapInteriorDay";
string UIName = "Bloom Intensity Cap Interior Day";
string UIWidget = "Spinner";
> = {20.0};
string str_bloomper = "Bloom Per-pass";
/* bloom blur radius */
float bloomradius
<
string UIName = "Bloom Blur Radius";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
/* bloom tint/blueshift parameters */
float blu_n_r
<
string UIName = "BlueShiftColorNightRed";
string UIName = "Blue Shift Night Red";
string UIWidget = "Spinner";
> = {0.2};
float blu_n_g
<
string UIName = "BlueShiftColorNightGreen";
string UIName = "Blue Shift Night Green";
string UIWidget = "Spinner";
> = {0.6};
float blu_n_b
<
string UIName = "BlueShiftColorNightBlue";
string UIName = "Blue Shift Night Blue";
string UIWidget = "Spinner";
> = {1.0};
float blu_d_r
<
string UIName = "BlueShiftColorDayRed";
string UIName = "Blue Shift Day Red";
string UIWidget = "Spinner";
> = {0.2};
float blu_d_g
<
string UIName = "BlueShiftColorDayGreen";
string UIName = "Blue Shift Day Green";
string UIWidget = "Spinner";
> = {0.6};
float blu_d_b
<
string UIName = "BlueShiftColorDayBlue";
string UIName = "Blue Shift Day Blue";
string UIWidget = "Spinner";
> = {1.0};
float blu_in_r
<
string UIName = "BlueShiftColorInteriorNightRed";
string UIName = "Blue Shift Interior Night Red";
string UIWidget = "Spinner";
> = {0.2};
float blu_in_g
<
string UIName = "BlueShiftColorInteriorNightGreen";
string UIName = "Blue Shift Interior Night Green";
string UIWidget = "Spinner";
> = {0.6};
float blu_in_b
<
string UIName = "BlueShiftColorInteriorNightBlue";
string UIName = "Blue Shift Interior Night Blue";
string UIWidget = "Spinner";
> = {1.0};
float blu_id_r
<
string UIName = "BlueShiftColorInteriorDayRed";
string UIName = "Blue Shift Interior Day Red";
string UIWidget = "Spinner";
> = {0.2};
float blu_id_g
<
string UIName = "BlueShiftColorInteriorDayGreen";
string UIName = "Blue Shift Interior Day Green";
string UIWidget = "Spinner";
> = {0.6};
float blu_id_b
<
string UIName = "BlueShiftColorInteriorDayBlue";
string UIName = "Blue Shift Interior Day Blue";
string UIWidget = "Spinner";
> = {1.0};
float bsi_n
<
string UIName = "BlueShiftIntensityNight";
string UIName = "Blue Shift Intensity Night";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {0.5};
float bsi_d
<
string UIName = "BlueShiftIntensityDay";
string UIName = "Blue Shift Intensity Day";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {0.5};
float bsi_in
<
string UIName = "BlueShiftIntensityInteriorNight";
string UIName = "Blue Shift Intensity Interior Night";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {0.5};
float bsi_id
<
string UIName = "BlueShiftIntensityInteriorDay";
string UIName = "Blue Shift Intensity Interior Day";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {0.5};
float bslp
<
string UIName = "BlueShiftLuminanceFactorPass";
string UIName = "Blue Shift Luminance Factor Per-pass";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {0.22};
float bsbp
<
string UIName = "BlueShiftColorFactorPass";
string UIName = "Blue Shift Color Factor Per-pass";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {0.33};
/* anamorphic bloom (very intensive) */
string str_bloomalf = "Anamorphic Bloom";
bool alfenable
<
string UIName = "EnableAnamorphicBloom";
string UIName = "Enable Anamorphic Bloom";
string UIWidget = "Checkbox";
> = {true};
float fbl_n
<
string UIName = "AnamBlendNight";
string UIName = "Anamorphic Bloom Blend Night";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {0.75};
float fbl_d
<
string UIName = "AnamBlendDay";
string UIName = "Anamorphic Bloom Blend Day";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {0.75};
float fbl_in
<
string UIName = "AnamBlendInteriorNight";
string UIName = "Anamorphic Bloom Blend Interior Night";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {0.75};
float fbl_id
<
string UIName = "AnamBlendInteriorDay";
string UIName = "Anamorphic Bloom Blend Interior Day";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {0.75};
float flu_n_r
<
string UIName = "AnamBlueShiftColorNightRed";
string UIName = "Anamorphic Bloom Blue Shift Night Red";
string UIWidget = "Spinner";
> = {0.4};
float flu_n_g
<
string UIName = "AnamBlueShiftColorNightGreen";
string UIName = "Anamorphic Bloom Blue Shift Night Green";
string UIWidget = "Spinner";
> = {0.1};
float flu_n_b
<
string UIName = "AnamBlueShiftColorNightBlue";
string UIName = "Anamorphic Bloom Blue Shift Night Blue";
string UIWidget = "Spinner";
> = {1.0};
float flu_d_r
<
string UIName = "AnamBlueShiftColorDayRed";
string UIName = "Anamorphic Bloom Blue Shift Day Red";
string UIWidget = "Spinner";
> = {0.5};
float flu_d_g
<
string UIName = "AnamBlueShiftColorDayGreen";
string UIName = "Anamorphic Bloom Blue Shift Day Green";
string UIWidget = "Spinner";
> = {0.1};
float flu_d_b
<
string UIName = "AnamBlueShiftColorDayBlue";
string UIName = "Anamorphic Bloom Blue Shift Day Blue";
string UIWidget = "Spinner";
> = {1.0};
float flu_in_r
<
string UIName = "AnamBlueShiftColorInteriorNightRed";
string UIName = "Anamorphic Bloom Blue Shift Interior Night Red";
string UIWidget = "Spinner";
> = {0.5};
float flu_in_g
<
string UIName = "AnamBlueShiftColorInteriorNightGreen";
string UIName = "Anamorphic Bloom Blue Shift Interior Night Green";
string UIWidget = "Spinner";
> = {0.1};
float flu_in_b
<
string UIName = "AnamBlueShiftColorInteriorNightBlue";
string UIName = "Anamorphic Bloom Blue Shift Interior Night Blue";
string UIWidget = "Spinner";
> = {1.0};
float flu_id_r
<
string UIName = "AnamBlueShiftColorInteriorDayRed";
string UIName = "Anamorphic Bloom Blue Shift Interior Day Red";
string UIWidget = "Spinner";
> = {0.5};
float flu_id_g
<
string UIName = "AnamBlueShiftColorInteriorDayGreen";
string UIName = "Anamorphic Bloom Blue Shift Interior Day Green";
string UIWidget = "Spinner";
> = {0.1};
float flu_id_b
<
string UIName = "AnamBlueShiftColorInteriorDayBlue";
string UIName = "Anamorphic Bloom Blue Shift Interior Day Blue";
string UIWidget = "Spinner";
> = {1.0};
float fsi_n
<
string UIName = "AnamBlueShiftIntensityNight";
string UIName = "Anamorphic Bloom Blue Shift Intensity Night";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float fsi_d
<
string UIName = "AnamBlueShiftIntensityDay";
string UIName = "Anamorphic Bloom Blue Shift Intensity Day";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float fsi_in
<
string UIName = "AnamBlueShiftIntensityInteriorNight";
string UIName = "Anamorphic Bloom Blue Shift Interior Night";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float fsi_id
<
string UIName = "AnamBlueShiftIntensityInteriorDay";
string UIName = "Anamorphic Bloom Blue Shift Interior Day";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float fpw_n
<
string UIName = "AnamPowerNight";
string UIName = "Anamorphic Bloom Contrast Night";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float fpw_d
<
string UIName = "AnamPowerDay";
string UIName = "Anamorphic Bloom Contrast Day";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float fpw_in
<
string UIName = "AnamPowerInteriorNight";
string UIName = "Anamorphic Bloom Contrast Interior Night";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float fpw_id
<
string UIName = "AnamPowerInteriorDay";
string UIName = "Anamorphic Bloom Contrast Interior Day";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float flen
<
string UIName = "AnamLengthMultiplier";
string UIName = "Anamorphic Bloom Radius Multiplier";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {4.0};
string str_bloompost = "Bloom Post-pass";
/* bloom mix factors */
float bloommix1
<
string UIName = "Bloom Pass 1 Blend";
string UIWidget = "Spinner";
> = {0.75};
float bloommix2
<
string UIName = "Bloom Pass 2 Blend";
string UIWidget = "Spinner";
> = {0.8};
float bloommix3
<
string UIName = "Bloom Pass 3 Blend";
string UIWidget = "Spinner";
> = {0.85};
float bloommix4
<
string UIName = "Bloom Pass 4 Blend";
string UIWidget = "Spinner";
> = {0.9};
float bloommix7
<
string UIName = "Bloom Pass 7 Blend";
string UIWidget = "Spinner";
> = {0.95};
float bloommix8
<
string UIName = "Bloom Pass 8 Blend";
string UIWidget = "Spinner";
> = {1.0};
float bloommix5
<
string UIName = "Bloom Prepass Blend";
string UIWidget = "Spinner";
> = {0.0};
float bloommix6
<
string UIName = "Bloom Base Blend";
string UIWidget = "Spinner";
> = {0.0};
string str_bloomdirt = "Lens Dirt";
bool dirtenable
<
string UIName = "EnableLensDirt";
string UIName = "Enable Lens Dirt";
string UIWidget = "Checkbox";
> = {false};
float dirtmix1
<
string UIName = "DirtMix1";
string UIName = "Dirt Pass 1 Blend";
string UIWidget = "Spinner";
> = {0.0};
float dirtmix2
<
string UIName = "DirtMix2";
string UIName = "Dirt Pass 2 Blend";
string UIWidget = "Spinner";
> = {0.1};
float dirtmix3
<
string UIName = "DirtMix3";
string UIName = "Dirt Pass 3 Blend";
string UIWidget = "Spinner";
> = {1.2};
float dirtmix4
<
string UIName = "DirtMix4";
string UIName = "Dirt Pass 4 Blend";
string UIWidget = "Spinner";
> = {0.5};
float dirtmix7
<
string UIName = "DirtMix7";
string UIName = "Dirt Pass 7 Blend";
string UIWidget = "Spinner";
> = {1.0};
float dirtmix8
<
string UIName = "DirtMix8";
string UIName = "Dirt Pass 8 Blend";
string UIWidget = "Spinner";
> = {3.0};
float dirtmix5
<
string UIName = "DirtMixNoBlur";
string UIName = "Dirt Prepass Blend";
string UIWidget = "Spinner";
> = {0.0};
float dirtmix6
<
string UIName = "DirtMixBaseImage";
string UIName = "Dirt Base Blend";
string UIWidget = "Spinner";
> = {0.0};
bool dirtaspect
<
string UIName = "DirtPreserveAspect";
string UIName = "Dirt Texture Preserve Aspect";
string UIWidget = "Checkbox";
> = {true};
float lstarf
<
string UIName = "DirtDiffraction";
string UIWidget = "Spinner";
> = {0.25};
float ldirtbumpx
<
string UIName = "DirtBumpPower";
string UIWidget = "Spinner";
> = {1.25};
float ldirtpow
<
string UIName = "DirtPower";
string UIName = "Dirt Contrast";
string UIWidget = "Spinner";
> = {1.25};
float ldirtfactor
<
string UIName = "DirtFactor";
string UIName = "Dirt Factor";
string UIWidget = "Spinner";
> = {1.5};
> = {1.5};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Before After
Before After

BIN
enbseries/menbdots.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

@ -93,7 +93,7 @@ float3 hsv2rgb( float3 c )
float3 p = abs(frac(c.x+K.xyz)*6.0-K.w);
return c.z*lerp(K.x,saturate(p-K.x),c.y);
}
/* adaptation */
/* "eye adaptation" */
float3 Adaptation( float3 res )
{
float4 adapt = tex2D(_s4,0.5);
@ -121,7 +121,7 @@ float3 Tonemap( float3 res )
float3 uwhite = Uch(W);
return ucol/uwhite;
}
/* overbright compensation pre-pass */
/* overbright compensation pre-pass, kinda pointless now that I have tonemap */
float3 Compensate( float3 res )
{
float comppow = lerp(lerp(comppow_n,comppow_d,tod),lerp(comppow_in,
@ -135,7 +135,7 @@ float3 Compensate( float3 res )
ovr = ovr*compsat+ovrs*(1.0-compsat);
return res-ovr*compfactor;
}
/* color grading */
/* colour grading passes */
float3 GradingRGB( float3 res )
{
float grademul_r = lerp(lerp(grademul_r_n,grademul_r_d,tod),
@ -197,7 +197,7 @@ float3 GradingGame( float3 res )
{
/*
Skyrim method is slightly different, but it depends explicitly on
vanilla eye adaption which is ass.
vanilla eye adaptation which is ass.
*/
float3 tgray = luminance(res);
float3 tcol = res*_r3.x + tgray*(1.0-_r3.x);
@ -229,7 +229,7 @@ float3 GradingLUT( float3 res )
lutblend_id,tod),ind);
return lerp(res,tcol,lutblend);
}
/* classic ENB palette colour grading */
/* classic ENB palette colour grading, seems to kill dark and light values */
float3 GradingPal( float3 res )
{
float4 adapt = tex2D(_s4,0.5);
@ -246,7 +246,7 @@ float3 GradingPal( float3 res )
palt.b = tex2D(_s7,coord).b;
return lerp(res,palt,palblend);
}
/* post-pass dithering */
/* post-pass dithering, something apparently only my ENB does */
float3 Dither( float3 res, float2 coord )
{
float2 rcoord = coord*float2(ScreenSize.x,ScreenSize.x*ScreenSize.w);
@ -274,6 +274,13 @@ float3 FilmGrain( float3 res, float2 coord )
float2 s3 = tcs+float2(ts,ts);
float n1, n2, n3;
float2 nr = float2(ScreenSize.x,ScreenSize.x*ScreenSize.w)/256.0;
/*
There are two methods of making noise here:
1. two-pass algorithm that produces a particular fuzz complete with a
soft horizontal tear, reminiscent of old TV static.
2. simple version that has very noticeable tiling and visible scrolling
at low speeds
*/
if ( np )
{
n1 = tex2D(SamplerNoise2,s1*nm11*nr).r;

View file

@ -5,33 +5,34 @@
Released under the GNU GPLv3 (or later).
*/
/* film grain */
string str_noise = "Film Grain";
bool ne
<
string UIName = "UseGrain";
string UIName = "Enable Grain";
string UIWidget = "Checkbox";
> = {false};
/* speed of grain */
float nf
<
string UIName = "GrainFrequency";
string UIName = "Grain Speed";
string UIWidget = "Spinner";
> = {2500.0};
/* intensity of grain */
float ni
<
string UIName = "GrainIntensity";
string UIName = "Grain Intensity";
string UIWidget = "Spinner";
> = {0.05};
/* saturation of grain */
float ns
<
string UIName = "GrainSaturation";
string UIName = "Grain Saturation";
string UIWidget = "Spinner";
> = {0.0};
/* use two-pass grain (double the texture fetches, but looks less uniform) */
bool np
<
string UIName = "GrainTwoPass";
string UIName = "Grain Two-Pass";
string UIWidget = "Checkbox";
> = {true};
/*
@ -43,7 +44,7 @@ bool np
*/
int nb
<
string UIName = "GrainBlend";
string UIName = "Grain Blending Mode";
string UIWidget = "Spinner";
int UIMin = 0;
int UIMax = 3;
@ -51,755 +52,764 @@ int nb
/* dark mask blend mode contrast for mask image */
float bnp
<
string UIName = "GrainDarkMaskPower";
string UIName = "Grain Dark Mask Contrast";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {2.5};
/* two-pass distortion factor (0 = look just like one-pass grain) */
float nk
<
string UIName = "GrainTwoPassFactor";
string UIName = "Grain Two-Pass Factor";
string UIWidget = "Spinner";
> = {0.04};
/* zoom factors for each component of each noise texture */
float nm1
<
string UIName = "GrainMagnification1";
string UIName = "Grain Magnification 1";
string UIWidget = "Spinner";
> = {13.25};
float nm2
<
string UIName = "GrainMagnification2";
string UIName = "Grain Magnification 2";
string UIWidget = "Spinner";
> = {19.64};
float nm3
<
string UIName = "GrainMagnification3";
string UIName = "Grain Magnification 3";
string UIWidget = "Spinner";
> = {17.35};
float nm11
<
string UIName = "GrainPass1Magnification1";
string UIName = "Grain Pass 1 Magnification 1";
string UIWidget = "Spinner";
> = {2.05};
float nm12
<
string UIName = "GrainPass1Magnification2";
string UIName = "Grain Pass 1 Magnification 2";
string UIWidget = "Spinner";
> = {3.11};
float nm13
<
string UIName = "GrainPass1Magnification3";
string UIName = "Grain Pass 1 Magnification 3";
string UIWidget = "Spinner";
> = {2.22};
float nm21
<
string UIName = "GrainPass2Magnification1";
string UIName = "Grain Pass 2 Magnification 1";
string UIWidget = "Spinner";
> = {4.25};
float nm22
<
string UIName = "GrainPass2Magnification2";
string UIName = "Grain Pass 2 Magnification 2";
string UIWidget = "Spinner";
> = {0.42};
float nm23
<
string UIName = "GrainPass2Magnification3";
string UIName = "Grain Pass 2 Magnification 3";
string UIWidget = "Spinner";
> = {6.29};
/* contrast of grain */
float nj
<
string UIName = "GrainPower";
string UIName = "Grain Contrast";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {2.0};
/* "adaptation" factors */
string str_adaptation = "Eye Adaptation";
bool aenable
<
string UIName = "UseAdaptation";
string UIName = "Enable Adaptation";
string UIWidget = "Checkbox";
> = {false};
float amin_n
<
string UIName = "AdaptationMinNight";
string UIName = "Adaptation Min Night";
string UIWidget = "Spinner";
> = {0.0};
float amin_d
<
string UIName = "AdaptationMinDay";
string UIName = "Adaptation Min Day";
string UIWidget = "Spinner";
> = {0.0};
float amin_in
<
string UIName = "AdaptationMinInteriorNight";
string UIName = "Adaptation Min Interior Night";
string UIWidget = "Spinner";
> = {0.0};
float amin_id
<
string UIName = "AdaptationMinInteriorDay";
string UIName = "Adaptation Min Interior Day";
string UIWidget = "Spinner";
> = {0.0};
float amax_n
<
string UIName = "AdaptationMaxNight";
string UIName = "Adaptation Max Night";
string UIWidget = "Spinner";
> = {1.0};
float amax_d
<
string UIName = "AdaptationMaxDay";
string UIName = "Adaptation Max Day";
string UIWidget = "Spinner";
> = {1.0};
float amax_in
<
string UIName = "AdaptationMaxInteriorNight";
string UIName = "Adaptation Max Interior Night";
string UIWidget = "Spinner";
> = {1.0};
float amax_id
<
string UIName = "AdaptationMaxInteriorDay";
string UIName = "Adaptation Max Interior Day";
string UIWidget = "Spinner";
> = {1.0};
/* tone mapping */
string str_tonemap = "Filmic Tone Mapping";
bool tmapenable
<
string UIName = "UseTonemapping";
string UIName = "Enable Tonemapping";
string UIWidget = "Checkbox";
> = {false};
float unA_n
<
string UIName = "TonemapHighlightStrengthNight";
string UIName = "Tonemap Shoulder Strength Night";
string UIWidget = "Spinner";
> = {0.5};
float unA_d
<
string UIName = "TonemapHighlightStrengthDay";
string UIName = "Tonemap Shoulder Strength Day";
string UIWidget = "Spinner";
> = {0.5};
float unA_in
<
string UIName = "TonemapHighlightStrengthInteriorNight";
string UIName = "Tonemap Shoulder Strength Interior Night";
string UIWidget = "Spinner";
> = {0.5};
float unA_id
<
string UIName = "TonemapHighlightStrengthInteriorDay";
string UIName = "Tonemap Shoulder Strength Interior Day";
string UIWidget = "Spinner";
> = {0.5};
float unB_n
<
string UIName = "TonemapHighlightGammaNight";
string UIName = "Tonemap Linear Strength Night";
string UIWidget = "Spinner";
> = {1.0};
float unB_d
<
string UIName = "TonemapHighlightGammaDay";
string UIName = "Tonemap Linear Strength Day";
string UIWidget = "Spinner";
> = {1.0};
float unB_in
<
string UIName = "TonemapHighlightGammaInteriorNight";
string UIName = "Tonemap Linear Strength Interior Night";
string UIWidget = "Spinner";
> = {1.0};
float unB_id
<
string UIName = "TonemapHighlightGammaInteriorDay";
string UIName = "Tonemap Linear Strength Interior Day";
string UIWidget = "Spinner";
> = {1.0};
float unC_n
<
string UIName = "TonemapMidtoneStrengthNight";
string UIName = "Tonemap Linear Angle Night";
string UIWidget = "Spinner";
> = {0.2};
float unC_d
<
string UIName = "TonemapMidtoneStrengthDay";
string UIName = "Tonemap Linear Angle Day";
string UIWidget = "Spinner";
> = {0.2};
float unC_in
<
string UIName = "TonemapMidtoneStrengthInteriorNight";
string UIName = "Tonemap Linear Angle Interior Night";
string UIWidget = "Spinner";
> = {0.2};
float unC_id
<
string UIName = "TonemapMidtoneStrengthInteriorDay";
string UIName = "Tonemap Linear Angle Interior Day";
string UIWidget = "Spinner";
> = {0.2};
float unD_n
<
string UIName = "TonemapMidtoneGammaNight";
string UIName = "Tonemap Toe Strength Night";
string UIWidget = "Spinner";
> = {0.75};
float unD_d
<
string UIName = "TonemapMidtoneGammaDay";
string UIName = "Tonemap Toe Strength Day";
string UIWidget = "Spinner";
> = {0.75};
float unD_in
<
string UIName = "TonemapMidtoneGammaInteriorNight";
string UIName = "Tonemap Toe Strength Interior Night";
string UIWidget = "Spinner";
> = {0.75};
float unD_id
<
string UIName = "TonemapMidtoneGammaInteriorDay";
string UIName = "Tonemap Toe Strength Interior Day";
string UIWidget = "Spinner";
> = {0.75};
float unE_n
<
string UIName = "TonemapShadowStrengthNight";
string UIName = "Tonemap Toe Numerator Night";
string UIWidget = "Spinner";
> = {0.02};
float unE_d
<
string UIName = "TonemapShadowStrengthDay";
string UIName = "Tonemap Toe Numerator Day";
string UIWidget = "Spinner";
> = {0.02};
float unE_in
<
string UIName = "TonemapShadowStrengthInteriorNight";
string UIName = "Tonemap Toe Numerator Interior Night";
string UIWidget = "Spinner";
> = {0.02};
float unE_id
<
string UIName = "TonemapShadowStrengthInteriorDay";
string UIName = "Tonemap Toe Numerator Interior Day";
string UIWidget = "Spinner";
> = {0.02};
float unF_n
<
string UIName = "TonemapShadowGammaNight";
string UIName = "Tonemap Toe Denominator Night";
string UIWidget = "Spinner";
> = {0.30};
float unF_d
<
string UIName = "TonemapShadowGammaDay";
string UIName = "Tonemap Toe Denominator Day";
string UIWidget = "Spinner";
> = {0.30};
float unF_in
<
string UIName = "TonemapShadowGammaInteriorNight";
string UIName = "Tonemap Toe Denominator Interior Night";
string UIWidget = "Spinner";
> = {0.30};
float unF_id
<
string UIName = "TonemapShadowGammaInteriorDay";
string UIName = "Tonemap Toe Denominator Interior Day";
string UIWidget = "Spinner";
> = {0.30};
float unW_n
<
string UIName = "TonemapWhiteNight";
string UIName = "Tonemap Linear White Night";
string UIWidget = "Spinner";
> = {10.0};
float unW_d
<
string UIName = "TonemapWhiteDay";
string UIName = "Tonemap Linear White Day";
string UIWidget = "Spinner";
> = {10.0};
float unW_in
<
string UIName = "TonemapWhiteInteriorNight";
string UIName = "Tonemap Linear White Interior Night";
string UIWidget = "Spinner";
> = {10.0};
float unW_id
<
string UIName = "TonemapWhiteInteriorDay";
string UIName = "Tonemap Linear White Interior Day";
string UIWidget = "Spinner";
> = {10.0};
bool tmapbeforecomp
<
string UIName = "TonemapBeforeCompensate";
string UIName = "Tonemap Before Compensate";
string UIWidget = "Checkbox";
> = {false};
/* overshine/bloom compensation */
string str_comp = "Overbright Compensation";
bool compenable
<
string UIName = "UseCompensate";
string UIName = "Enable Compensate";
string UIWidget = "Checkbox";
> = {false};
/* compensation factor */
float compfactor_n
<
string UIName = "CompensateFactorNight";
string UIName = "Compensate Factor Night";
string UIWidget = "Spinner";
> = {0.0};
float compfactor_d
<
string UIName = "CompensateFactorDay";
string UIName = "Compensate Factor Day";
string UIWidget = "Spinner";
> = {0.0};
float compfactor_in
<
string UIName = "CompensateFactorInteriorNight";
string UIName = "Compensate Factor Interior Night";
string UIWidget = "Spinner";
> = {0.0};
float compfactor_id
<
string UIName = "CompensateFactorInteriorDay";
string UIName = "Compensate Factor Interior Day";
string UIWidget = "Spinner";
> = {0.0};
/* compensation power (contrast) */
float comppow_n
<
string UIName = "CompensatePowerNight";
string UIName = "Compensate Contrast Night";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float comppow_d
<
string UIName = "CompensatePowerDay";
string UIName = "Compensate Contrast Day";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float comppow_in
<
string UIName = "CompensatePowerInteriorNight";
string UIName = "Compensate Contrast Interior Night";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float comppow_id
<
string UIName = "CompensatePowerInteriorDay";
string UIName = "Compensate Contrast Interior Day";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
/* compensation saturation (higher values desaturate highlights) */
float compsat_n
<
string UIName = "CompensateSaturationNight";
string UIName = "Compensate Saturation Night";
string UIWidget = "Spinner";
> = {1.0};
float compsat_d
<
string UIName = "CompensateSaturationDay";
string UIName = "Compensate Saturation Day";
string UIWidget = "Spinner";
> = {1.0};
float compsat_in
<
string UIName = "CompensateSaturationInteriorNight";
string UIName = "Compensate Saturation Interior Night";
string UIWidget = "Spinner";
> = {1.0};
float compsat_id
<
string UIName = "CompensateSaturationInteriorDay";
string UIName = "Compensate Saturation Interior Day";
string UIWidget = "Spinner";
> = {1.0};
/* Color grading */
string str_grade = "Color Grading Suite";
bool gradeenable1
<
string UIName = "UseRGBGrading";
string UIName = "Enable RGB Grading";
string UIWidget = "Checkbox";
> = {false};
/* color component multipliers */
float grademul_r_n
<
string UIName = "GradingMulRNight";
string UIName = "Grading Intensity Night Red";
string UIWidget = "Spinner";
> = {1.0};
float grademul_g_n
<
string UIName = "GradingMulGNight";
string UIName = "Grading Intensity Night Green";
string UIWidget = "Spinner";
> = {1.0};
float grademul_b_n
<
string UIName = "GradingMulBNight";
string UIName = "Grading Intensity Night Blue";
string UIWidget = "Spinner";
> = {1.0};
float grademul_r_d
<
string UIName = "GradingMulRDay";
string UIName = "Grading Intensity Day Red";
string UIWidget = "Spinner";
> = {1.0};
float grademul_g_d
<
string UIName = "GradingMulGDay";
string UIName = "Grading Intensity Day Green";
string UIWidget = "Spinner";
> = {1.0};
float grademul_b_d
<
string UIName = "GradingMulBDay";
string UIName = "Grading Intensity Day Blue";
string UIWidget = "Spinner";
> = {1.0};
float grademul_r_in
<
string UIName = "GradingMulRInteriorNight";
string UIName = "Grading Intensity Interior Night Red";
string UIWidget = "Spinner";
> = {1.0};
float grademul_g_in
<
string UIName = "GradingMulGInteriorNight";
string UIName = "Grading Intensity Interior Night Green";
string UIWidget = "Spinner";
> = {1.0};
float grademul_b_in
<
string UIName = "GradingMulBInteriorNight";
string UIName = "Grading Intensity Interior Night Blue";
string UIWidget = "Spinner";
> = {1.0};
float grademul_r_id
<
string UIName = "GradingMulRInteriorDay";
string UIName = "Grading Intensity Interior Day Red";
string UIWidget = "Spinner";
> = {1.0};
float grademul_g_id
<
string UIName = "GradingMulGInteriorDay";
string UIName = "Grading Intensity Interior Day Green";
string UIWidget = "Spinner";
> = {1.0};
float grademul_b_id
<
string UIName = "GradingMulBInteriorDay";
string UIName = "Grading Intensity Interior Day Blue";
string UIWidget = "Spinner";
> = {1.0};
/* color component contrasts */
float gradepow_r_n
<
string UIName = "GradingPowRNight";
string UIName = "Grading Contrast Night Red";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float gradepow_g_n
<
string UIName = "GradingPowGNight";
string UIName = "Grading Contrast Night Green";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float gradepow_b_n
<
string UIName = "GradingPowBNight";
string UIName = "Grading Contrast Night Blue";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float gradepow_r_d
<
string UIName = "GradingPowRDay";
string UIName = "Grading Contrast Day Red";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float gradepow_g_d
<
string UIName = "GradingPowGDay";
string UIName = "Grading Contrast Day Green";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float gradepow_b_d
<
string UIName = "GradingPowBDay";
string UIName = "Grading Contrast Day Blue";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float gradepow_r_in
<
string UIName = "GradingPowRInteriorNight";
string UIName = "Grading Contrast Interior Night Red";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float gradepow_g_in
<
string UIName = "GradingPowGInteriorNight";
string UIName = "Grading Contrast Interior Night Green";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float gradepow_b_in
<
string UIName = "GradingPowBInteriorNight";
string UIName = "Grading Contrast Interior Night Blue";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float gradepow_r_id
<
string UIName = "GradingPowRInteriorDay";
string UIName = "Grading Contrast Interior Day Red";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float gradepow_g_id
<
string UIName = "GradingPowGInteriorDay";
string UIName = "Grading Contrast Interior Day Green";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float gradepow_b_id
<
string UIName = "GradingPowBInteriorDay";
string UIName = "Grading Contrast Interior Day Blue";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
/* colorization factors */
bool gradeenable2
<
string UIName = "UseColorizeGrading";
string UIName = "Enable Vibrance Grading";
string UIWidget = "Checkbox";
> = {false};
float gradecol_r_n
<
string UIName = "GradingColRNight";
string UIName = "Grading Color Night Red";
string UIWidget = "Spinner";
> = {1.0};
float gradecol_g_n
<
string UIName = "GradingColGNight";
string UIName = "Grading Color Night Green";
string UIWidget = "Spinner";
> = {1.0};
float gradecol_b_n
<
string UIName = "GradingColBNight";
string UIName = "Grading Color Night Blue";
string UIWidget = "Spinner";
> = {1.0};
float gradecol_r_d
<
string UIName = "GradingColRDay";
string UIName = "Grading Color Day Red";
string UIWidget = "Spinner";
> = {1.0};
float gradecol_g_d
<
string UIName = "GradingColGDay";
string UIName = "Grading Color Day Green";
string UIWidget = "Spinner";
> = {1.0};
float gradecol_b_d
<
string UIName = "GradingColBDay";
string UIName = "Grading Color Day Blue";
string UIWidget = "Spinner";
> = {1.0};
float gradecol_r_in
<
string UIName = "GradingColRInteriorNight";
string UIName = "Grading Color Interior Night Red";
string UIWidget = "Spinner";
> = {1.0};
float gradecol_g_in
<
string UIName = "GradingColGInteriorNight";
string UIName = "Grading Color Interior Night Green";
string UIWidget = "Spinner";
> = {1.0};
float gradecol_b_in
<
string UIName = "GradingColBInteriorNight";
string UIName = "Grading Color Interior Night Blue";
string UIWidget = "Spinner";
> = {1.0};
float gradecol_r_id
<
string UIName = "GradingColRInteriorDay";
string UIName = "Grading Color Interior Day Red";
string UIWidget = "Spinner";
> = {1.0};
float gradecol_g_id
<
string UIName = "GradingColGInteriorDay";
string UIName = "Grading Color Interior Day Green";
string UIWidget = "Spinner";
> = {1.0};
float gradecol_b_id
<
string UIName = "GradingColBInteriorDay";
string UIName = "Grading Color Interior Day Blue";
string UIWidget = "Spinner";
> = {1.0};
/* blend factor for colorization (negative values are quite fancy) */
float gradecolfact_n
<
string UIName = "GradingColFactorNight";
string UIName = "Grading Color Factor Night";
string UIWidget = "Spinner";
> = {0.0};
float gradecolfact_d
<
string UIName = "GradingColFactorDay";
string UIName = "Grading Color Factor Day";
string UIWidget = "Spinner";
> = {0.0};
float gradecolfact_in
<
string UIName = "GradingColFactorInteriorNight";
string UIName = "Grading Color Factor Interior Night";
string UIWidget = "Spinner";
> = {0.0};
float gradecolfact_id
<
string UIName = "GradingColFactorInteriorDay";
string UIName = "Grading Color Factor Interior Day";
string UIWidget = "Spinner";
> = {0.0};
/* HSV grading */
bool gradeenable3
<
string UIName = "UseHSVGrading";
string UIName = "Enable HSV Grading";
string UIWidget = "Checkbox";
> = {false};
/* saturation multiplier */
float gradesatmul_n
<
string UIName = "GradingSatMulNight";
string UIName = "Grading Saturation Intensity Night";
string UIWidget = "Spinner";
> = {1.0};
float gradesatmul_d
<
string UIName = "GradingSatMulDay";
string UIName = "Grading Saturation Intensity Day";
string UIWidget = "Spinner";
> = {1.0};
float gradesatmul_in
<
string UIName = "GradingSatMulInteriorNight";
string UIName = "Grading Saturation Intensity Interior Night";
string UIWidget = "Spinner";
> = {1.0};
float gradesatmul_id
<
string UIName = "GradingSatMulInteriorDay";
string UIName = "Grading Saturation Intensity Interior Day";
string UIWidget = "Spinner";
> = {1.0};
/* saturation power */
float gradesatpow_n
<
string UIName = "GradingSatPowNight";
string UIName = "Grading Saturation Contrast Night";
string UIWidget = "Spinner";
> = {1.0};
float gradesatpow_d
<
string UIName = "GradingSatPowDay";
string UIName = "Grading Saturation Contrast Day";
string UIWidget = "Spinner";
> = {1.0};
float gradesatpow_in
<
string UIName = "GradingSatPowInteriorNight";
string UIName = "Grading Saturation Contrast Interior Night";
string UIWidget = "Spinner";
> = {1.0};
float gradesatpow_id
<
string UIName = "GradingSatPowInteriorDay";
string UIName = "Grading Saturation Contrast Interior Day";
string UIWidget = "Spinner";
> = {1.0};
/* value multiplier */
float gradevalmul_n
<
string UIName = "GradingValMulNight";
string UIName = "Grading Value Intensity Night";
string UIWidget = "Spinner";
> = {1.0};
float gradevalmul_d
<
string UIName = "GradingValMulDay";
string UIName = "Grading Value Intensity Day";
string UIWidget = "Spinner";
> = {1.0};
float gradevalmul_in
<
string UIName = "GradingValMulInteriorNight";
string UIName = "Grading Value Intensity Interior Night";
string UIWidget = "Spinner";
> = {1.0};
float gradevalmul_id
<
string UIName = "GradingValMulInteriorDay";
string UIName = "Grading Value Intensity Interior Day";
string UIWidget = "Spinner";
> = {1.0};
/* value power */
float gradevalpow_n
<
string UIName = "GradingValPowNight";
string UIName = "Grading Value Contrast Night";
string UIWidget = "Spinner";
> = {1.0};
float gradevalpow_d
<
string UIName = "GradingValPowDay";
string UIName = "Grading Value Contrast Day";
string UIWidget = "Spinner";
> = {1.0};
float gradevalpow_in
<
string UIName = "GradingValPowInteriorNight";
string UIName = "Grading Value Contrast Interior Night";
string UIWidget = "Spinner";
> = {1.0};
float gradevalpow_id
<
string UIName = "GradingValPowInteriorDay";
string UIName = "Grading Value Contrast Interior Day";
string UIWidget = "Spinner";
> = {1.0};
bool colorizeafterhsv
<
string UIName = "ColorizeAfterHSV";
string UIName = "Colorize After HSV";
string UIWidget = "Checkbox";
> = {true};
/* game tinting support */
string str_vanilla = "Vanilla Imagespace Tint/Grading/Fade";
bool tintenable
<
string UIName = "UseTint";
string UIName = "Enable Vanilla Tint";
string UIWidget = "Checkbox";
> = {true};
float tintblend
<
string UIName = "TintingBlend";
string UIName = "Vanilla Tint Blend";
string UIWidget = "Spinner";
float UIMin = 0.0;
float UIMax = 1.0;
> = {1.0};
bool tintbeforegrade
<
string UIName = "TintingBeforeGrading";
string UIName = "Use Tinting Before Grading";
string UIWidget = "Checkbox";
> = {false};
/* vanilla grading */
bool vgradeenable
<
string UIName = "EnableVanillaGrading";
string UIName = "Enable Vanilla Grading";
string UIWidget = "Checkbox";
> = {true};
float vgradeblend
<
string UIName = "VanillaGradingBlend";
string UIName = "Vanilla Grading Blend";
string UIWidget = "Spinner";
float UIMin = 0.0;
float UIMax = 1.0;
> = {1.0};
bool fadebeforefilm
<
string UIName = "Fade Before Film Filters";
string UIWidget = "Checkbox";
> = {false};
/* LUT grading */
string str_lut = "RGB Lookup Table Grading";
bool lutenable
<
string UIName = "EnableLUTGrading";
string UIName = "Enable LUT Grading";
string UIWidget = "Checkbox";
> = {false};
float lutblend_n
<
string UIName = "LUTBlendNight";
string UIName = "LUT Blend Night";
string UIWidget = "Spinner";
> = {1.0};
float lutblend_d
<
string UIName = "LUTBlendDay";
string UIName = "LUT Blend Day";
string UIWidget = "Spinner";
> = {1.0};
float lutblend_in
<
string UIName = "LUTBlendInteriorNight";
string UIName = "LUT Blend Interior Night";
string UIWidget = "Spinner";
> = {1.0};
float lutblend_id
<
string UIName = "LUTBlendInteriorDay";
string UIName = "LUT Blend Interior Day";
string UIWidget = "Spinner";
> = {1.0};
int clut
<
string UIName = "LUTPreset";
string UIName = "LUT Preset";
string UIWidget = "Spinner";
int UIMin = 0;
int UIMax = 63;
> = {1};
/* not using ENB's own variables, sorry */
string str_enbpal = "ENB Palette";
bool palenable
<
string UIName = "EnableENBPalette";
string UIName = "Enable ENB Palette";
string UIWidget = "Checkbox";
> = {false};
float palblend
<
string UIName = "PaletteBlend";
string UIName = "Palette Blend";
string UIWidget = "Spinner";
> = {1.0};
bool fadebeforefilm
<
string UIName = "FadeBeforeFilmFilters";
string UIWidget = "Checkbox";
> = {false};
string str_dither = "Dithering";
bool dodither
<
string UIName = "EnablePostDither";
string UIName = "Enable Post Dither";
string UIWidget = "Checkbox";
> = {true};
int dither
<
string UIName = "DitherPattern";
string UIName = "Dither Pattern";
string UIWidget = "Spinner";
int UIMin = 0;
int UIMax = 4;
> = {4};
string str_debug = "Debugging";
bool bloomdebug
<
string UIName = "DebugBloom";
string UIName = "Display Bloom";
string UIWidget = "Checkbox";
> = {false};

View file

@ -51,6 +51,14 @@ float4 ReducePrepass( in float4 col, in float2 coord )
col = saturate(col);
return col;
}
/*
CGA had seven graphic modes (320x200 modes have low/high contrast versions):
- 640x200 monochrome, which doesn't really need a palette here, as it can
be done procedurally with minimum effort.
- 320x200 black/cyan/magenta/white
- 320x200 black/green/red/brown
- 320x200 black/cyan/red/white
*/
float4 ReduceCGA( in float4 color, in float2 coord )
{
float4 dac = ReducePrepass(color,coord);
@ -123,6 +131,12 @@ float4 ReduceCGA( in float4 color, in float2 coord )
}
return color;
}
/*
EGA technically only had the 320x200 16-colour graphic mode, but when VGA
came out, it was possible to tweak the DAC, allowing for custom palettes.
AOS EGA is a palette based on my terminal colour scheme on Linux, which I
also use for AliceOS.
*/
float4 ReduceEGA( in float4 color, in float2 coord )
{
float4 dac = ReducePrepass(color,coord);
@ -150,24 +164,32 @@ float4 ReduceEGA( in float4 color, in float2 coord )
}
return color;
}
/* A two bits per channel mode that can usually fit VGA mode 13h and mode x */
float4 ReduceRGB2( in float4 color, in float2 coord )
{
float4 dac = ReducePrepass(color,coord);
color.rgb = trunc(dac.rgb*4.0)/4.0;
return color;
}
/* Effectively has 256 colours, with a magenta tint due to precision loss */
float4 ReduceRGB323( in float4 color, in float2 coord )
{
float4 dac = ReducePrepass(color,coord);
color.rgb = trunc(dac.rgb*float3(8.0,4.0,8.0))/float3(8.0,4.0,8.0);
return color;
}
/* 4096 colours, no actual graphics hardware existed that used 4bpc, though */
float4 ReduceRGB4( in float4 color, in float2 coord )
{
float4 dac = ReducePrepass(color,coord);
color.rgb = trunc(dac.rgb*16.0)/16.0;
return color;
}
/*
The classic 16-bit colour mode everyone from my generation would remember,
especially that subtle green tint and the banding due to lack of dithering
in most games and GPUs at that time.
*/
float4 ReduceRGB565( in float4 color, in float2 coord )
{
float4 dac = ReducePrepass(color,coord);
@ -175,12 +197,26 @@ float4 ReduceRGB565( in float4 color, in float2 coord )
/float3(32.0,64.0,32.0);
return color;
}
/*
If you see no difference when using this, then it could be because your
own screen is already 6bpc. This is the case for a lot of LCDs, both old
and modern. 8bpc tends to be the norm on IPS, though. 10bpc is the next
step, but for now it's only used internally in video codecs for more
efficient compression with lower quality loss. I seem to recall that in
most *nix systems such as Linux it's possible to have 10bpc already with
NVIDIA, but it causes compatibility issues with a lot of programs.
*/
float4 ReduceRGB6( in float4 color, in float2 coord )
{
float4 dac = ReducePrepass(color,coord);
color.rgb = trunc(dac.rgb*64.0)/64.0;
return color;
}
/* TODO this will use Doom's 256-colour palette, just for the heck of it */
float4 ReduceRGBDoom( in float4 color, in float2 coord )
{
return color;
}
/* Retro rockets */
float4 PS_Retro( VS_OUTPUT_POST IN, float2 vPos : VPOS ) : COLOR
{
@ -229,6 +265,14 @@ float4 PS_ASCII( VS_OUTPUT_POST IN, float2 vPos : VPOS ) : COLOR
float2 fresl = float2(FONT_WIDTH,FONT_HEIGHT);
float2 cresl = float2(GLYPH_WIDTH,GLYPH_HEIGHT);
float2 bscl = floor(bresl/cresl);
/*
Here I use the "cheap" method, based on the overall luminance of each
glyph, rather than attempt to search for the best fitting glyph for
each cell. If you want to know why, take a look at the ASCII filter
bundled with the Dolphin emulator, and be prepared for the resulting
seconds per frame it runs at. The calculations needed for such a filter
are completely insane even for the highest-end GPUs.
*/
float3 col = tex2D(SamplerColor,floor(bscl*coord)/bscl).rgb;
int lum = luminance(col)*FONT_LEVELS;
float2 itx = floor(coord*bresl);
@ -254,6 +298,81 @@ float4 PS_ChromaKey( VS_OUTPUT_POST IN, float2 vPos : VPOS ) : COLOR
return float4(maskr,maskg,maskb,1.0);
return res;
}
/* 2x2 RGBI dot matrix, not even close to anything that exists IRL but meh */
float4 PS_DotMatrix( VS_OUTPUT_POST IN, float2 vPos : VPOS ) : COLOR
{
float2 coord = IN.txcoord.xy;
float4 res = tex2D(SamplerColor,coord);
if ( !dotenable ) return res;
float2 bresl = float2(ScreenSize.x,ScreenSize.x*ScreenSize.w);
bresl.xy *= 1.0/(dotsize*2.0);
float4 dac = float4(res.r*0.5,res.g*0.5,res.b*0.5,(res.r+res.g+res.b)/6.0);
/*
There are two types of CRTs: aperture grille and shadow mask.
The former is blurry and has scanlines (rather big ones, even), but is
cheap to emulate; while the latter is the one most known for its crisp,
square pixels with minimal distortion. Most individuals into this whole
"retro graphics" stuff prefer aperture grille, which looks like shit,
then again, that's the sort of visual quality they want. The main issue
with shadow mask CRTs is that it's impossible to accurately emulate them
unless done on a screen with a HUGE resolution. After all, the subpixels
need to be clearly visible, and if on top of it you add curvature
distortion, you need to reduce moire patterns that will inevitably show
up at low resolutions.
It would be more desirable to eventually have flat panels that can
display arbitrary resolutions using a form of scaling that preserves
square pixels with unnoticeable distortion (typically, with nearest
neighbour you'd get some pixels that are bigger/smaller than others if
the upscale resolution isn't an integer multiple of the real resolution.
This 2x2 RGBI thing is a rather naïve filter I made many years ago, it
looks unlike any real CRT, but scales well. Its only problem is moire
patterns when using the default size of 2x2.
*/
float4 dots = tex2D(SamplerDots,coord*bresl)*dac;
float3 tcol = pow((dots.rgb+dots.a),dotpow)*dotmult;
res.rgb = res.rgb*(1-dotblend)+tcol*dotblend;
return res;
}
/* that's right, CRT curvature */
float4 PS_Curvature( VS_OUTPUT_POST IN, float2 vPos : VPOS ) : COLOR
{
float2 coord = IN.txcoord.xy;
float4 res = tex2D(SamplerColor,coord);
if ( !curveenable ) return res;
float2 bresl = float2(ScreenSize.x,ScreenSize.x*ScreenSize.w);
float2 bof = (1.0/bresl)*curvesoft;
float3 eta = float3(1+chromaab*0.009,1+chromaab*0.006,1+chromaab*0.003);
float2 center = float2(coord.x-0.5,coord.y-0.5);
float zfact = 100.0/lenszoom;
float r2 = center.x*center.x+center.y*center.y;
float f = 1+r2*lensdist*0.01;
float x = f*zfact*center.x+0.5;
float y = f*zfact*center.y+0.5;
float2 rcoord = (f*eta.r)*zfact*(center.xy*0.5)+0.5;
float2 gcoord = (f*eta.g)*zfact*(center.xy*0.5)+0.5;
float2 bcoord = (f*eta.b)*zfact*(center.xy*0.5)+0.5;
int i,j;
float4 idist = float4(0,0,0,0);
/*
sticking a 5x5 gaussian blur with a tweakable radius in here to attempt
to reduce moire patterns in some cases. Supersampling would be more
useful for that, but ENB sucks ass through a crazy straw in that aspect,
so it would be more desirable to use GeDoSaTo (I sure hope I can port
all my stuff to it one day, at least the damn thing is FOSS).
*/
[unroll] for ( i=-2; i<=2; i++ ) [unroll] for ( j=-2; j<=2; j++ )
{
idist += gauss3[abs(i)]*gauss3[abs(j)]
*float4(tex2D(SamplerColorb,rcoord+bof*float2(i,j)).r,
tex2D(SamplerColorb,gcoord+bof*float2(i,j)).g,
tex2D(SamplerColorb,bcoord+bof*float2(i,j)).b,
tex2D(SamplerColorb,float2(x,y)+bof*float2(i,j)).a);
}
res.rgb = idist.rgb;
return res;
}
technique PostProcess
{
pass p0
@ -305,3 +424,37 @@ technique PostProcess3
SRGBWRITEENABLE = FALSE;
}
}
technique PostProcess4
{
pass p0
{
VertexShader = compile vs_3_0 VS_Pass();
PixelShader = compile ps_3_0 PS_DotMatrix();
DitherEnable = FALSE;
ZEnable = FALSE;
CullMode = NONE;
ALPHATESTENABLE = FALSE;
SEPARATEALPHABLENDENABLE = FALSE;
AlphaBlendEnable = FALSE;
StencilEnable = FALSE;
FogEnable = FALSE;
SRGBWRITEENABLE = FALSE;
}
}
technique PostProcess5
{
pass p0
{
VertexShader = compile vs_3_0 VS_Pass();
PixelShader = compile ps_3_0 PS_Curvature();
DitherEnable = FALSE;
ZEnable = FALSE;
CullMode = NONE;
ALPHATESTENABLE = FALSE;
SEPARATEALPHABLENDENABLE = FALSE;
AlphaBlendEnable = FALSE;
StencilEnable = FALSE;
FogEnable = FALSE;
SRGBWRITEENABLE = FALSE;
}
}

View file

@ -144,6 +144,11 @@ static const float3 aosega[16] =
#define GLYPH_WIDTH 8
#define GLYPH_HEIGHT 16
#define FONT_LEVELS 255
/* gauss stuff */
float gauss3[3] =
{
0.444814, 0.239936, 0.037657
};
/* standard stuff */
float4 ScreenSize;
float ENightDayFactor;
@ -155,7 +160,23 @@ texture2D texFont
<
string ResourceName = "menbvgaluma.png";
>;
texture2D texDots
<
string ResourceName = "menbdots.png";
>;
sampler2D SamplerColor = sampler_state
{
Texture = <texColor>;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = NONE;
AddressU = Clamp;
AddressV = Clamp;
SRGBTexture = FALSE;
MaxMipLevel = 0;
MipMapLodBias = 0;
};
sampler2D SamplerColorb = sampler_state
{
Texture = <texColor>;
MinFilter = LINEAR;
@ -173,8 +194,8 @@ sampler2D SamplerDepth = sampler_state
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = NONE;
AddressU = Border;
AddressV = Border;
AddressU = Clamp;
AddressV = Clamp;
SRGBTexture = FALSE;
MaxMipLevel = 0;
MipMapLodBias = 0;
@ -191,6 +212,18 @@ sampler2D SamplerFont = sampler_state
MaxMipLevel = 0;
MipMapLodBias = 0;
};
sampler2D SamplerDots = sampler_state
{
Texture = <texDots>;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = NONE;
AddressU = Wrap;
AddressV = Wrap;
SRGBTexture = FALSE;
MaxMipLevel = 0;
MipMapLodBias = 0;
};
/* whatever */
struct VS_OUTPUT_POST
{

View file

@ -5,9 +5,10 @@
Released under the GNU GPLv3 (or later).
*/
/* BlockGFX filter, I'm proud of it */
string str_block = "BlockGFX Suite";
bool useblock
<
string UIName = "UseBlockGFX";
string UIName = "Enable Block GFX";
string UIWidget = "Checkbox";
> = {false};
/*
@ -18,26 +19,26 @@ bool useblock
*/
float bresx
<
string UIName = "EmulatedResX";
string UIName = "Emulated Resolution Width";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {0.5};
float bresy
<
string UIName = "EmulatedResY";
string UIName = "Emulated Resolution Height";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {0.5};
/* zooming factors (<=0 for stretch) */
float sresx
<
string UIName = "ZoomedResX";
string UIName = "Zoom Factor X";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {0.0};
float sresy
<
string UIName = "ZoomedResY";
string UIName = "Zoom Factor Y";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {0.0};
@ -54,7 +55,7 @@ float sresy
*/
int paltype
<
string UIName = "PaletteType";
string UIName = "Palette Type";
string UIWidget = "Spinner";
int UIMin = -1;
int UIMax = 6;
@ -71,7 +72,7 @@ int paltype
*/
int cgapal
<
string UIName = "CGAPalette";
string UIName = "CGA Palette";
string UIWidget = "Spinner";
int UIMin = 0;
int UIMax = 6;
@ -83,7 +84,7 @@ int cgapal
*/
int egapal
<
string UIName = "EGAPalette";
string UIName = "EGA Palette";
string UIWidget = "Spinner";
int UIMin = 0;
int UIMax = 1;
@ -99,7 +100,7 @@ int egapal
*/
int dither
<
string UIName = "DitherMode";
string UIName = "Dithering Pattern";
string UIWidget = "Spinner";
int UIMin = -1;
int UIMax = 4;
@ -107,77 +108,137 @@ int dither
/* gamma modifier for base color, lower values raise midtones and viceversa */
float bgamma
<
string UIName = "GammaMod";
string UIName = "Contrast Modifier";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {0.35};
/* saturation modifier for base color, helps with limited palettes */
float bsaturation
<
string UIName = "Saturation Modifier";
string UIWidget = "Spinner";
> = {1.1};
/* base brightness bump for the dither grid */
float bdbump
<
string UIName = "DitherBump";
string UIName = "Dither Offset";
string UIWidget = "Spinner";
> = {-0.1};
/* range multiplier for the dither grid */
float bdmult
<
string UIName = "DitherMultiplier";
string UIName = "Dither Range";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {0.25};
/* saturation modifier for base color, helps with limited palettes */
float bsaturation
<
string UIName = "SaturationMod";
string UIWidget = "Spinner";
> = {1.1};
/* ASCII art filter */
string str_ascii = "Luma ASCII Art Filter";
bool asciienable
<
string UIName = "EnableASCII";
string UIName = "Enable ASCII";
string UIWidget = "Checkbox";
> = {false};
bool asciimono
<
string UIName = "ASCIIMonochrome";
string UIName = "ASCII Monochrome";
string UIWidget = "Checkbox";
> = {true};
float asciiblend
<
string UIName = "ASCIIBlend";
string UIName = "ASCII Blend";
string UIWidget = "Spinner";
float UIMin = 0.0;
float UIMax = 1.0;
> = {0.0};
string str_mask = "Depth Chroma Key";
bool maskenable
<
string UIName = "EnableChromaKey";
string UIName = "Enable Chroma Key";
string UIWidget = "Checkbox";
> = {false};
float maskr
<
string UIName = "ChromaKeyRed";
string UIName = "Chroma Key Red";
string UIWidget = "Spinner";
float UIMin = 0.0;
float UIMax = 1.0;
> = {0.0};
float maskg
<
string UIName = "ChromaKeyGreen";
string UIName = "Chroma Key Green";
string UIWidget = "Spinner";
float UIMin = 0.0;
float UIMax = 1.0;
> = {1.0};
float maskb
<
string UIName = "ChromaKeyBlue";
string UIName = "Chroma Key Blue";
string UIWidget = "Spinner";
float UIMin = 0.0;
float UIMax = 1.0;
> = {0.0};
float maskd
<
string UIName = "ChromaKeyDepth";
string UIName = "Chroma Key Depth";
string UIWidget = "Spinner";
float UIMin = 0.0;
float UIMax = 1.0;
> = {0.5};
> = {0.5};
string str_dot = "RGBI Dot Matrix";
bool dotenable
<
string UIName = "Enable Dot Matrix";
string UIWidget = "Checkbox";
> = {false};
int dotsize
<
string UIName = "Dot Size";
string UIWidget = "Spinner";
int UIMin = 1;
> = {1};
float dotblend
<
string UIName = "Dot Blend";
string UIWidget = "Spinner";
float UIMin = 0.0;
float UIMax = 1.0;
> = {0.4};
float dotmult
<
string UIName = "Dot Intensity";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float dotpow
<
string UIName = "Dot Contrast";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
string str_curve = "Lens Curvature";
bool curveenable
<
string UIName = "Enable Curvature";
string UIWidget = "Checkbox";
> = {false};
float chromaab
<
string UIName = "Curve Chromatic Aberration";
string UIWidget = "Spinner";
> = {0.0};
float lenszoom
<
string UIName = "Curve Zooming";
string UIWidget = "Spinner";
> = {50.0};
float lensdist
<
string UIName = "Curve Distortion";
string UIWidget = "Spinner";
> = {0.0};
float curvesoft
<
string UIName = "Curve Sampling Soften";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {0.0};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 MiB

After

Width:  |  Height:  |  Size: 2.2 MiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 MiB

After

Width:  |  Height:  |  Size: 2.3 MiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 483 KiB

After

Width:  |  Height:  |  Size: 470 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 KiB

After

Width:  |  Height:  |  Size: 230 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 108 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 KiB

After

Width:  |  Height:  |  Size: 192 KiB

Before After
Before After

View file

@ -21,6 +21,11 @@ VS_OUTPUT_POST VS_Pass( VS_INPUT_POST IN )
/* these are znear/zfar values for Skyrim, but MAY match Fallout too */
float depthlinear( float2 coord )
{
/*
These values seem to be used by pretty much all Skyrim ENB presets.
Since it's practically impossible for me to know the real znear and
zfar values for each game, I'll just use these and hope it all goes well
*/
float zNear = 0.0509804;
float zFar = 3098.0392;
float z = tex2D(SamplerDepth,coord).x;
@ -60,12 +65,11 @@ float3 Edge( float3 res, float2 coord )
cont += depthlinear(coord+float2(0,-1)*bof);
cont += depthlinear(coord+float2(1,-1)*bof);
cont += depthlinear(coord+float2(-1,0)*bof);
cont += depthlinear(coord+float2(0,0)*bof);
cont += depthlinear(coord+float2(1,0)*bof);
cont += depthlinear(coord+float2(-1,1)*bof);
cont += depthlinear(coord+float2(0,1)*bof);
cont += depthlinear(coord+float2(1,1)*bof);
cont /= 9.0;
cont /= 8.0;
float mud = 0.0;
if ( abs(cont-dep) > (edgethreshold*0.00001) ) mud = 1.0;
float fade = 1.0-tex2D(SamplerDepth,coord).x;
@ -87,12 +91,11 @@ float3 EdgeColor( float3 res, float2 coord )
ccol += tex2D(SamplerColor,coord+float2(0,-1)*bof).rgb;
ccol += tex2D(SamplerColor,coord+float2(1,-1)*bof).rgb;
ccol += tex2D(SamplerColor,coord+float2(-1,0)*bof).rgb;
ccol += tex2D(SamplerColor,coord+float2(0,0)*bof).rgb;
ccol += tex2D(SamplerColor,coord+float2(1,0)*bof).rgb;
ccol += tex2D(SamplerColor,coord+float2(-1,1)*bof).rgb;
ccol += tex2D(SamplerColor,coord+float2(0,1)*bof).rgb;
ccol += tex2D(SamplerColor,coord+float2(1,1)*bof).rgb;
ccol /= 9.0;
ccol /= 8.0;
float clum = luminance(ccol);
float mud = abs(clum-lum);
mud = saturate(pow(mud,celpow)*celmult);
@ -157,7 +160,10 @@ float4 PS_FirstPass( VS_OUTPUT_POST IN, float2 vPos : VPOS ) : COLOR
if ( edgevenable ) res.rgb = EdgeView(res.rgb,coord);
return res;
}
/* Crappy SSAO */
/*
Thank you Boris for not providing access to a normal buffer. Guesswork using
the depth buffer results in imprecise normals that aren't smoothed.
*/
float3 pseudonormal( float dep, float2 coord )
{
float2 bresl = float2(ScreenSize.x,ScreenSize.x*ScreenSize.w);
@ -171,6 +177,7 @@ float3 pseudonormal( float dep, float2 coord )
normal.z = -normal.z;
return normalize(normal);
}
/* get occlusion using single-pass single-step Ray Marching with 64 samples */
float4 PS_SSAOPrepass( VS_OUTPUT_POST IN, float2 vPos : VPOS ) : COLOR
{
float2 coord = IN.txcoord.xy;
@ -219,6 +226,7 @@ float4 PS_SSAOPrepass( VS_OUTPUT_POST IN, float2 vPos : VPOS ) : COLOR
res.a = saturate(1.0-(uocc*ssaoblend));
return res;
}
/* the blur passes use bilateral filtering to mostly preserve borders */
float4 PS_SSAOBlurH( VS_OUTPUT_POST IN, float2 vPos : VPOS ) : COLOR
{
float2 coord = IN.txcoord.xy;
@ -283,6 +291,7 @@ float4 PS_ReadFocus( VS_OUTPUT_POST IN ) : COLOR
float2 fcenter = float2(focuscenter_x,focuscenter_y);
float cfocus = min(tex2D(SamplerDepth,fcenter).x,focusmax*0.001);
if ( !focuscircle ) return cfocus;
/* using polygons inscribed into a circle, in this case a triangle */
float focusradius = lerp(lerp(focusradius_n,focusradius_d,tod),
lerp(focusradius_in,focusradius_id,tod),ind);
float focusmix = lerp(lerp(focusmix_n,focusmix_d,tod),lerp(focusmix_in,
@ -358,7 +367,10 @@ float4 PS_DoFPrepass( VS_OUTPUT_POST IN, float2 vPos : VPOS ) : COLOR
Change power of dof based on field of view. Works only in Skyrim,
Boris is just such a fucking assbutt that he doesn't update the
FO3/FNV version to be feature-equal to this, inventing pathetic
excuses.
excuses. The FieldOfView variable seems to hold bogus values in Fallout
completely unrelated to actual FOV (yes, I checked if it's in radians,
and no, it isn't). The value appears to be 1.134452. I'll try to
investigate its origins someday.
*/
if ( dofrelfov )
{
@ -379,6 +391,12 @@ float4 PS_DoFPrepass( VS_OUTPUT_POST IN, float2 vPos : VPOS ) : COLOR
res.a = dfc;
return res;
}
/*
This method skips blurring areas that are perfectly in focus. The
performance gain is negligible in most cases, though. It also provides the
option to use or NOT use bilateral filtering. Which I'll probably remove
soon because no bilateral filtering is pointless.
*/
float4 PS_DoFBlurH( VS_OUTPUT_POST IN, float2 vPos : VPOS) : COLOR
{
float2 coord = IN.txcoord.xy;
@ -463,7 +481,10 @@ float4 PS_DoFBlurV( VS_OUTPUT_POST IN, float2 vPos : VPOS) : COLOR
res.a = 1.0;
return res;
}
/* Underwater distortion */
/*
Underwater distortion, which currently has no real use due to Boris being
lazy. fWaterLevel doesn't yet provide any usable values.
*/
float2 UnderwaterDistort( float2 coord )
{
float2 ofs = float2(0.0,0.0);
@ -473,7 +494,11 @@ float2 UnderwaterDistort( float2 coord )
ofs -= (coord-0.5)*2.0*uwz;
return coord+ofs*0.01;
}
/* Distant hot air refraction */
/*
Distant hot air refraction. Not very realistic, but does the job. Currently
it isn't fully depth-aware, so you'll see that close objects get distorted
around their borders.
*/
float2 DistantHeat( float2 coord )
{
float2 bresl;

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before After
Before After