1
Fork 0

MariENB 1.2015.6.15

This commit is contained in:
Marisa the Magician 2019-04-07 17:18:29 +02:00
commit c08f0701db
21 changed files with 867 additions and 111 deletions

View file

@ -210,6 +210,10 @@ float3 GradingLUT( float3 res )
/*
gross hacks were needed to "fix" the way direct3d interpolates on
sampling, and to manually interpolate on the blue channel
this could be alleviated if I could have all the LUTs as 64 separate
volume maps, but PS 3.0 has a limit of 16 samplers and I think ENB
can't load volume maps anyway.
*/
float3 tcol = clamp(res,0.0,1.0)*0.875+0.0625;
float2 lc1 = float2(tcol.r/16.0+floor(tcol.b*16.0)/16.0,tcol.g/64.0
@ -223,21 +227,22 @@ float3 GradingLUT( float3 res )
tcol = (tcol-0.0625)/0.875;
return lerp(res,tcol,lutblend);
}
/* display debug register */
float debugreg( float r, float2 coord, int p )
/* classic ENB palette colour grading */
float3 GradingPal( float3 res )
{
if ( r == 0.0 ) return 0.0;
if ( (coord.x < p*0.05) || (coord.x > (p+1)*0.05-0.01) ) return 0.0;
float posy = (coord.y-0.5)*2.0*regdebugscale;
if ( r < 0.0 )
{
if ( posy > 0.0 ) return 0.0;
if ( posy < r ) return 0.0;
return 1.0;
}
if ( posy < 0.0 ) return 0.0;
if ( posy > r ) return 0.0;
return 1.0;
float4 adapt = tex2D(_s4,0.5);
adapt = adapt/(adapt+1.0);
float adapts = max(adapt.r,max(adapt.g,adapt.b));
float3 palt;
float2 coord;
coord.y = adapts;
coord.x = res.r;
palt.r = tex2D(_s7,coord).r;
coord.x = res.g;
palt.g = tex2D(_s7,coord).g;
coord.x = res.b;
palt.b = tex2D(_s7,coord).b;
return lerp(res,palt,palblend);
}
/* post-pass dithering */
float3 Dither( float3 res, float2 coord )
@ -344,35 +349,13 @@ float4 PS_Mari( VS_OUTPUT_POST IN, float2 vPos : VPOS ) : COLOR
if ( gradeenable3 ) res.rgb = GradingHSV(res.rgb);
}
if ( lutenable ) res.rgb = GradingLUT(res.rgb);
if ( palenable ) res.rgb = GradingPal(res.rgb);
if ( !tintbeforegrade && tintenable ) res.rgb = Tint(res.rgb);
if ( fadebeforefilm ) res.rgb = _r5.rgb*_r5.a + res.rgb*(1.0-_r5.a);
if ( ne ) res.rgb = FilmGrain(res.rgb,coord);
if ( dkenable ) res.rgb = Vignette(res.rgb,coord);
if ( boxenable ) res.rgb = Letterbox(res.rgb,coord);
if ( !fadebeforefilm ) res.rgb = _r5.rgb*_r5.a + res.rgb*(1.0-_r5.a);
if ( regdebug )
{
res.rgb += debugreg(_r1.x,coord,0);
res.rgb += debugreg(_r1.y,coord,1);
res.rgb += debugreg(_r1.z,coord,2);
res.rgb += debugreg(_r1.w,coord,3);
res.rgb += debugreg(_r2.x,coord,4);
res.rgb += debugreg(_r2.y,coord,5);
res.rgb += debugreg(_r2.z,coord,6);
res.rgb += debugreg(_r2.w,coord,7);
res.rgb += debugreg(_r3.x,coord,8);
res.rgb += debugreg(_r3.y,coord,9);
res.rgb += debugreg(_r3.z,coord,10);
res.rgb += debugreg(_r3.w,coord,11);
res.rgb += debugreg(_r4.x,coord,12);
res.rgb += debugreg(_r4.y,coord,13);
res.rgb += debugreg(_r4.z,coord,14);
res.rgb += debugreg(_r4.w,coord,15);
res.rgb += debugreg(_r5.x,coord,16);
res.rgb += debugreg(_r5.y,coord,17);
res.rgb += debugreg(_r5.z,coord,18);
res.rgb += debugreg(_r5.w,coord,19);
}
if ( dodither ) res.rgb = Dither(res.rgb,coord);
res.rgb = max(0,res.rgb);
res.a = 1.0;

View file

@ -846,6 +846,17 @@ int clut
int UIMin = 0;
int UIMax = 63;
> = {1};
/* not using ENB's own variables, sorry */
bool palenable
<
string UIName = "EnableENBPalette";
string UIWidget = "Checkbox";
> = {false};
float palblend
<
string UIName = "PaletteBlend";
string UIWidget = "Spinner";
> = {1.0};
bool fadebeforefilm
<
string UIName = "FadeBeforeFilmFilters";
@ -868,16 +879,3 @@ bool bloomdebug
string UIName = "DebugBloom";
string UIWidget = "Checkbox";
> = {false};
/* debug vanilla shader registers */
bool regdebug
<
string UIName = "DebugRegisters";
string UIWidget = "Checkbox";
> = {false};
/* scale of register bars */
float regdebugscale
<
string UIName = "DebugRegistersScale";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {5.0};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 590 KiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 599 KiB

