Announcement

Collapse
No announcement yet.

Radial Blur PostProcess Material

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

    #16
    You sir are for the time being the only one who made a frosted transparent shader so far (that I'am aware of)
    I hope you didn't stop thinking about a better way and maybe sharing this

    Comment


      #17
      Originally posted by Meian View Post
      You sir are for the time being the only one who made a frosted transparent shader so far (that I'am aware of)
      I hope you didn't stop thinking about a better way and maybe sharing this
      Well I didn't really do any more work on it, since University is eating up quite some time.
      I might write a bit about the problems I'm having with this later this week and show what I have so far.

      Comment


        #18
        This is brilliant! Are you doing this in-shader, or as a post process?

        Comment


          #19
          HI I saw the topic https://answers.unrealengine.com/que...materials.html , I got interested in whether you have blured glass on material?

          Comment


            #20
            I learned in this thread that you can use Scene Color with Translucent Materials. https://forums.unrealengine.com/show...els-separately

            So with the blurred glass materials I took a similar approach to the Radial Blur Post Process effect. With this what is needed is something like a gaussian blur, so I just picked some samples around the pixel that was processed calculated a weighted average. Samples that are close to the UV coordinate have more weight than samples that are far away. The one in the picture doesn't use a lot of samples, that's why you can see those strange circles in it.
            If you want to make it perfect you would need to use the TexelSize to make it pixel-perfect and pick all pixels in a radius (depending on how blurry you want it) around the UV coordinate.
            This is what you can do in the material editor.

            If you want a more efficient method you would probably implement a custom shader or shader node with HLSL and C++ directly for the renderer, afaik. If you do that you can make use of some faster blur/low pass filter algorithms.
            For the Radial blur Post Process I didn't really care, because there will only be one on the screen and I didn't notice a significant drop in framerate even with more complex versions of it. The samples are also just taken in a line and not a circle, that means that less iterations per pixel are needed.

            The other problem with the blurred glass material that I can't solve is that I have to use the emissive output of the material. This means that any shading on the glass would not be visible. So I have put it on hold for now as I have to concetrate on more important tasks. I also don't have ideas how to solve this problem. This might also require some modifications to the renderer.

            As said in one of the posts above, this isn't really my field, so there might be someone smarter than me in this area, who knows better.

            Comment


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

              Comment


                #22
                Originally posted by NomadMonkey View Post
                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)

                Comment


                  #23
                  thanks it works.

                  Comment


                    #24
                    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.

                    Comment


                      #25
                      This is really very nice. I've been looking at making this effect for a speed boost
                      Freelance Web Designers
                      Ecommerce Website Designer

                      Comment


                        #26
                        People may also try this custom node for a soft guassian like appearance. lower-cased uv and no extra parameter to adjust weight.
                        Code:
                        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[i] * 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);

                        Comment


                          #27
                          Originally posted by Kory View Post
                          People may also try this custom node for a soft guassian like appearance. lower-cased uv and no extra parameter to adjust weight.
                          Code:
                          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[i] * 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?

                          Comment


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

                            Comment


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

                              Comment


                                #30
                                Thanks to everyone!
                                Pull Request - UE-13079: World Origin Shifting for Multiplayer. Make Arma Not War - TFAR.

                                Comment

                                Working...
                                X