Blurred Vignette

Hello, I would like to get a blurred vignette like this :
It’s a post process material that I can’t do

Thanks

Hey there @Alexdeez! Welcome back to the community! Did you need help with making the post processing material or did you need another way because you couldn’t use a post processing material? If you needed help with it, here’s an example of a radial gradient blur with a custom blur node from the community:

Here’s the code for the custom blur node:

float3 res = 0;

//new - get invSize from here
float2 invSize = View.ViewSizeAndInvSize.zw;

//new - we need to fix uv coordinates like this (still seems to be a bug in 4.21)
uv = ViewportUVToSceneTextureUV(uv,14);

int TexIndex = 14;
float weights[] = { 0.01, 0.02, 0.04, 0.02, 0.01, 0.02, 0.04, 0.08, 0.04, 0.02, 0.04, 0.08, 0.16, 0.08, 0.04, 0.02, 0.04, 0.08, 0.04, 0.02, 0.01, 0.02, 0.04, 0.02, 0.01};

float offsets[] = { -4, -2, 0, 4, 2 };

if(Mask <= 0.01) return SceneTextureLookup(uv, TexIndex, false);

uv *= 0.5;
for (int i = 0; i < 5; ++i)
{
float v = uv.y + offsets[i] * invSize.y * Mask * BlurStrength;
int temp = i * 5;
for (int j = 0; j < 5; ++j)
{
float u = uv.x + offsets[j] * invSize.x * Mask * BlurStrength;
float2 uvShifted = uv + float2(u, v);
float weight = weights[temp + j];
float3 tex = SceneTextureLookup(uvShifted, TexIndex, false);
res += tex * weight;
}
}

return float4(res, 1);
1 Like

Im getting thoses errors :
I’m in version ue5.4

@Alexdeez double check if you didn’t misspell “BlurStrength” as “BlurStrenght” inside of the custom node parameters. I’m guessing you may have switched up the t & h somewhere, creating a new parameter.

1 Like

Please give the solution to SuportiveEntity. I just pointed out a typo in the code that happened probably by accident.

He offered the solution itself :slight_smile:

1 Like

Yes sorry i have missclicked

Just to verify, Raven’s suggestion worked out for you and everything is working now right?

Yes, but the blur is buggy, look at this

There seems to be some sort of offset that is throwing off the center of the blur lookup. It sort of looks like it’s off center in it’s calculations.

If you mess with the radius you can see that the y axis almost seems too effected by the parameter.