After

Width:  |  Height:  |  Size: 2.2 MiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 748 KiB

After

Width:  |  Height:  |  Size: 2.3 MiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 483 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 KiB

After

Width:  |  Height:  |  Size: 231 KiB

Before After
Before After

View file

@ -0,0 +1,69 @@
sikkmod
00 adrenaline
01 base
02 c2_alienvesselgreenblue
03 c2_alnvsl_streets
04 c2_battery_park_ab1_pier
05 c2_battery_park_ab2_park
06 c2_battery_park_spear
07 c2_battery_park_streets
08 c2_black_control
09 c2_centralpark
10 c2_centralstation_streets
11 c2_collided_buildings
12 c2_collided_hotel
13 c2_convoy
14 c2_cxp_360
15 c2_cxp_pc
16 c2_desaturate
17 c2_downtown2
18 c2_downtown_streets
19 c2_flash_blindness
20 c2_hive_ab3_crater
21 c2_liberty_test11
22 c2_madisonsquare_rapids
23 c2_pier_2
24 c2_pier_3
25 c2_pier_sunset
26 c2_pier
27 c2_pipeline
28 c2_rooftops_inside
29 c2_rooftops_outside
30 c2_rooftops
31 c2_roosevelt_park
32 c2_spear_streets_spore2
33 c2_spear_streets_spore
34 c2_spear_streets
35 c2_terminal_5
36 c2_timesquare_blackout
37 c2_timesquare_global
38 cold
39 dry
40 neutral
41 riddick2
42 sepia
43 udk_ce2
44 udk_dawn02
45 udk_day05
46 udk_dm_deck01
47 udk_dm_deck02
48 udk_dm_deck03
49 udk_necropolis01
50 udk_night03
51 udk_stormy
52 warm
marienb
53 mk_dust_1
54 mk_dust_2
55 mk_red
56 mk_blue
57 mk_brown
58 mk_flame
59 mk_golden
60 mk_dust_3
61 mk_dust_4
62 mk_desat_1
63 mk_desat_2

View file

@ -54,7 +54,7 @@ float3 Edge( float3 res, float2 coord )
lerp(edgefadepow_in,edgefadepow_id,tod),ind);
float edgefademult = lerp(lerp(edgefademult_n,edgefademult_d,tod),
lerp(edgefademult_in,edgefademult_id,tod),ind);
float2 bof = float2(1.0/bresl.x,1.0/bresl.y);
float2 bof = float2(1.0/bresl.x,1.0/bresl.y)*edgeradius;
float mdx = 0, mdy = 0, mud = 0;
/* this reduces texture fetches by half, big difference */
float3x3 depths;
@ -151,7 +151,7 @@ float4 PS_SSAOPrepass( VS_OUTPUT_POST IN, float2 vPos : VPOS ) : COLOR
{
sample = reflect(ssao_samples[i],normal);
sdepth = depthlinear(coord+sample.xy*bof);
if ( ldepth < sdepth ) occ += 1.0;
if ( ldepth <= sdepth ) occ += 1.0;
else occ += saturate((abs(ldepth-sdepth)-sclamp)/sclamp);
}
float uocc = saturate(1.0-occ/64.0);
@ -261,12 +261,17 @@ float4 PS_DoFPrepass( VS_OUTPUT_POST IN, float2 vPos : VPOS ) : COLOR
dofpow_id,tod),ind);
float dofmult = lerp(lerp(dofmult_n,dofmult_d,tod),lerp(dofmult_in,
dofmult_id,tod),ind);
float dofbump = lerp(lerp(dofbump_n,dofbump_d,tod),lerp(dofbump_in,
dofbump_id,tod),ind);
float doffixedfocuspow = lerp(lerp(doffixedfocuspow_n,
doffixedfocuspow_d,tod),lerp(doffixedfocuspow_in,
doffixedfocuspow_id,tod),ind);
float doffixedfocusmult = lerp(lerp(doffixedfocusmult_n,
doffixedfocusmult_d,tod),lerp(doffixedfocusmult_in,
doffixedfocusmult_id,tod),ind);
float doffixedfocusbump = lerp(lerp(doffixedfocusbump_n,
doffixedfocusbump_d,tod),lerp(doffixedfocusbump_in,
doffixedfocusbump_id,tod),ind);
float doffixedfocusblend = lerp(lerp(doffixedfocusblend_n,
doffixedfocusblend_d,tod),lerp(doffixedfocusblend_in,
doffixedfocusblend_id,tod),ind);
@ -276,6 +281,9 @@ float4 PS_DoFPrepass( VS_OUTPUT_POST IN, float2 vPos : VPOS ) : COLOR
float doffixedunfocusmult = lerp(lerp(doffixedunfocusmult_n,
doffixedunfocusmult_d,tod),lerp(doffixedunfocusmult_in,
doffixedunfocusmult_id,tod),ind);
float doffixedunfocusbump = lerp(lerp(doffixedunfocusbump_n,
doffixedunfocusbump_d,tod),lerp(doffixedunfocusbump_in,
doffixedunfocusbump_id,tod),ind);
float doffixedunfocusblend = lerp(lerp(doffixedunfocusblend_n,
doffixedunfocusblend_d,tod),lerp(doffixedunfocusblend_in,
doffixedunfocusblend_id,tod),ind);
@ -301,9 +309,11 @@ float4 PS_DoFPrepass( VS_OUTPUT_POST IN, float2 vPos : VPOS ) : COLOR
float relfov = (FieldOfView-fovdefault)/fovdefault;
dofpow = max(0,dofpow+relfov*relfovfactor);
}
dfc = saturate(pow(dfc,dofpow)*dofmult);
dff = saturate(pow(dff,doffixedfocuspow)*doffixedfocusmult);
dfu = saturate(pow(dfu,doffixedunfocuspow)*doffixedunfocusmult);
dfc = clamp(pow(dfc,dofpow)*dofmult+dofbump,0.0,1.0);
dff = clamp(pow(dff,doffixedfocuspow)*doffixedfocusmult
+doffixedfocusbump,0.0,1.0);
dfu = clamp(pow(dfu,doffixedunfocuspow)*doffixedunfocusmult
+doffixedunfocusbump,0.0,1.0);
dfc *= lerp(1.0,dff,doffixedfocusblend);
dfc += lerp(0.0,dfu,doffixedunfocusblend);
dfc = saturate(dfc);
@ -415,7 +425,8 @@ float2 DistantHeat( float2 coord )
ofs = (ofs-0.5)*2.0;
ofs *= pow(length(ofs),heatpow);
float distfade = tex2D(SamplerDepth,coord).x;
distfade = pow(distfade,heatfadepow)*heatfademul;
distfade = clamp(pow(distfade,heatfadepow)*heatfademul+heatfadebump,
0.0,1.0);
if ( !heatalways ) ofs *= pow(tod*(1.0-ind),heattodpow);
return coord+ofs*heatstrength*distfade*0.01;
}

