Announcement

Collapse
No announcement yet.

So Blurred glass material is impossible in Unreal Engine 4?

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

  • replied
    hello RyanB
    I follow your code,but it reminds me that [SM5] /Engine/Generated/Material.ush(1284,20-40): error X3004: undeclared identifier 'View_RenderTargetSize'.
    Can you answer for me,thank you very much.

    Leave a comment:


  • replied
    I've also made a version designed for performance and added it to the Advanced Glass Shader if anyone feels like taking the easy route: https://forums.unrealengine.com/unre...d-glass-shader

    Leave a comment:


  • replied
    Very nice!

    Leave a comment:


  • replied
    I haven't had a chance to read this thread super closely, so what I've done may be entirely redundant, but I've managed to get what I believe are very compelling results (including refraction) by making use of a modified version of the spiral blur node and a little bit of math. If this is of interest to anyone, let me know and I can also post an explanation and the code + material graph, although it needs a bit of cleanup first.

    Leave a comment:


  • replied
    Originally posted by unit23 View Post
    4.16 includes the Background Blur UMG widget feature. Just add it to a widget and set the amount of blur.

    The post here has become obsolete.
    Hardly. I still learned a lot from this and if you need to blur within a material (not with a material applied in the world) then this helps a lot.

    Leave a comment:


  • replied
    I tried using background blur on a 3D widget as a substitute to a material option but no dice. Background blur doesn’t work on 3D widgets.

    Leave a comment:


  • replied
    Originally posted by unit23 View Post
    4.16 includes the Background Blur UMG widget feature. Just add it to a widget and set the amount of blur.

    The post here has become obsolete.
    unit23. I’ll look into. Thanks for helping an Unreal newbie.

    Leave a comment:


  • replied
    Originally posted by jamesoloughlin View Post
    Wish this was easier to achieve or maybe an updated tutorial of some sort.
    4.16 includes the Background Blur UMG widget feature. Just add it to a widget and set the amount of blur.

    The post here has become obsolete.

    Leave a comment:


  • replied
    Wish this was easier to achieve or maybe an updated tutorial of some sort.

    Leave a comment:


  • replied
    Is there a youtube tutorial where this is explained?

    Cheers.

    Leave a comment:


  • replied
    Originally posted by Filly_The_Owl View Post
    We need blurred/privacy glass solution!
    Just wear pants

    Leave a comment:


  • replied
    Bump for greater justice! We need blurred/privacy glass solution!

    Leave a comment:


  • replied
    Originally posted by Antidamage View Post

    Code:
    float Cycles = 25;
    float c = 1.0f / (3.14159f * BlurAmount);
    float4 Blur = float4(0, 0, 0, 1);
    if (BlurAmount < 2) return SceneTextureLookup(UV, floor(BufferIndex), true);
    [unroll(Cycles)]
    for (int i = 0; i < Cycles; ++i) {
        float e = -(i * i) / (BlurAmount);
        float falloff = (c * exp(e));
        float e2 = -((i + 1) * (i + 1)) / (BlurAmount);
        float falloff2 = (c * exp(e2));
        float combinedFalloff = falloff + falloff2;
        float Offset = falloff2 / combinedFalloff;
    
    
        float2 UVOffset = PixelSize * (i + Offset);
        Blur += 
            (SceneTextureLookup(UV + float2(UVOffset.x, 0), BufferIndex, true)
            + SceneTextureLookup(UV + float2(0, UVOffset.y), BufferIndex, true)
            + SceneTextureLookup(UV + float2(UVOffset.x, UVOffset.y), BufferIndex, true)
            + SceneTextureLookup(UV + float2(UVOffset.x, -UVOffset.y), BufferIndex, true)) * combinedFalloff;
    }
    return (Blur * clamp(13 - BlurAmount, 2, 12) * BlurAmount) / (32 + BlurAmount / Cycles);
    Hey everyone!
    So i'm trying to use this code with a material exactly like you pictured (had no luck putting it into material function, it complains about SceneTexture node). And what i get as a result is that editor crashes when i enter post process volume with this mat assigned. Can anyone help?

    Leave a comment:


  • replied
    I am very much interested in your video tutorials for setting custom blur glass materials. Thank you.

    Leave a comment:


  • replied
    I'm using the example above as a blur in a post processing layer with blur offsets of around a thousand. It looks good even then, but I added a couple more samples in the corners to help avoid the horizontal and vertical streaking. Overall the effect only has about a 10% fps penalty. I also tried to handle the lighting variations. It's not perfect, but it's fairly stable for blur amounts between 2 and 1000.

    I also merged as many different statements as I could into one single execution line. Epic have said that there's a small speedup on the GPU from doing this.

    Code:
    float Cycles = 25;
    float c = 1.0f / (3.14159f * BlurAmount);
    float4 Blur = float4(0, 0, 0, 1);
    if (BlurAmount < 2) return SceneTextureLookup(UV, floor(BufferIndex), true);
    [unroll(Cycles)]
    for (int i = 0; i < Cycles; ++i) {
        float e = -(i * i) / (BlurAmount);
        float falloff = (c * exp(e));
        float e2 = -((i + 1) * (i + 1)) / (BlurAmount);
        float falloff2 = (c * exp(e2));
        float combinedFalloff = falloff + falloff2;
        float Offset = falloff2 / combinedFalloff;
    
    
        float2 UVOffset = PixelSize * (i + Offset);
        Blur += 
            (SceneTextureLookup(UV + float2(UVOffset.x, 0), BufferIndex, true)
            + SceneTextureLookup(UV + float2(0, UVOffset.y), BufferIndex, true)
            + SceneTextureLookup(UV + float2(UVOffset.x, UVOffset.y), BufferIndex, true)
            + SceneTextureLookup(UV + float2(UVOffset.x, -UVOffset.y), BufferIndex, true)) * combinedFalloff;
    }
    return (Blur * clamp(13 - BlurAmount, 2, 12) * BlurAmount) / (32 + BlurAmount / Cycles);


    Last edited by Antidamage; 02-21-2016, 07:33 AM.

    Leave a comment:

Working...
X