Download

Radial Blur PostProcess Material

Hi, View.ViewSizeAndSceneTexelSize is not avaible with UE4.9 , can anyone point me to the documentation of the 4.9 shaders ? thanks.

Use this isntead:
GetPostProcessInputSize(0)

thanks it works.

First of all thanks for the post. I’m a game dev nub so please forgive my ignorance. I manage to get the material to parse without errors thanks to you all with the recent updates to this post however when implementing this in the PostProcessVolume under the blendables all it does is apply a tinted vignette which appears dark blue and changes to black as I approach meshes. Nothing at all as shown in the screenshot. Please help me out UE Yodas. I appreciate any help that can be given.

This is really very nice. I’ve been looking at making this effect for a speed boost

People may also try this custom node for a soft guassian like appearance. lower-cased uv and no extra parameter to adjust weight.


float3 res = 0;
float2 invSize = GetPostProcessInputSize(0).zw;
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] = { -2, -1, 0, 1, 2 };

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

return float4(res, 1);

With that setup how would I adjust the strength of the blur?

Thanks a lot Tomura for this post and jbg for the suggestion to use “GetPostProcessInputSize(0)” instead of “View.ViewSizeAndSceneTexelSize”!

SceneTexture is not supported in Mobile (ES2)
Is there any replacement? Thank you

Thanks to everyone!

Sick work mate! Been wanting something like that to use along with a dash mechanic!!!

Hi Kory, the effect does not seem to be resolution independent. It seems to be always a fixed pixel size. I tried to multiply this out by again multiplying/dividing by invSize.x/y, but it still is resolution dependent.

OK, I found it myself, when trying to find the center for the radial blur: Seems the input ScreenPosition or TexCoord (the UV) are with respect to the wrong port (probably the offscreen). To correct it you need to multiply them with View.RenderTargetSize/ViewSize. See attached screenshot to determine the center:

56242d1cae5b80b53b8c46fc5cfb961335a008b4.png

How to Adjust the Vanishing Point

Hi guys, i’m trying to use this PP material in my 4.11 project

This is the material setup: 3ad3d125f86a1a2fee81ac877b407b844d3c1319.jpeg

This is the result: bf46a133c61f405d3630e77bd6ea0ba1ac889f55.jpeg

How do i adjust the radial blur vanishing point?

Thanks!

I have modified this node to be compatible with 4.12.4. Upon compiling the original HLSL code, the editor threw an undeclared identifier for both View.ViewSizeAndSceneTexelSize and View.RenderTargetSize leading me to believe that Epic has recently renamed these identifiers. You could replace the first line to GetPostProcessInputSize(0).wz; however for the radial blur is then vanishing at the top left corner of the viewport rather than the center of the screen.

I’m not savvy enough in HLSL or UE4’s specific variables and names to know what these have been changed to, however I have produced the same results using the nodes that return those values:

I have simply added a new pin to the custom HLSL node named “ScreenMult” (case-sensitive) and removed the first line of code declaring that variable:


int TexIndex = 14;
float samples[10] = {-0.08,-0.05,-0.03,-0.02,-0.01,0.01,0.02,0.03,0.05,0.08};
float2 dir = ScreenMult * float2(0.5,0.5) - UV; 
float4 sum = SceneTextureLookup(UV, TexIndex, false);
float2 pos = float2(0.0,0.0);
for(int i = 0; i<10; i++)
{
    pos = UV + dir * samples* * sampleDist;
    max(min(pos, ScreenMult * float2(1.0, 1.0)), float2(0.0,0.0));
    sum += SceneTextureLookup(pos, TexIndex, false);
}
sum *= 1.0/11.0;
return sum;

Then simply input the ViewSize / RenderTargetSize math using their nodes.

The result is a proper vanishing point:

In theory, I think setting the ScreenMult variable in the blueprint editor will also allow the user to change the position of the vanishing point manually by changing that value. This would work well if you decide to also move the CenterPosition (V2) on the RadialGradientExponential node.

I copy from above,but it didn’t work in 12.5.Nothing happened.I put it into a post process volume/blend,tick the unbound on.Do some one experienced it too?

Thanks for this great tutorial! It works well in my project, but when I tried to use it in a VR project , there are something wrong with the right eye display. Any suggestions for me? Thank you very much!

Possibly see my post #33](Radial Blur PostProcess Material - Community Content, Tools and Tutorials - Unreal Engine Forums)

It seems that in my situation, it is not about the center, it is the display in right eye has a left and right reversed problem (sorry for my poor English, hope you can understand what I mean:))

Yes, but it might be the same viewport-renderport issue. Your renderport most likely uses an offset for the right eye. by using the postprocess material of my post #33, you can visualize the coordinates. You should have a cross in the center. Else you need to correct for the renderport or viewport-coordinates.