I’m trying to find the outline of the assets in my scene, and then I want to Hue Shift between the object and the color of the background that the line is covering, to get a sort of watercolor bleed effect between all of my assets. I have an outline that uses the custom node to find the edges of my objects using the Laplacian Method. Does anyone know how I would go from this to getting the bleed effect?
Here is the code:
float2 KernelUVs = GetDefaultSceneTextureUV (Parameters, 1);
float2 TexelSize = GetSceneTextureViewSize (1).zw;
float2 PixelUVs;
float KERNEL_SIZE = 2.3;
float ALPHA = 2.5;
float SHAPE_RATIO = 1.6;
float RotationVector = float2(cos(ALPHA), sin(ALPHA));
float3 LaplacianFilter_Normal = float3(0.0, 0.0, 0.0);
float LaplacianFilter_Depth = 0.0;
float CenterWeight = 0.0;
float HALF_KERNEL_SIZE = floor(KERNEL_SIZE/2.0);
float HALF_KERNEL_SIZE_SQ = KERNEL_SIZE*KERNEL_SIZE/4.0;
for(float y = -HALF_KERNEL_SIZE; y <= HALF_KERNEL_SIZE; y++)
{
for(float x = -HALF_KERNEL_SIZE; x <= HALF_KERNEL_SIZE; x++)
{
float2 MarkerPoint = float2(dot(RotationVector, float2(x,y)),
dot(RotationVector, float2(y, -x)));
if(dot(MarkerPoint, MarkerPoint) > HALF_KERNEL_SIZE_SQ)
{
continue;
}
CenterWeight++;
PixelUVs = KernelUVs + TexelSize*float2(x, y);
LaplacianFilter_Normal -= SceneTextureLookup(PixelUVs, 8, false).rgb;
LaplacianFilter_Depth -= SceneTextureLookup(PixelUVs, 1, false).r;
}
}
LaplacianFilter_Normal += SceneTextureLookup(KernelUVs, 8, false).rgb * CenterWeight;
LaplacianFilter_Depth += SceneTextureLookup(KernelUVs, 1, false).r * CenterWeight;
CenterWeight–;
CenterWeight = 1.0 / CenterWeight;
LaplacianFilter_Normal *= CenterWeight;
LaplacianFilter_Depth *= CenterWeight;
return float4(LaplacianFilter_Normal, LaplacianFilter_Depth);
Here is the rest of the graph: