MariENB FO4 3.2.7b
This commit is contained in:
parent
8fa0d0eb97
commit
d4df9ee642
23 changed files with 1190 additions and 1304 deletions
|
|
@ -107,13 +107,6 @@ float bloomradiusy
|
|||
string UIWidget = "Spinner";
|
||||
float UIMin = 0.0;
|
||||
> = {1.0};
|
||||
float bloomtheta
|
||||
<
|
||||
string UIName = "Bloom Angle";
|
||||
string UIWidget = "Spinner";
|
||||
float UIMin = 0.0;
|
||||
float UIMax = 1.0;
|
||||
> = {0.0};
|
||||
/* bloom tint/blueshift parameters */
|
||||
float3 blu_n
|
||||
<
|
||||
|
|
@ -279,83 +272,21 @@ float bloommixs
|
|||
string UIName = "Bloom Single Pass Blend";
|
||||
string UIWidget = "Spinner";
|
||||
> = {1.0};
|
||||
string str_bloomdirt = "Lens Dirt";
|
||||
bool dirtenable
|
||||
<
|
||||
string UIName = "Enable Lens Dirt";
|
||||
string UIWidget = "Checkbox";
|
||||
> = {false};
|
||||
float dirtmix1
|
||||
<
|
||||
string UIName = "Dirt Pass 1 Blend";
|
||||
string UIWidget = "Spinner";
|
||||
> = {0.0};
|
||||
float dirtmix2
|
||||
<
|
||||
string UIName = "Dirt Pass 2 Blend";
|
||||
string UIWidget = "Spinner";
|
||||
> = {0.1};
|
||||
float dirtmix3
|
||||
<
|
||||
string UIName = "Dirt Pass 3 Blend";
|
||||
string UIWidget = "Spinner";
|
||||
> = {1.2};
|
||||
float dirtmix4
|
||||
<
|
||||
string UIName = "Dirt Pass 4 Blend";
|
||||
string UIWidget = "Spinner";
|
||||
> = {0.5};
|
||||
float dirtmix5
|
||||
<
|
||||
string UIName = "Dirt Pass 5 Blend";
|
||||
string UIWidget = "Spinner";
|
||||
> = {0.25};
|
||||
float dirtmix6
|
||||
<
|
||||
string UIName = "Dirt Pass 6 Blend";
|
||||
string UIWidget = "Spinner";
|
||||
> = {0.1};
|
||||
float dirtmixs
|
||||
<
|
||||
string UIName = "Dirt Single Pass Blend";
|
||||
string UIWidget = "Spinner";
|
||||
> = {1.0};
|
||||
float dirtsaturation
|
||||
<
|
||||
string UIName = "Dirt Saturation";
|
||||
string UIWidget = "Spinner";
|
||||
> = {1.0};
|
||||
float ldirtpow
|
||||
<
|
||||
string UIName = "Dirt Texture Contrast";
|
||||
string UIWidget = "Spinner";
|
||||
> = {1.25};
|
||||
float dirtpow
|
||||
<
|
||||
string UIName = "Dirt Contrast";
|
||||
string UIWidget = "Spinner";
|
||||
> = {1.25};
|
||||
float ldirtfactor
|
||||
<
|
||||
string UIName = "Dirt Factor";
|
||||
string UIWidget = "Spinner";
|
||||
> = {1.5};
|
||||
|
||||
|
||||
/* gaussian blur matrices */
|
||||
/* radius: 4, std dev: 1.5 */
|
||||
/*static const float gauss4[4] =
|
||||
static const float gauss4[4] =
|
||||
{
|
||||
0.270682, 0.216745, 0.111281, 0.036633
|
||||
};*/
|
||||
};
|
||||
/* radius: 8, std dev: 3 */
|
||||
static const float gauss8[8] =
|
||||
/*static const float gauss8[8] =
|
||||
{
|
||||
0.134598, 0.127325, 0.107778, 0.081638,
|
||||
0.055335, 0.033562, 0.018216, 0.008847
|
||||
};
|
||||
};*/
|
||||
/* radius: 40, std dev: 15 */
|
||||
/*static const float gauss40[40] =
|
||||
static const float gauss40[40] =
|
||||
{
|
||||
0.026823, 0.026763, 0.026585, 0.026291,
|
||||
0.025886, 0.025373, 0.024760, 0.024055,
|
||||
|
|
@ -367,9 +298,9 @@ static const float gauss8[8] =
|
|||
0.004697, 0.004139, 0.003630, 0.003170,
|
||||
0.002756, 0.002385, 0.002055, 0.001763,
|
||||
0.001506, 0.001280, 0.001084, 0.000913
|
||||
};*/
|
||||
};
|
||||
/* radius: 80, std dev: 30 */
|
||||
static const float gauss80[80] =
|
||||
/*static const float gauss80[80] =
|
||||
{
|
||||
0.013406, 0.013398, 0.013376, 0.013339, 0.013287, 0.013221,
|
||||
0.013140, 0.013046, 0.012938, 0.012816, 0.012681, 0.012534,
|
||||
|
|
@ -385,7 +316,7 @@ static const float gauss80[80] =
|
|||
0.001192, 0.001107, 0.001027, 0.000952, 0.000881, 0.000815,
|
||||
0.000753, 0.000694, 0.000640, 0.000589, 0.000542, 0.000497,
|
||||
0.000456, 0.000418
|
||||
};
|
||||
};*/
|
||||
/* mathematical constants */
|
||||
static const float pi = 3.1415926535898;
|
||||
|
||||
|
|
@ -406,15 +337,6 @@ Texture2D RenderTarget64;
|
|||
Texture2D RenderTarget32;
|
||||
Texture2D RenderTargetRGBA64F;
|
||||
|
||||
Texture2D TextureLens
|
||||
<
|
||||
#ifdef LENSDIRT_DDS
|
||||
string ResourceName = "menblens.dds";
|
||||
#else
|
||||
string ResourceName = "menblens.png";
|
||||
#endif
|
||||
>;
|
||||
|
||||
SamplerState Sampler
|
||||
{
|
||||
Filter = MIN_MAG_MIP_LINEAR;
|
||||
|
|
@ -428,13 +350,6 @@ SamplerState Sampler2
|
|||
AddressV = Clamp;
|
||||
};
|
||||
|
||||
SamplerState SamplerLens
|
||||
{
|
||||
Filter = MIN_MAG_MIP_LINEAR;
|
||||
AddressU = Mirror;
|
||||
AddressV = Mirror;
|
||||
};
|
||||
|
||||
struct VS_INPUT_POST
|
||||
{
|
||||
float3 pos : POSITION;
|
||||
|
|
@ -533,14 +448,13 @@ float4 Anamorphic( float2 coord, Texture2D intex, float insz )
|
|||
base = RenderTargetRGBA64F.Sample(Sampler,coord);
|
||||
int i;
|
||||
float sum = 0.0;
|
||||
float inc = flen/insz;
|
||||
float2 pp;
|
||||
float2 dir = float2(cos(bloomtheta*2*pi),sin(bloomtheta*2*pi))
|
||||
*flen/insz;
|
||||
[unroll] for ( i=-79; i<=79; i++ )
|
||||
[unroll] for ( i=-39; i<=39; i++ )
|
||||
{
|
||||
pp = coord+dir*i;
|
||||
res += gauss80[abs(i)]*intex.Sample(Sampler,pp);
|
||||
sum += ((pp.x>=0.0)&&(pp.x<1.0))?gauss80[abs(i)]:0.0;
|
||||
pp = coord+float2(i,0)*inc;
|
||||
res += gauss40[abs(i)]*intex.Sample(Sampler,pp);
|
||||
sum += ((pp.x>=0.0)&&(pp.x<1.0))?gauss40[abs(i)]:0.0;
|
||||
}
|
||||
res *= 1.0/sum;
|
||||
float3 flu = tod_ind(flu);
|
||||
|
|
@ -562,14 +476,13 @@ float4 PS_HorizontalBlur( VS_OUTPUT_POST IN, float4 v0 : SV_Position0,
|
|||
float4 res = float4(0.0,0.0,0.0,0.0);
|
||||
int i;
|
||||
float sum = 0.0;
|
||||
float inc = bloomradiusx/insz;
|
||||
float2 pp;
|
||||
float2 dir = float2(cos(bloomtheta*2*pi),sin(bloomtheta*2*pi))
|
||||
*bloomradiusx/insz;
|
||||
[unroll] for ( i=-7; i<=7; i++ )
|
||||
[unroll] for ( i=-3; i<=3; i++ )
|
||||
{
|
||||
pp = coord+dir*i;
|
||||
res += gauss8[abs(i)]*intex.Sample(Sampler,pp);
|
||||
sum += ((pp.x>=0.0)&&(pp.x<1.0))?gauss8[abs(i)]:0.0;
|
||||
pp = coord+float2(i,0)*inc;
|
||||
res += gauss4[abs(i)]*intex.Sample(Sampler,pp);
|
||||
sum += ((pp.x>=0.0)&&(pp.x<1.0))?gauss4[abs(i)]:0.0;
|
||||
}
|
||||
res *= 1.0/sum;
|
||||
if ( alfenable ) res += Anamorphic(coord,intex,insz);
|
||||
|
|
@ -588,14 +501,13 @@ float4 PS_VerticalBlur( VS_OUTPUT_POST IN, float4 v0 : SV_Position0,
|
|||
base = RenderTargetRGBA64F.Sample(Sampler,coord);
|
||||
int i;
|
||||
float sum = 0.0;
|
||||
float inc = bloomradiusy/insz;
|
||||
float2 pp;
|
||||
float2 dir = float2(sin(bloomtheta*2*pi),-cos(bloomtheta*2*pi))
|
||||
*bloomradiusy/insz;
|
||||
[unroll] for ( i=-7; i<=7; i++ )
|
||||
[unroll] for ( i=-3; i<=3; i++ )
|
||||
{
|
||||
pp = coord+dir*i;
|
||||
res += gauss8[abs(i)]*intex.Sample(Sampler,pp);
|
||||
sum += ((pp.y>=0.0)&&(pp.y<1.0))?gauss8[abs(i)]:0.0;
|
||||
pp = coord+float2(0,i)*inc;
|
||||
res += gauss4[abs(i)]*intex.Sample(Sampler,pp);
|
||||
sum += ((pp.y>=0.0)&&(pp.y<1.0))?gauss4[abs(i)]:0.0;
|
||||
}
|
||||
res *= 1.0/sum;
|
||||
float3 blu = tod_ind(blu);
|
||||
|
|
@ -622,30 +534,6 @@ float4 PS_PostPass( VS_OUTPUT_POST IN, float4 v0 : SV_Position0 ) : SV_Target
|
|||
res.rgb /= 6.0;
|
||||
res.rgb = clamp(res.rgb,0.0,32768.0);
|
||||
res.a = 1.0;
|
||||
if ( !dirtenable ) return res;
|
||||
/* crappy lens filter, useful when playing characters with glasses */
|
||||
float2 ccoord = coord;
|
||||
#ifdef ASPECT_LENSDIRT
|
||||
ccoord.y = (coord.y-0.5)*ScreenSize.w+0.5;
|
||||
#endif
|
||||
float4 crap = TextureLens.Sample(SamplerLens,ccoord);
|
||||
float4 mud = dirtmix1*RenderTarget1024.Sample(Sampler2,coord);
|
||||
mud += dirtmix2*RenderTarget512.Sample(Sampler2,coord);
|
||||
mud += dirtmix3*RenderTarget256.Sample(Sampler2,coord);
|
||||
mud += dirtmix4*RenderTarget128.Sample(Sampler2,coord);
|
||||
mud += dirtmix5*RenderTarget64.Sample(Sampler2,coord);
|
||||
mud += dirtmix6*RenderTarget32.Sample(Sampler2,coord);
|
||||
mud.rgb /= 6.0;
|
||||
float3 hsv = rgb2hsv(mud.rgb);
|
||||
hsv.y = clamp(hsv.y*dirtsaturation,0.0,1.0);
|
||||
mud.rgb = clamp(hsv2rgb(hsv),0.0,32768.0);
|
||||
mud.rgb = pow(mud.rgb,dirtpow);
|
||||
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*crap.rgb;
|
||||
res += max(mud,0.0);
|
||||
res.a = 1.0;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
@ -655,24 +543,6 @@ float4 PS_SPostPass( VS_OUTPUT_POST IN, float4 v0 : SV_Position0 ) : SV_Target
|
|||
float4 res = bloommixs*RenderTarget128.Sample(Sampler2,coord);
|
||||
res.rgb = clamp(res.rgb,0.0,32768.0);
|
||||
res.a = 1.0;
|
||||
if ( !dirtenable ) return res;
|
||||
/* crappy lens filter, useful when playing characters with glasses */
|
||||
float2 ccoord = coord;
|
||||
#ifdef ASPECT_LENSDIRT
|
||||
ccoord.y = (coord.y-0.5)*ScreenSize.w+0.5;
|
||||
#endif
|
||||
float4 crap = TextureLens.Sample(SamplerLens,ccoord);
|
||||
float4 mud = dirtmixs*RenderTarget32.Sample(Sampler2,coord);
|
||||
mud.rgb = pow(mud.rgb,dirtpow);
|
||||
float3 hsv = rgb2hsv(mud.rgb);
|
||||
hsv.y = clamp(hsv.y*dirtsaturation,0.0,1.0);
|
||||
mud.rgb = clamp(hsv2rgb(hsv),0.0,32768.0);
|
||||
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*crap.rgb;
|
||||
res += max(mud,0.0);
|
||||
res.a = 1.0;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
@ -684,7 +554,6 @@ technique11 BloomSimplePass <string UIName="MariENB Simple Bloom"; string Render
|
|||
SetPixelShader(CompileShader(ps_5_0,PS_PrePass()));
|
||||
}
|
||||
}
|
||||
|
||||
technique11 BloomSimplePass1 <string RenderTarget="RenderTarget1024";>
|
||||
{
|
||||
pass p0
|
||||
|
|
@ -717,24 +586,7 @@ technique11 BloomSimplePass4 <string RenderTarget="RenderTarget128";>
|
|||
SetPixelShader(CompileShader(ps_5_0,PS_Downsize(RenderTarget256,256.0)));
|
||||
}
|
||||
}
|
||||
technique11 BloomSimplePass5 <string RenderTarget="RenderTarget64";>
|
||||
{
|
||||
pass p0
|
||||
{
|
||||
SetVertexShader(CompileShader(vs_5_0,VS_Quad()));
|
||||
SetPixelShader(CompileShader(ps_5_0,PS_Downsize(RenderTarget128,128.0)));
|
||||
}
|
||||
}
|
||||
technique11 BloomSimplePass6 <string RenderTarget="RenderTarget32";>
|
||||
{
|
||||
pass p0
|
||||
{
|
||||
SetVertexShader(CompileShader(vs_5_0,VS_Quad()));
|
||||
SetPixelShader(CompileShader(ps_5_0,PS_Downsize(RenderTarget64,64.0)));
|
||||
}
|
||||
}
|
||||
|
||||
technique11 BloomSimplePass7
|
||||
technique11 BloomSimplePass5
|
||||
{
|
||||
pass p0
|
||||
{
|
||||
|
|
@ -742,7 +594,7 @@ technique11 BloomSimplePass7
|
|||
SetPixelShader(CompileShader(ps_5_0,PS_HorizontalBlur(RenderTarget128,128.0)));
|
||||
}
|
||||
}
|
||||
technique11 BloomSimplePass8 <string RenderTarget="RenderTarget128";>
|
||||
technique11 BloomSimplePass6 <string RenderTarget="RenderTarget128";>
|
||||
{
|
||||
pass p0
|
||||
{
|
||||
|
|
@ -750,25 +602,7 @@ technique11 BloomSimplePass8 <string RenderTarget="RenderTarget128";>
|
|||
SetPixelShader(CompileShader(ps_5_0,PS_VerticalBlur(TextureColor,128.0,3.0)));
|
||||
}
|
||||
}
|
||||
|
||||
technique11 BloomSimplePass9
|
||||
{
|
||||
pass p0
|
||||
{
|
||||
SetVertexShader(CompileShader(vs_5_0,VS_Quad()));
|
||||
SetPixelShader(CompileShader(ps_5_0,PS_HorizontalBlur(RenderTarget32,32.0)));
|
||||
}
|
||||
}
|
||||
technique11 BloomSimplePass10 <string RenderTarget="RenderTarget32";>
|
||||
{
|
||||
pass p0
|
||||
{
|
||||
SetVertexShader(CompileShader(vs_5_0,VS_Quad()));
|
||||
SetPixelShader(CompileShader(ps_5_0,PS_VerticalBlur(TextureColor,32.0,5.0)));
|
||||
}
|
||||
}
|
||||
|
||||
technique11 BloomSimplePass11
|
||||
technique11 BloomSimplePass7
|
||||
{
|
||||
pass p0
|
||||
{
|
||||
|
|
@ -785,7 +619,6 @@ technique11 BloomPass <string UIName="MariENB Multi Bloom"; string RenderTarget=
|
|||
SetPixelShader(CompileShader(ps_5_0,PS_PrePass()));
|
||||
}
|
||||
}
|
||||
|
||||
technique11 BloomPass1 <string RenderTarget="RenderTarget1024";>
|
||||
{
|
||||
pass p0
|
||||
|
|
@ -834,7 +667,6 @@ technique11 BloomPass6 <string RenderTarget="RenderTarget32";>
|
|||
SetPixelShader(CompileShader(ps_5_0,PS_Downsize(RenderTarget64,64.0)));
|
||||
}
|
||||
}
|
||||
|
||||
technique11 BloomPass7
|
||||
{
|
||||
pass p0
|
||||
|
|
@ -851,7 +683,6 @@ technique11 BloomPass8 <string RenderTarget="RenderTarget1024";>
|
|||
SetPixelShader(CompileShader(ps_5_0,PS_VerticalBlur(TextureColor,1024.0,0.0)));
|
||||
}
|
||||
}
|
||||
|
||||
technique11 BloomPass9
|
||||
{
|
||||
pass p0
|
||||
|
|
@ -868,7 +699,6 @@ technique11 BloomPass10 <string RenderTarget="RenderTarget512";>
|
|||
SetPixelShader(CompileShader(ps_5_0,PS_VerticalBlur(TextureColor,512.0,1.0)));
|
||||
}
|
||||
}
|
||||
|
||||
technique11 BloomPass11
|
||||
{
|
||||
pass p0
|
||||
|
|
@ -885,7 +715,6 @@ technique11 BloomPass12 <string RenderTarget="RenderTarget256";>
|
|||
SetPixelShader(CompileShader(ps_5_0,PS_VerticalBlur(TextureColor,256.0,2.0)));
|
||||
}
|
||||
}
|
||||
|
||||
technique11 BloomPass13
|
||||
{
|
||||
pass p0
|
||||
|
|
@ -902,7 +731,6 @@ technique11 BloomPass14 <string RenderTarget="RenderTarget128";>
|
|||
SetPixelShader(CompileShader(ps_5_0,PS_VerticalBlur(TextureColor,128.0,3.0)));
|
||||
}
|
||||
}
|
||||
|
||||
technique11 BloomPass15
|
||||
{
|
||||
pass p0
|
||||
|
|
@ -919,7 +747,6 @@ technique11 BloomPass16 <string RenderTarget="RenderTarget64";>
|
|||
SetPixelShader(CompileShader(ps_5_0,PS_VerticalBlur(TextureColor,64.0,4.0)));
|
||||
}
|
||||
}
|
||||
|
||||
technique11 BloomPass17
|
||||
{
|
||||
pass p0
|
||||
|
|
@ -936,7 +763,6 @@ technique11 BloomPass18 <string RenderTarget="RenderTarget32";>
|
|||
SetPixelShader(CompileShader(ps_5_0,PS_VerticalBlur(TextureColor,32.0,5.0)));
|
||||
}
|
||||
}
|
||||
|
||||
technique11 BloomPass19
|
||||
{
|
||||
pass p0
|
||||
|
|
|
|||
Reference in a new issue