Thanks for doing most of the legwork, I did this in between compiling Squad so please do us a favor and please purchase it on Steam, I would appreciate it.
In the following picture you can see the right half is blurry with the filter but the left half is normal.
Here is the code (remove the if (UV.x < 0.5) check to make it apply to the entire image):
int TexIndex = 14;
float2 invSize = GetPostProcessInputSize(0).zw;
float offsets] = { -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7 };
#define SIGMA 10.0
#define BSIGMA 0.1
#define MSIZE 15
#define normpdf(x, sigma) 0.39894*exp(-0.5*x*x/(sigma*sigma))/sigma
#define normpdf3(v, sigma) 0.39894*exp(-0.5*dot(v,v)/(sigma*sigma))/sigma
const int kSize = (MSIZE-1)/2;
float kernel[MSIZE] = {0.031225216, 0.033322271, 0.035206333, 0.036826804, 0.038138565, 0.039104044, 0.039695028, 0.039894000, 0.039695028, 0.039104044, 0.038138565, 0.036826804, 0.035206333, 0.033322271, 0.031225216};
float3 final_colour = float3(0,0,0);
if (UV.x < 0.5)
{
return c;
}
float Z = 0.0;
float3 cc;
float factor;
float bZ = 1.0/normpdf(0.0, BSIGMA);
[unroll(15)]
for (int i=-kSize; i <= kSize; ++i)
{
float v = UV.y + offsets[i+kSize] * invSize.y;
[unroll(15)]
for (int j=-kSize; j <= kSize; ++j)
{
float u = UV.x + offsets[j+kSize] * invSize.x;
float2 uvShifted = float2(u, v);
cc = SceneTextureLookup(uvShifted, TexIndex, false);
factor = normpdf3(cc-c, BSIGMA)*bZ*kernel[kSize+j]*kernel[kSize+i];
Z += factor;
final_colour += factor*cc;
}
}
return float4(final_colour/Z, 1.0);
Here is my material layout for this image as well (you can actually just copy and paste this and it should work with a Material Domain set to Post Process):
Begin Object Class=MaterialGraphNode_Root Name="MaterialGraphNode_Root_1"
Begin Object Class=EdGraphPin Name="EdGraphPin_249272"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249271"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249270"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249269"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249268"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249267"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249266"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249265"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249264"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249263"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249262"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249261"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249260"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249259"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249258"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249257"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249256"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249255"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249254"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249253"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249252"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249251"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249250"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249249"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249248"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249247"
End Object
Begin Object Name="EdGraphPin_249272"
PinName="Material Attributes"
PinType=(PinCategory="materialinput")
End Object
Begin Object Name="EdGraphPin_249271"
PinName="Pixel Depth Offset"
PinType=(PinCategory="materialinput")
End Object
Begin Object Name="EdGraphPin_249270"
PinName="Customized UV7"
PinType=(PinCategory="materialinput")
End Object
Begin Object Name="EdGraphPin_249269"
PinName="Customized UV6"
PinType=(PinCategory="materialinput")
End Object
Begin Object Name="EdGraphPin_249268"
PinName="Customized UV5"
PinType=(PinCategory="materialinput")
End Object
Begin Object Name="EdGraphPin_249267"
PinName="Customized UV4"
PinType=(PinCategory="materialinput")
End Object
Begin Object Name="EdGraphPin_249266"
PinName="Customized UV3"
PinType=(PinCategory="materialinput")
End Object
Begin Object Name="EdGraphPin_249265"
PinName="Customized UV2"
PinType=(PinCategory="materialinput")
End Object
Begin Object Name="EdGraphPin_249264"
PinName="Customized UV1"
PinType=(PinCategory="materialinput")
End Object
Begin Object Name="EdGraphPin_249263"
PinName="Customized UV0"
PinType=(PinCategory="materialinput")
End Object
Begin Object Name="EdGraphPin_249262"
PinName="Refraction"
PinType=(PinCategory="materialinput")
End Object
Begin Object Name="EdGraphPin_249261"
PinName="Ambient Occlusion"
PinType=(PinCategory="materialinput")
End Object
Begin Object Name="EdGraphPin_249260"
PinName="Clear Coat Roughness"
PinType=(PinCategory="materialinput")
End Object
Begin Object Name="EdGraphPin_249259"
PinName="Clear Coat"
PinType=(PinCategory="materialinput")
End Object
Begin Object Name="EdGraphPin_249258"
PinName="Subsurface Color"
PinType=(PinCategory="materialinput")
End Object
Begin Object Name="EdGraphPin_249257"
PinName="Tessellation Multiplier"
PinType=(PinCategory="materialinput")
End Object
Begin Object Name="EdGraphPin_249256"
PinName="World Displacement"
PinType=(PinCategory="materialinput")
End Object
Begin Object Name="EdGraphPin_249255"
PinName="World Position Offset"
PinType=(PinCategory="materialinput")
End Object
Begin Object Name="EdGraphPin_249254"
PinName="Normal"
PinType=(PinCategory="materialinput")
End Object
Begin Object Name="EdGraphPin_249253"
PinName="Opacity Mask"
PinType=(PinCategory="materialinput")
End Object
Begin Object Name="EdGraphPin_249252"
PinName="Opacity"
PinType=(PinCategory="materialinput")
End Object
Begin Object Name="EdGraphPin_249251"
PinName="Emissive Color"
PinType=(PinCategory="materialinput")
LinkedTo(0)=EdGraphPin'MaterialGraphNode_10.EdGraphPin_249276'
End Object
Begin Object Name="EdGraphPin_249250"
PinName="Roughness"
PinType=(PinCategory="materialinput")
End Object
Begin Object Name="EdGraphPin_249249"
PinName="Specular"
PinType=(PinCategory="materialinput")
End Object
Begin Object Name="EdGraphPin_249248"
PinName="Metallic"
PinType=(PinCategory="materialinput")
End Object
Begin Object Name="EdGraphPin_249247"
PinName="Base Color"
PinType=(PinCategory="materialinput")
End Object
Material=PreviewMaterial'/Engine/Transient.M_PostProcess_BiLateral'
Pins(0)=EdGraphPin'EdGraphPin_249247'
Pins(1)=EdGraphPin'EdGraphPin_249248'
Pins(2)=EdGraphPin'EdGraphPin_249249'
Pins(3)=EdGraphPin'EdGraphPin_249250'
Pins(4)=EdGraphPin'EdGraphPin_249251'
Pins(5)=EdGraphPin'EdGraphPin_249252'
Pins(6)=EdGraphPin'EdGraphPin_249253'
Pins(7)=EdGraphPin'EdGraphPin_249254'
Pins(8)=EdGraphPin'EdGraphPin_249255'
Pins(9)=EdGraphPin'EdGraphPin_249256'
Pins(10)=EdGraphPin'EdGraphPin_249257'
Pins(11)=EdGraphPin'EdGraphPin_249258'
Pins(12)=EdGraphPin'EdGraphPin_249259'
Pins(13)=EdGraphPin'EdGraphPin_249260'
Pins(14)=EdGraphPin'EdGraphPin_249261'
Pins(15)=EdGraphPin'EdGraphPin_249262'
Pins(16)=EdGraphPin'EdGraphPin_249263'
Pins(17)=EdGraphPin'EdGraphPin_249264'
Pins(18)=EdGraphPin'EdGraphPin_249265'
Pins(19)=EdGraphPin'EdGraphPin_249266'
Pins(20)=EdGraphPin'EdGraphPin_249267'
Pins(21)=EdGraphPin'EdGraphPin_249268'
Pins(22)=EdGraphPin'EdGraphPin_249269'
Pins(23)=EdGraphPin'EdGraphPin_249270'
Pins(24)=EdGraphPin'EdGraphPin_249271'
Pins(25)=EdGraphPin'EdGraphPin_249272'
NodeGuid=4D99DDC344535A733185B684C84B3F66
End Object
Begin Object Class=MaterialGraphNode Name="MaterialGraphNode_10"
Begin Object Class=EdGraphPin Name="EdGraphPin_249276"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249275"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249274"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249273"
End Object
Begin Object Class=MaterialExpressionLinearInterpolate Name="MaterialExpressionLinearInterpolate_0"
End Object
Begin Object Name="EdGraphPin_249276"
PinName="Output"
PinFriendlyName=" "
Direction=EGPD_Output
LinkedTo(0)=EdGraphPin'MaterialGraphNode_Root_1.EdGraphPin_249251'
End Object
Begin Object Name="EdGraphPin_249275"
PinName="Alpha"
PinType=(PinCategory="optional")
LinkedTo(0)=EdGraphPin'MaterialGraphNode_16.EdGraphPin_249292'
End Object
Begin Object Name="EdGraphPin_249274"
PinName="B"
PinType=(PinCategory="optional")
LinkedTo(0)=EdGraphPin'MaterialGraphNode_12.EdGraphPin_249279'
End Object
Begin Object Name="EdGraphPin_249273"
PinName="A"
PinType=(PinCategory="optional")
LinkedTo(0)=EdGraphPin'MaterialGraphNode_20.EdGraphPin_249321'
End Object
Begin Object Name="MaterialExpressionLinearInterpolate_0"
A=(Expression=MaterialExpressionCustom'MaterialGraphNode_20.MaterialExpressionCustom_3')
B=(Expression=MaterialExpressionSceneTexture'MaterialGraphNode_12.MaterialExpressionSceneTexture_0',Mask=1,MaskR=1,MaskG=1,MaskB=1,MaskA=1)
Alpha=(Expression=MaterialExpressionMaterialFunctionCall'MaterialGraphNode_16.MaterialExpressionMaterialFunctionCall_1')
MaterialExpressionEditorX=-176
MaterialExpressionEditorY=112
MaterialExpressionGuid=43A9AE0049A776174A0B92B054C6AB5B
Material=PreviewMaterial'/Engine/Transient.M_PostProcess_BiLateral'
End Object
MaterialExpression=MaterialExpressionLinearInterpolate'MaterialExpressionLinearInterpolate_0'
Pins(0)=EdGraphPin'EdGraphPin_249273'
Pins(1)=EdGraphPin'EdGraphPin_249274'
Pins(2)=EdGraphPin'EdGraphPin_249275'
Pins(3)=EdGraphPin'EdGraphPin_249276'
NodePosX=-176
NodePosY=112
ErrorType=1
ErrorMsg="Coercion failed: MaterialFloat3 Local1 = CustomExpression0(Parameters,Local0);
: float3 -> unknown"
NodeGuid=8B64A7D348ACB301F8A1AF8FF0696888
End Object
Begin Object Class=MaterialGraphNode Name="MaterialGraphNode_11"
Begin Object Class=EdGraphPin Name="EdGraphPin_249277"
End Object
Begin Object Class=MaterialExpressionScreenPosition Name="MaterialExpressionScreenPosition_0"
End Object
Begin Object Name="EdGraphPin_249277"
PinName="Output"
PinFriendlyName=" "
Direction=EGPD_Output
LinkedTo(0)=EdGraphPin'MaterialGraphNode_12.EdGraphPin_249278'
LinkedTo(1)=EdGraphPin'MaterialGraphNode_20.EdGraphPin_249319'
End Object
Begin Object Name="MaterialExpressionScreenPosition_0"
MaterialExpressionEditorX=-1024
MaterialExpressionEditorY=-16
MaterialExpressionGuid=FE15A11344CA53920E5DD2A0BDB2D846
Material=PreviewMaterial'/Engine/Transient.M_PostProcess_BiLateral'
End Object
MaterialExpression=MaterialExpressionScreenPosition'MaterialExpressionScreenPosition_0'
Pins(0)=EdGraphPin'EdGraphPin_249277'
NodePosX=-1024
NodePosY=-16
NodeGuid=79E10690463A07CEB3588AA09FA437E5
End Object
Begin Object Class=MaterialGraphNode Name="MaterialGraphNode_12"
Begin Object Class=EdGraphPin Name="EdGraphPin_249281"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249280"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249279"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249278"
End Object
Begin Object Class=MaterialExpressionSceneTexture Name="MaterialExpressionSceneTexture_0"
End Object
Begin Object Name="EdGraphPin_249281"
PinName="InvSize"
Direction=EGPD_Output
End Object
Begin Object Name="EdGraphPin_249280"
PinName="Size"
Direction=EGPD_Output
End Object
Begin Object Name="EdGraphPin_249279"
PinName="Color"
Direction=EGPD_Output
PinType=(PinCategory="mask")
LinkedTo(0)=EdGraphPin'MaterialGraphNode_10.EdGraphPin_249274'
LinkedTo(1)=EdGraphPin'MaterialGraphNode_20.EdGraphPin_249320'
End Object
Begin Object Name="EdGraphPin_249278"
PinName="UVs"
PinType=(PinCategory="optional")
LinkedTo(0)=EdGraphPin'MaterialGraphNode_11.EdGraphPin_249277'
End Object
Begin Object Name="MaterialExpressionSceneTexture_0"
Coordinates=(Expression=MaterialExpressionScreenPosition'MaterialGraphNode_11.MaterialExpressionScreenPosition_0')
SceneTextureId=PPI_PostProcessInput0
MaterialExpressionEditorX=-768
MaterialExpressionEditorY=128
MaterialExpressionGuid=1203879E411BCB45BC5F2DA7A5423DD1
Material=PreviewMaterial'/Engine/Transient.M_PostProcess_BiLateral'
End Object
MaterialExpression=MaterialExpressionSceneTexture'MaterialExpressionSceneTexture_0'
Pins(0)=EdGraphPin'EdGraphPin_249278'
Pins(1)=EdGraphPin'EdGraphPin_249279'
Pins(2)=EdGraphPin'EdGraphPin_249280'
Pins(3)=EdGraphPin'EdGraphPin_249281'
NodePosX=-768
NodePosY=128
NodeGuid=D155171040284E49BF20138CE0CCA779
End Object
Begin Object Class=MaterialGraphNode Name="MaterialGraphNode_14"
Begin Object Class=EdGraphPin Name="EdGraphPin_249285"
End Object
Begin Object Class=MaterialExpressionScalarParameter Name="MaterialExpressionScalarParameter_0"
End Object
Begin Object Name="EdGraphPin_249285"
PinName="Output"
PinFriendlyName=" "
Direction=EGPD_Output
End Object
Begin Object Name="MaterialExpressionScalarParameter_0"
DefaultValue=0.400000
ParameterName="BlurAmount"
ExpressionGUID=87FFC26A4E27FD512C77E290396F7DBD
MaterialExpressionEditorX=-656
MaterialExpressionEditorY=48
MaterialExpressionGuid=D865857F4D4247CCA5D256B0E5EE7780
Material=PreviewMaterial'/Engine/Transient.M_PostProcess_BiLateral'
End Object
MaterialExpression=MaterialExpressionScalarParameter'MaterialExpressionScalarParameter_0'
Pins(0)=EdGraphPin'EdGraphPin_249285'
NodePosX=-656
NodePosY=48
bCanRenameNode=True
NodeGuid=C8EEBABE40F7D2E47FD061BCA2A32261
End Object
Begin Object Class=MaterialGraphNode Name="MaterialGraphNode_15"
Begin Object Class=EdGraphPin Name="EdGraphPin_249286"
End Object
Begin Object Class=MaterialExpressionMaterialFunctionCall Name="MaterialExpressionMaterialFunctionCall_0"
End Object
Begin Object Name="EdGraphPin_249286"
PinName="Result"
Direction=EGPD_Output
LinkedTo(0)=EdGraphPin'MaterialGraphNode_16.EdGraphPin_249287'
End Object
Begin Object Name="MaterialExpressionMaterialFunctionCall_0"
MaterialFunction=MaterialFunction'/Engine/Functions/Engine_MaterialFunctions02/Texturing/ScreenAlignedUVs.ScreenAlignedUVs'
FunctionOutputs(0)=(ExpressionOutputId=0B62F82A4407238F0BA4FE86805D8B50,Output=(OutputName="Result"))
MaterialExpressionEditorX=-768
MaterialExpressionEditorY=272
MaterialExpressionGuid=98969B6F4B879034F9AD6F8A776EB2CF
Material=PreviewMaterial'/Engine/Transient.M_PostProcess_BiLateral'
Outputs(0)=(OutputName="Result")
End Object
MaterialExpression=MaterialExpressionMaterialFunctionCall'MaterialExpressionMaterialFunctionCall_0'
Pins(0)=EdGraphPin'EdGraphPin_249286'
NodePosX=-768
NodePosY=272
NodeGuid=33F85DE247CF887DFCA227A7306D9121
End Object
Begin Object Class=MaterialGraphNode Name="MaterialGraphNode_16"
Begin Object Class=EdGraphPin Name="EdGraphPin_249292"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249291"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249290"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249289"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249288"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249287"
End Object
Begin Object Class=MaterialExpressionMaterialFunctionCall Name="MaterialExpressionMaterialFunctionCall_1"
End Object
Begin Object Name="EdGraphPin_249292"
PinName="RadialGradientExponential"
Direction=EGPD_Output
LinkedTo(0)=EdGraphPin'MaterialGraphNode_10.EdGraphPin_249275'
End Object
Begin Object Name="EdGraphPin_249291"
PinName="Invert Density (B)"
PinType=(PinCategory="optional")
End Object
Begin Object Name="EdGraphPin_249290"
PinName="Density (S)"
PinType=(PinCategory="optional")
LinkedTo(0)=EdGraphPin'MaterialGraphNode_18.EdGraphPin_249294'
End Object
Begin Object Name="EdGraphPin_249289"
PinName="Radius (S)"
PinType=(PinCategory="optional")
LinkedTo(0)=EdGraphPin'MaterialGraphNode_17.EdGraphPin_249293'
End Object
Begin Object Name="EdGraphPin_249288"
PinName="CenterPosition (V2)"
PinType=(PinCategory="optional")
End Object
Begin Object Name="EdGraphPin_249287"
PinName="UVs (V2)"
PinType=(PinCategory="optional")
LinkedTo(0)=EdGraphPin'MaterialGraphNode_15.EdGraphPin_249286'
End Object
Begin Object Name="MaterialExpressionMaterialFunctionCall_1"
MaterialFunction=MaterialFunction'/Engine/Functions/Engine_MaterialFunctions01/Gradient/RadialGradientExponential.RadialGradientExponential'
FunctionInputs(0)=(ExpressionInputId=D38E6C0F499293F6CC65C0AE55AE0D4E,Input=(Expression=MaterialExpressionMaterialFunctionCall'MaterialGraphNode_15.MaterialExpressionMaterialFunctionCall_0',InputName="UVs"))
FunctionInputs(1)=(ExpressionInputId=2997555B436C735459B9D695B58F219E,Input=(OutputIndex=-1,InputName="CenterPosition"))
FunctionInputs(2)=(ExpressionInputId=B330351C4B254660CCDCA5923C8F3F26,Input=(Expression=MaterialExpressionScalarParameter'MaterialGraphNode_17.MaterialExpressionScalarParameter_1',InputName="Radius"))
FunctionInputs(3)=(ExpressionInputId=2B61E834449DAE3BC4D079B953B5DE0E,Input=(Expression=MaterialExpressionScalarParameter'MaterialGraphNode_18.MaterialExpressionScalarParameter_2',InputName="Density"))
FunctionInputs(4)=(ExpressionInputId=7D5AC5254448D12A92351AA36BEED90A,Input=(OutputIndex=-1,InputName="Invert Density"))
FunctionOutputs(0)=(ExpressionOutputId=8D0763534D7AAC86623FB1AE8CD0CC39,Output=(OutputName="RadialGradientExponential"))
MaterialExpressionEditorX=-528
MaterialExpressionEditorY=272
MaterialExpressionGuid=5249FC1140C4BF1C89A75C8FC79CADE0
Material=PreviewMaterial'/Engine/Transient.M_PostProcess_BiLateral'
Outputs(0)=(OutputName="RadialGradientExponential")
End Object
MaterialExpression=MaterialExpressionMaterialFunctionCall'MaterialExpressionMaterialFunctionCall_1'
Pins(0)=EdGraphPin'EdGraphPin_249287'
Pins(1)=EdGraphPin'EdGraphPin_249288'
Pins(2)=EdGraphPin'EdGraphPin_249289'
Pins(3)=EdGraphPin'EdGraphPin_249290'
Pins(4)=EdGraphPin'EdGraphPin_249291'
Pins(5)=EdGraphPin'EdGraphPin_249292'
NodePosX=-528
NodePosY=272
NodeGuid=DFCECBF04FC08F0CF3767EAE618E13E0
End Object
Begin Object Class=MaterialGraphNode Name="MaterialGraphNode_17"
Begin Object Class=EdGraphPin Name="EdGraphPin_249293"
End Object
Begin Object Class=MaterialExpressionScalarParameter Name="MaterialExpressionScalarParameter_1"
End Object
Begin Object Name="EdGraphPin_249293"
PinName="Output"
PinFriendlyName=" "
Direction=EGPD_Output
LinkedTo(0)=EdGraphPin'MaterialGraphNode_16.EdGraphPin_249289'
End Object
Begin Object Name="MaterialExpressionScalarParameter_1"
DefaultValue=0.600000
ParameterName="BlurRadius"
ExpressionGUID=14CEA299455A9BD9DEC4F6AC9C9E3769
MaterialExpressionEditorX=-768
MaterialExpressionEditorY=336
MaterialExpressionGuid=EFEF8E50429ABB12D8E61CBC0E726D50
Material=PreviewMaterial'/Engine/Transient.M_PostProcess_BiLateral'
End Object
MaterialExpression=MaterialExpressionScalarParameter'MaterialExpressionScalarParameter_1'
Pins(0)=EdGraphPin'EdGraphPin_249293'
NodePosX=-768
NodePosY=336
bCanRenameNode=True
NodeGuid=00AAE45A49C62C6E85CDC480A6706FF6
End Object
Begin Object Class=MaterialGraphNode Name="MaterialGraphNode_18"
Begin Object Class=EdGraphPin Name="EdGraphPin_249294"
End Object
Begin Object Class=MaterialExpressionScalarParameter Name="MaterialExpressionScalarParameter_2"
End Object
Begin Object Name="EdGraphPin_249294"
PinName="Output"
PinFriendlyName=" "
Direction=EGPD_Output
LinkedTo(0)=EdGraphPin'MaterialGraphNode_16.EdGraphPin_249290'
End Object
Begin Object Name="MaterialExpressionScalarParameter_2"
DefaultValue=2.000000
ParameterName="RadiusExponent"
ExpressionGUID=81EB1FEA452017AC4F415CB5DC532E36
MaterialExpressionEditorX=-768
MaterialExpressionEditorY=416
MaterialExpressionGuid=7F1951BE4D6B4D01721363BD02870009
Material=PreviewMaterial'/Engine/Transient.M_PostProcess_BiLateral'
End Object
MaterialExpression=MaterialExpressionScalarParameter'MaterialExpressionScalarParameter_2'
Pins(0)=EdGraphPin'EdGraphPin_249294'
NodePosX=-768
NodePosY=416
bCanRenameNode=True
NodeGuid=7B448622491C6E915DE741AFD00C1E36
End Object
Begin Object Class=MaterialGraphNode Name="MaterialGraphNode_20"
Begin Object Class=EdGraphPin Name="EdGraphPin_249321"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249320"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_249319"
End Object
Begin Object Class=MaterialExpressionCustom Name="MaterialExpressionCustom_3"
End Object
Begin Object Name="EdGraphPin_249321"
PinName="Output"
PinFriendlyName=" "
Direction=EGPD_Output
LinkedTo(0)=EdGraphPin'MaterialGraphNode_10.EdGraphPin_249273'
End Object
Begin Object Name="EdGraphPin_249320"
PinName="c"
PinType=(PinCategory="required")
LinkedTo(0)=EdGraphPin'MaterialGraphNode_12.EdGraphPin_249279'
End Object
Begin Object Name="EdGraphPin_249319"
PinName="UV"
PinType=(PinCategory="required")
LinkedTo(0)=EdGraphPin'MaterialGraphNode_11.EdGraphPin_249277'
End Object
Begin Object Name="MaterialExpressionCustom_3"
Code="int TexIndex = 14;
float2 invSize = GetPostProcessInputSize(0).zw;
float offsets] = { -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7 };
#define SIGMA 10.0
#define BSIGMA 0.1
#define MSIZE 15
#define normpdf(x, sigma) 0.39894*exp(-0.5*x*x/(sigma*sigma))/sigma
#define normpdf3(v, sigma) 0.39894*exp(-0.5*dot(v,v)/(sigma*sigma))/sigma
const int kSize = (MSIZE-1)/2;
float kernel[MSIZE] = {0.031225216, 0.033322271, 0.035206333, 0.036826804, 0.038138565, 0.039104044, 0.039695028, 0.039894000, 0.039695028, 0.039104044, 0.038138565, 0.036826804, 0.035206333, 0.033322271, 0.031225216};
float3 final_colour = float3(0,0,0);
if (UV.x < 0.5)
{
return c;
}
float Z = 0.0;
float3 cc;
float factor;
float bZ = 1.0/normpdf(0.0, BSIGMA);
[unroll(15)]
for (int i=-kSize; i <= kSize; ++i)
{
float v = UV.y + offsets[i+kSize] * invSize.y;
[unroll(15)]
for (int j=-kSize; j <= kSize; ++j)
{
float u = UV.x + offsets[j+kSize] * invSize.x;
float2 uvShifted = float2(u, v);
cc = SceneTextureLookup(uvShifted, TexIndex, false);
factor = normpdf3(cc-c, BSIGMA)*bZ*kernel[kSize+j]*kernel[kSize+i];
Z += factor;
final_colour += factor*cc;
}
}
return float4(final_colour/Z, 1.0);"
OutputType=CMOT_Float4
Description="BiLateral"
Inputs(0)=(InputName="UV",Input=(Expression=MaterialExpressionScreenPosition'MaterialGraphNode_11.MaterialExpressionScreenPosition_0'))
Inputs(1)=(InputName="c",Input=(Expression=MaterialExpressionSceneTexture'MaterialGraphNode_12.MaterialExpressionSceneTexture_0',Mask=1,MaskR=1,MaskG=1,MaskB=1,MaskA=1))
MaterialExpressionEditorX=-480
MaterialExpressionGuid=348C71E74317394FC9148E9FCD5C21F4
Material=PreviewMaterial'/Engine/Transient.M_PostProcess_BiLateral'
End Object
MaterialExpression=MaterialExpressionCustom'MaterialExpressionCustom_3'
Pins(0)=EdGraphPin'EdGraphPin_249319'
Pins(1)=EdGraphPin'EdGraphPin_249320'
Pins(2)=EdGraphPin'EdGraphPin_249321'
NodePosX=-480
ErrorType=1
ErrorMsg="Custom material BiLateral missing input 2 (sceneTexture)"
NodeGuid=FF42280C4C01FFA50887B881B036A268
End Object