Professional Documents
Culture Documents
SMP
SMP
0 */
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++//
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++//
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++//
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++//
// /XXXXXXX\ __ |HHHHHHHHH\
\HH\ /HH/ //
// |XX| |XX| XX |HH| \HHH\ /\
\HH\ /HH/ //
// |XX| |X| /XX\ |HH| \HH\ \/
\HH\ /HH/ //
// \XX\ /XXXX\ |HH| |HH| __ __ __ ___
___ __ \HHHHH/ //
// \XX\ /XX/\XX\ |HH| |HH| || || /__\ /___\
/___\ __||__ \HHH/ //
// _ \XX\ /XX/ \XX\ |HH| |HH| ||
||// \\ // \\ // \\ |== ==| /HHH\ //
// |X| \XX\ /XXXXXXXXXX\ |HH| |HH| || ||/ ||===||
|| - || /HHHHH\ //
// \XX\ |XX| /XX/ \XX\ |HH| /HH/ || || ||
|| || /HH/ \HH\ //
// \XX\ /XX/ /XX/ \XX\ ________ |HH| /HHH/ || || \\
_ \\ _ || _ /HH/ \HH\ //
// \XXXXXXX/ /XX/ \XX\|________||HHHHHHHHH/ || || \===//
\===// \\=// /HH/ \HH\ //
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++//
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++//
//++++++++++++++++++++++++++++++++++ ENBSeries effect file
++++++++++++++++++++++++++++++++++//
//++++++++++++++++++++++++++++++++++ SA_DirectX by Maxim Dubinov(Makarus)
++++++++++++++++++++++++++++++++++//
//++++++++++++++++++++++++++++++++++ Visit http://www.facebook.com/sadirectx
++++++++++++++++++++++++++++++++++//
//+++++++++++++++++++++++++ https://www.youtube.com/channel/UCrASy-
x5DgwHpYiDv41RL2Q ++++++++++++++++++++++++++//
//++++++++++++++++++++++++++++++++++ Visit http://enbdev.com
++++++++++++++++++++++++++++++++++//
//++++++++++++++++++++++++++++++++++ Copyright (c) 2007-2018 Boris Vorontsov
++++++++++++++++++++++++++++++++++//
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++//
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++//
//textures
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++//
texture2D texColor;
texture2D texDepth;
texture2D texNoise;
texture2D texPalette;
texture2D texFocus; //computed focusing depth
texture2D texCurr; //4*4 texture for focusing
texture2D texPrev; //4*4 texture for focusing
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++//
//Sampler Inputs
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++//
struct VS_OUTPUT_POST
{
float4 vpos : POSITION;
float2 txcoord : TEXCOORD0;
};
struct VS_INPUT_POST
{
float3 pos : POSITION;
float2 txcoord : TEXCOORD0;
};
struct VS_OUTPUT_POST_SSAA
{
float4 vpos : POSITION;
float2 uv[5] : TEXCOORD0;
};
struct VS_OUTPUT_POST_NFAA
{
float4 vpos : POSITION;
float2 uv[8] : TEXCOORD0;
};
///////////////////////////////////////////////////////////////////////////////////
/
/////////////////////////////////////
SA_DirectX/////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/
float ChromaticAmount
<
string UIName="ChromaticAmount";
string UIWidget="Spinner";
float UIMin=0.0;
float UIMax=1.0;
> = {0.01};
float LensSize
<
string UIName="LensSize";
string UIWidget="Spinner";
float UIMin=0.0;
float UIMax=80.0;
> = {0.54};
float LensDistortion
<
string UIName="LensDistortion";
string UIWidget="Spinner";
float UIMin=-1.0;
float UIMax=1.0;
> = {0.27};
float EVignetteAmount
<
string UIName="EVignetteAmount";
string UIWidget="Spinner";
float UIMin=0.0;
float UIMax=2.0;
> = {0.6};
float EVignetteCurve
<
string UIName="EVignetteCurve";
string UIWidget="Spinner";
float UIMin=0.0;
float UIMax=2.0;
> = {1.0};
float EVignetteRadius
<
string UIName="EVignetteRadius";
string UIWidget="Spinner";
float UIMin=0.0;
float UIMax=2.0;
> = {1.4};
///////////////////////////////////////////////////////////////////////////////////
/
/////////////////////////////////////
SA_DirectX/////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/
float4 pos=float4(IN.pos.x,IN.pos.y,IN.pos.z,1.0);
OUT.vpos=pos;
OUT.txcoord.xy=IN.txcoord.xy;
return OUT;
}
o.uv = v.txcoord.xy;
float4 extents;
float2 offset = ( texel.xy ) * 0.5f;
extents.xy = v.txcoord.xy - offset;
extents.zw = v.txcoord.xy + offset;
float4 rcpSize;
rcpSize.xy = -texel.xy * 0.5f;
rcpSize.zw = texel.xy * 0.5f;
o.interpolatorA = extents;
o.interpolatorB = rcpSize;
o.interpolatorC = rcpSize;
o.interpolatorC.xy *= 4.0;
o.interpolatorC.zw *= 4.0;
return o;
}
float2 dir;
dir.x = dirSWMinusNE + dirSEMinusNW;
dir.y = dirSWMinusNE - dirSEMinusNW;
dir = normalize(dir);
float3 col1 = FxaaTexTop(InputSampler, pos.xy - dir * rcpSize.zw).rgb;
float3 col2 = FxaaTexTop(InputSampler, pos.xy + dir * rcpSize.zw).rgb;
///////////////////////////////////////////////////////////////////////////////////
/
/////////////////////////////////////
SA_DirectX/////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/
coord.xy=IN.txcoord.xy;
float4 origcolor;
coord.w=0.0;
origcolor=tex2Dlod(SamplerColor, coord);
float2 offset[8]=
{
float2(1.0, 1.0),
float2(-1.0, -1.0),
float2(-1.0, 1.0),
float2(1.0, -1.0),
float2(1.41, 0.0),
float2(-1.41, 0.0),
float2(0.0, 1.41),
float2(0.0, -1.41)
};
int i=0;
float4 tcol=origcolor;
float2 invscreensize=1.0/ScreenSize;
invscreensize.y=invscreensize.y/ScreenSize.z;
float x = f*LensZoom*(coord.x-0.5)+0.5;
float y = f*LensZoom*(coord.y-0.5)+0.5;
float2 rCoords = (f*eta.r)*LensZoom*(center.xy*0.5)+0.5;
float2 gCoords = (f*eta.g)*LensZoom*(center.xy*0.5)+0.5;
float2 bCoords = (f*eta.b)*LensZoom*(center.xy*0.5)+0.5;
res.w=1.0;
return res;
}
///////////////////////////////////////////////////////////////////////////////////
/
/////////////////////////////////////
SA_DirectX/////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/
float2 uv=(IN.txcoord.xy-0.5)*EVignetteRadius;
float vignette=saturate(dot(uv.xy, uv.xy));
vignette=pow(vignette, EVignetteCurve);
res.xyz=lerp(origcolor.xyz, EVignetteColor, vignette*EVignetteAmount);
res.w=1.0;
return res;
}
///////////////////////////////////////////////////////////////////////////////////
/
/////////////////////////////////////
SA_DirectX/////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/
technique PostProcess
{
pass P0
{
VertexShader = compile vs_3_0 VS_PostProcess();
PixelShader = compile ps_3_0 PS_PostProcess2();
}
}
technique PostProcess2
{
pass P0
{
VertexShader = compile vs_3_0 VS_PostProcessFXAA();
PixelShader = compile ps_3_0 FXAA();
}
}
technique PostProcess3
{
pass P0
{
VertexShader = compile vs_3_0 VS_PostProcess();
PixelShader = compile ps_