Radial Blur PostProcess Material

A couple of comments, follow the Epic coding standards and make sure you have proper braces. Also use static const FName NAME_BlurAmount(TEXT(“BlurAmount”)); rather that passing the string in directly, it runs 1000x faster IIRC. You also want to cache the MPC and not load it all of the time.

That’s just quick code I was writing to debug this thing, but thanks for the input! We often forget the cost of creating new strings. I won’t follow Epic’s standard though :wink:

Hi, Dorian000, Would you like explain more about how to handle radial blur in VR ?
Thank you.

But How Do I Use For Stuff Like Lets Say I Am Dashing And At A Certain Speed The Same Effect As You Showed Happens So whats the steps ?

Hello guys. Thanks for this method. I used radial blur for android in 4.16 version and this worked cool, but after 4.17 This material not work. I have crash in my mobile (galaxy S8).

The material doesn’t want to work in my case. I have the following problem : undeclare identifier ‘View_ViewSizeAndSceneTexelSize’
Any idea what I did wrong ?

By the way I’m using ue4.18

Hi guys !

I can’t get it to work. There is a problem with the HLSL code in ue4.18. It says there is an unideclared identifier View_ViewSizeAndSceneTexelSize…

Any Idea what could have replaced that identifier in the latest versions of unreal engine ?

I too am also getting the same error in 4.18.

Hey all, here’s what I use in 4.18. Pretty much the same result. Probably need to factor in texel size though.



float2 ScreenMult = View.BufferSizeAndInvSize.xy / ViewSize;
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) - ScreenUV;
float4 sum = SceneTextureLookup(ScreenUV, TexIndex, false);
float2 pos = float2(0.0,0.0);
for(int i = 0; i<10; i++)
{
    pos = ScreenUV + dir * samples* * BlurDist;
    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;


@TheJamsh The function SceneTextureLookup gives me an error, how can i fix it?

Make sure you’re in version 4.18 and above, and ensure it’s a post process material.

I used it on 4.18 and worked well. I only had to change ViewSize to View.ViewSizeAndInvSize.xy on line 1.
Here is complete list of ViewUniformShaderParameters parameters: https://docs.unrealengine.com/latest…ers/index.html

Complete code after change, remember to add ScreenUV, Tex and BlurDist inputs:



float2 ScreenMult = View.BufferSizeAndInvSize.xy / View.ViewSizeAndInvSize.xy;
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) - ScreenUV;
float4 sum = SceneTextureLookup(ScreenUV, TexIndex, false);
float2 pos = float2(0.0,0.0);

for(int i = 0; i<10; i++)
{
    pos = ScreenUV + dir * samples* * BlurDist;
    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;


Has anyone got this material working in 4.19?

The viewport window seems to double up when the viewport isn’t scaled to 100% size.

I thought it might have something to do with the new changes to the ScreenPosition/SceneTexture nodes.

Try this:


const float2 ScreenMult = View.ViewSizeAndInvSize.xy * View.BufferSizeAndInvSize.zw;

const int TexIndex = 14;
const float Samples[11] = {-0.08,-0.05,-0.03,-0.02,-0.01,0,0.01,0.02,0.03,0.05,0.08};

float2 dir = float2(0.5,0.5) - ViewportUV;
float4 sum = float4(0.0, 0.0, 0.0, 0.0);
for(int i = 0; i<11; i++)
{
    float2 pos = ViewportUV + dir * Samples* * BlurDist;
    pos = clamp(pos, float2(0.0,0.0), float2(1.0, 1.0));
    sum += SceneTextureLookup(pos * ScreenMult, TexIndex, false);
}

return sum / 11.0;

Yep, that worked great in my 4.19 project, thanks for the help!

Anyone got this material working in 4.19 after enabled “Temporal Upsampling” ?

Cool!
Thank you, I was looking for a tutorial on this.

Hi. I’m fairly new to blue printing and was wondering if you would be willing to show me how to replicate this in 4.19. I’ve tried myself but cant seem to make it work.

This was very useful. Many thanks.

I’m currently using a modified version of the script which allows control of the radial center, as well as the gain and number of samples. It works in 4.19.



int TexIndex = 14;                               // Equivalent to the index of the PostProcessInput0 on the SceneTexture node
float2 dir = (ScreenMult * Center - UV) * -1;  // Directon of the blur
float4 sum = SceneTextureLookup(ViewportUVToSceneTextureUV(UV,TexIndex), TexIndex, false);  // Initial lookup of the seen, unaffected by blur
float2 pos = float2(0.0,0.0);                  // Initializing variable 'pos'
float currentValue = 0;                           // Initializing variable 'currentValue'
float delta = sampleDist/Samples;              // The distance of each sampling step. The more steps, the smaller the distance

// Loop for each sample
for(int i = 0; i<Samples; i++)
{
    // new sample position
    pos = UV + dir * currentValue;
    pos = max(min(pos, ScreenMult * float2(1.0, 1.0)), float2(0.0,0.0));

    // Look up and add. The higher 'i', the lower the strength of the addition
    sum += SceneTextureLookup(ViewportUVToSceneTextureUV(pos,TexIndex), TexIndex, false)* (Samples - i)*2/Samples ;

    currentValue -= delta;
}

// Gain control
sum *= 1.0/((Samples/Gain)+1);

return sum;


Im having troubles making this work on mobile ES2.
Some comment in this thread from 2015 says ES2 does not SceneTextures while the documentations states PostProcessInput0 is supported. (see screenshot + link)
Rendering Features for Mobile Games in Unreal Engine | Unreal Engine 5.2 Documentation -> just CTRL+F “PostProcessInput0” or look below

Any idea how what the problem could be?

If have tried only using the PostProcessInput0 and multipling it by some float4 to give it a tint and that did work.
I assume the problem is the “SceneTextureLookup()”, I could be wrong.
Mobile HDR is enabled and other Post Processing effects (like DoF) work on mobile.

Thanks!