View file

@ -123,6 +123,11 @@ float heatfademul
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {0.5};
float heatfadebump
<
string UIName = "HeatFadeBump";
string UIWidget = "Spinner";
> = {0.0};
float heatstrength
<
string UIName = "HeatStrength";
@ -305,6 +310,27 @@ float dofpow_id
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {4.0};
/* dof bump (to emulate tilt shift I guess, I brought it back) */
float dofbump_n
<
string UIName = "DoFBumpNight";
string UIWidget = "Spinner";
> = {0.0};
float dofbump_d
<
string UIName = "DoFBumpDay";
string UIWidget = "Spinner";
> = {0.0};
float dofbump_in
<
string UIName = "DoFBumpInteriorNight";
string UIWidget = "Spinner";
> = {0.0};
float dofbump_id
<
string UIName = "DoFBumpInteriorDay";
string UIWidget = "Spinner";
> = {0.0};
/* fixed focused depth factors */
float doffixedfocusmult_n
<
@ -354,6 +380,26 @@ float doffixedfocuspow_id
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float doffixedfocusbump_n
<
string UIName = "DoFFixedFocusedBumpNight";
string UIWidget = "Spinner";
> = {0.0};
float doffixedfocusbump_d
<
string UIName = "DoFFixedFocusedBumpDay";
string UIWidget = "Spinner";
> = {0.0};
float doffixedfocusbump_in
<
string UIName = "DoFFixedFocusedBumpInteriorNight";
string UIWidget = "Spinner";
> = {0.0};
float doffixedfocusbump_id
<
string UIName = "DoFFixedFocusedBumpInteriorDay";
string UIWidget = "Spinner";
> = {0.0};
float doffixedfocusblend_n
<
string UIName = "DoFFixedFocusedBlendNight";
@ -427,6 +473,26 @@ float doffixedunfocuspow_id
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1000.0};
float doffixedunfocusbump_n
<
string UIName = "DoFFixedUnfocusedBumpNight";
string UIWidget = "Spinner";
> = {0.0};
float doffixedunfocusbump_d
<
string UIName = "DoFFixedUnfocusedBumpDay";
string UIWidget = "Spinner";
> = {0.0};
float doffixedunfocusbump_in
<
string UIName = "DoFFixedUnfocusedBumpInteriorNight";
string UIWidget = "Spinner";
> = {0.0};
float doffixedunfocusbump_id
<
string UIName = "DoFFixedUnfocusedBumpInteriorDay";
string UIWidget = "Spinner";
> = {0.0};
float doffixedunfocusblend_n
<
string UIName = "DoFFixedUnfocusedBlendNight";
@ -584,6 +650,12 @@ float edgemult
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {128.0};
float edgeradius
<
string UIName = "EdgeRadius";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
/* ssao filter */
bool ssaoenable
<