1
Fork 0

MariENB 2015.10.19

This commit is contained in:
Marisa the Magician 2019-04-07 17:24:48 +02:00
commit 3c2735f1b6
5 changed files with 169 additions and 8 deletions

View file

@ -215,7 +215,8 @@ float3 GradingLUT( float3 res )
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;
float3 tcol = clamp(res,0.0,1.0);
tcol.rg = tcol.rg*0.5+0.25;
float2 lc1 = float2(tcol.r/16.0+floor(tcol.b*16.0)/16.0,tcol.g/64.0
+clut/64.0);
float2 lc2 = float2(tcol.r/16.0+ceil(tcol.b*16.0)/16.0,tcol.g/64.0
@ -224,7 +225,6 @@ float3 GradingLUT( float3 res )
float3 tcl1 = tex2D(SamplerLUT,lc1);
float3 tcl2 = tex2D(SamplerLUT,lc2);
tcol = lerp(tcl1,tcl2,dec);
tcol = (tcol-0.0625)/0.875;
float lutblend = lerp(lerp(lutblend_n,lutblend_d,tod),lerp(lutblend_in,
lutblend_id,tod),ind);
return lerp(res,tcol,lutblend);

View file

@ -177,8 +177,8 @@ sampler2D SamplerLUT = sampler_state
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = NONE;
AddressU = Wrap;
AddressV = Wrap;
AddressU = Clamp;
AddressV = Clamp;
SRGBTexture = FALSE;
MaxMipLevel = 0;
MipMapLodBias = 0;

View file

@ -373,12 +373,81 @@ float4 PS_Curvature( VS_OUTPUT_POST IN, float2 vPos : VPOS ) : COLOR
res.rgb = idist.rgb;
return res;
}
/* Why am I doing this */
float4 PS_Blur( VS_OUTPUT_POST IN, float2 vPos : VPOS ) : COLOR
{
float2 coord = IN.txcoord.xy;
float4 res = tex2D(SamplerColor,coord);
if ( !bssblurenable ) return res;
float2 ofs[16] =
{
float2(1.0,1.0), float2(-1.0,-1.0),
float2(-1.0,1.0), float2(1.0,-1.0),
float2(1.0,0.0), float2(-1.0,0.0),
float2(0.0,1.0), float2(0.0,-1.0),
float2(1.41,0.0), float2(-1.41,0.0),
float2(0.0,1.41), float2(0.0,-1.41),
float2(1.41,1.41), float2(-1.41,-1.41),
float2(-1.41,1.41), float2(1.41,-1.41)
};
float2 bresl = float2(ScreenSize.x,ScreenSize.x*ScreenSize.w);
float2 bof = (1.0/bresl)*bssblurradius;
int i;
[unroll] for ( i=0; i<16; i++ )
res += tex2D(SamplerColor,coord+ofs[i]*bof);
res /= 17.0;
res.a = 1.0;
return res;
}
float4 PS_Sharp( VS_OUTPUT_POST IN, float2 vPos : VPOS ) : COLOR
{
float2 coord = IN.txcoord.xy;
float4 res = tex2D(SamplerColor,coord);
if ( !bsssharpenable ) return res;
float2 ofs[8] =
{
float2(1.0,1.0), float2(-1.0,-1.0),
float2(-1.0,1.0), float2(1.0,-1.0),
float2(1.41,1.41), float2(-1.41,-1.41),
float2(-1.41,1.41), float2(1.41,-1.41)
};
float2 bresl = float2(ScreenSize.x,ScreenSize.x*ScreenSize.w);
float2 bof = (1.0/bresl)*bsssharpradius;
float4 tcol = res;
int i;
[unroll] for ( i=0; i<8; i++ )
tcol += tex2D(SamplerColor,coord+ofs[i]*bof);
tcol /= 9.0;
float4 orig = res;
res = orig*(1.0+dot(orig.rgb-tcol.rgb,0.333333)*bsssharpamount);
float rg = clamp(pow(orig.b,3.0),0.0,1.0);
res = lerp(res,orig,rg);
res.a = 1.0;
return res;
}
float4 PS_Shift( VS_OUTPUT_POST IN, float2 vPos : VPOS ) : COLOR
{
float2 coord = IN.txcoord.xy;
float4 res = tex2D(SamplerColor,coord);
if ( !bssshiftenable ) return res;
float2 bresl = float2(ScreenSize.x,ScreenSize.x*ScreenSize.w);
float2 bof = (1.0/bresl)*bssshiftradius;
res.g = tex2D(SamplerColor,coord).g;
res.r = tex2D(SamplerColor,coord+float2(0,-bof.y)).r;
res.b = tex2D(SamplerColor,coord+float2(0,bof.y)).b;
res.a = 1.0;
return res;
}
technique PostProcess
{
pass p0
{
VertexShader = compile vs_3_0 VS_Pass();
PixelShader = compile ps_3_0 PS_ChromaKey();
PixelShader = compile ps_3_0 PS_Blur();
DitherEnable = FALSE;
ZEnable = FALSE;
CullMode = NONE;
@ -395,7 +464,7 @@ technique PostProcess2
pass p0
{
VertexShader = compile vs_3_0 VS_Pass();
PixelShader = compile ps_3_0 PS_Retro();
PixelShader = compile ps_3_0 PS_Sharp();
DitherEnable = FALSE;
ZEnable = FALSE;
CullMode = NONE;
@ -412,7 +481,7 @@ technique PostProcess3
pass p0
{
VertexShader = compile vs_3_0 VS_Pass();
PixelShader = compile ps_3_0 PS_ASCII();
PixelShader = compile ps_3_0 PS_Shift();
DitherEnable = FALSE;
ZEnable = FALSE;
CullMode = NONE;
@ -429,7 +498,7 @@ technique PostProcess4
pass p0
{
VertexShader = compile vs_3_0 VS_Pass();
PixelShader = compile ps_3_0 PS_DotMatrix();
PixelShader = compile ps_3_0 PS_ChromaKey();
DitherEnable = FALSE;
ZEnable = FALSE;
CullMode = NONE;
@ -442,6 +511,57 @@ technique PostProcess4
}
}
technique PostProcess5
{
pass p0
{
VertexShader = compile vs_3_0 VS_Pass();
PixelShader = compile ps_3_0 PS_Retro();
DitherEnable = FALSE;
ZEnable = FALSE;
CullMode = NONE;
ALPHATESTENABLE = FALSE;
SEPARATEALPHABLENDENABLE = FALSE;
AlphaBlendEnable = FALSE;
StencilEnable = FALSE;
FogEnable = FALSE;
SRGBWRITEENABLE = FALSE;
}
}
technique PostProcess6
{
pass p0
{
VertexShader = compile vs_3_0 VS_Pass();
PixelShader = compile ps_3_0 PS_ASCII();
DitherEnable = FALSE;
ZEnable = FALSE;
CullMode = NONE;
ALPHATESTENABLE = FALSE;
SEPARATEALPHABLENDENABLE = FALSE;
AlphaBlendEnable = FALSE;
StencilEnable = FALSE;
FogEnable = FALSE;
SRGBWRITEENABLE = FALSE;
}
}
technique PostProcess7
{
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 PostProcess8
{
pass p0
{

View file

@ -242,3 +242,44 @@ float curvesoft
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {0.0};
/* BlurSharpShift, some people are obsessed with this nonsense */
string str_bss = "BlurSharpShift";
bool bssblurenable
<
string UIName = "Enable Blur";
string UIWidget = "Checkbox";
> = {false};
float bssblurradius
<
string UIName = "Blur Sampling Range";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {0.25};
bool bsssharpenable
<
string UIName = "Enable Sharp";
string UIWidget = "Checkbox";
> = {false};
float bsssharpradius
<
string UIName = "Sharp Sampling Range";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {1.0};
float bsssharpamount
<
string UIName = "Sharpening Amount";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {6.0};
bool bssshiftenable
<
string UIName = "Enable Shift";
string UIWidget = "Checkbox";
> = {false};
float bssshiftradius
<
string UIName = "Shift Sampling Range";
string UIWidget = "Spinner";
float UIMin = 0.0;
> = {0.75};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 230 KiB

After

Width:  |  Height:  |  Size: 268 KiB

Before After
Before After