Announcement

Collapse
No announcement yet.

Radial Blur PostProcess Material

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    Does anyone know why it might not work in 4.11? I've followed along with the examples I've seen here, but...it just doesn't DO anything. It doesn't create any errors, it just doesn't work.

    Leave a comment:


  • replied
    Sorry for the long delay on responding everyone. I didn’t see any notifications via email! I shared a zip of a VR version a while back, don’t remember what engine version it was or if it will still work but here’s the link:
    https://forums.unrealengine.com/file...tch?id=1502738

    Leave a comment:


  • replied
    Originally posted by Keytotruth View Post
    Has anyone managed to get this working on UE4.22?
    Mine still works in 4.22



    Custom node code is:

    Code:
    int TexIndex = 14;
    float2 dir = ScreenMult * Center - UV + Distortion; 
    float4 sum = SceneTextureLookup(ViewportUVToSceneTextureUV(UV,TexIndex), TexIndex, false);
    float2 pos = float2(0.0,0.0);
    float delta = sampleDist/Samples;
    float initial =  Samples/2 * delta;
    float currentValue = initial;
    for(int i = 0; i<Samples; i++)
    {
        pos = UV + dir * currentValue;
        pos = max(min(pos, ScreenMult * float2(1.0, 1.0)), float2(0.0,0.0));
        sum += SceneTextureLookup(ViewportUVToSceneTextureUV(pos,TexIndex), TexIndex, false)* i*2/Samples ;
        currentValue -= delta;
    }
    sum *= 1.0/((Samples/Gain)+1);
    return sum;
    Nodes

    Leave a comment:


  • replied
    Has anyone managed to get this working on UE4.22?

    Leave a comment:


  • replied
    I was able to solve right and bottom edges.
    Use "ViewportUVToSceneTextureUV"
    https://answers.unrealengine.com/que...stom-node.html

    Code:
    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[i] * BlurDist;
        pos = clamp(pos, float2(0.0,0.0), float2(1.0, 1.0));
        sum += SceneTextureLookup(ViewportUVToSceneTextureUV(pos * ScreenMult, TexIndex), TexIndex, false);
    }
    
    return sum / 11.0;

    Leave a comment:


  • replied
    Originally posted by Bevman00 View Post
    I've got the material working in a slightly different way using moadib's code in 4.20.3, here's the material, and a video workflow: https://www.youtube.com/watch?v=4ccBjlAFt0s

    Just in case anyone is interested
    I tried your sollution but it doesn't work on 4.21
    is there any change required ?

    Leave a comment:


  • replied
    does it work in 4.20, i heard there are problems with hlsl in ue4.20

    Leave a comment:


  • replied
    Does any of you have a version of this that just blurs ? With no radial involved

    Leave a comment:


  • replied
    Originally posted by WardVanBever View Post
    Im having troubles making this work on mobile ES2.
    Some comment in this thread from 2015 says ES2 does not support SceneTextures while the documentations states PostProcessInput0 is supported. (see screenshot + link)
    https://docs.unrealengine.com/en-us/...ProcessEffects -> just CTRL+F "PostProcessInput0" or look below
    Click image for larger version  Name:	PostProcessInput0Supported.PNG Views:	1 Size:	220.7 KB ID:	1522014

    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!
    To use "MobileSceneTextureLookup()" instead of "SceneTextureLookup()".

    For Mobile Example:
    Code:
    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) - ScreenUV;
    float4 sum = float4(0.0, 0.0, 0.0, 0.0);
    for(int i = 0; i<11; i++)
    {
        float2 pos = ScreenUV + dir * Samples[i] * BlurDist;
        pos = clamp(pos, float2(0.0,0.0), float2(1.0, 1.0));
    #if (ES2_PROFILE || ES3_1_PROFILE || MOBILE_EMULATION)
        sum += MobileSceneTextureLookup(Parameters, TexIndex, pos * ScreenMult);
    #else
        sum += SceneTextureLookup(pos * ScreenMult, TexIndex, false);
    #endif
    }
    
    return sum / 11.0;
    Works fine

    Leave a comment:


  • replied
    I've got the material working in a slightly different way using moadib's code in 4.20.3, here's the material, and a video workflow: https://www.youtube.com/watch?v=4ccBjlAFt0s

    Just in case anyone is interested
    Attached Files

    Leave a comment:


  • replied
    Im having troubles making this work on mobile ES2.
    Some comment in this thread from 2015 says ES2 does not support SceneTextures while the documentations states PostProcessInput0 is supported. (see screenshot + link)
    https://docs.unrealengine.com/en-us/...ProcessEffects -> just CTRL+F "PostProcessInput0" or look below
    Click image for larger version

Name:	PostProcessInput0Supported.PNG
Views:	161
Size:	220.7 KB
ID:	1522014

    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!

    Leave a comment:


  • replied
    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.

    Code:
    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;

    Attached Files

    Leave a comment:


  • replied
    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.

    Leave a comment:


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

    Leave a comment:


  • replied
    Anyone got this material working in 4.19 after enabled "Temporal Upsampling" ?

    Leave a comment:

Working...
X