Announcement

Collapse
No announcement yet.

So Blurred glass material is impossible in Unreal Engine 4?

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

    #46
    Looks pretty good, and I agree, it does look better.
    YouTube Playlist of W.I.P game project - https://www.youtube.com/playlist?lis...XCXMLFckHVo_bV (May contain swearing, I'm Irish :P)

    Comment


      #47
      Other effect: refraction with colour.
      Seems trivial as you could think that you just need to plug a color node in your refractive material but it doesn't work: color will be refracted too and won't give the effect of a uniformly tinted glass.
      So, here again, postprocessing seems to be an interesting way.

      Last edited by EdWasHere; 07-02-2015, 03:52 AM.
      GLASSES & WATER SHADERS & CUSTOM PLANAR REFLECTIONS on my Youtube Channel: https://www.youtube.com/channel/UCP2...26Y2bEV4kfl9kA

      Comment


        #48
        If you plan to, you should really sell this shader/blueprint on the market

        (en tout cas tu aurais un client déja )

        Comment


          #49
          Yes, i think about it but for the moment, it works only if you slightly modify unreal source. So it means downloading from github and compiling. Not very handy. I think I'll wait for Epic source code modifications (basically : making scenecapturecomponent class extendable) to release something more user friendly.
          (Et merci pour tes encouragements )
          Last edited by EdWasHere; 07-31-2015, 05:15 PM.
          GLASSES & WATER SHADERS & CUSTOM PLANAR REFLECTIONS on my Youtube Channel: https://www.youtube.com/channel/UCP2...26Y2bEV4kfl9kA

          Comment


            #50
            Still experimenting...
            Here is a W.I.P.
            Trying to make glasses blending their colours, specular highlights and refractions, which wasn't the case in the previous videos.

            Last edited by EdWasHere; 08-24-2015, 11:03 PM.
            GLASSES & WATER SHADERS & CUSTOM PLANAR REFLECTIONS on my Youtube Channel: https://www.youtube.com/channel/UCP2...26Y2bEV4kfl9kA

            Comment


              #51
              This looks awesome , i wonder does it work with SSS.
              i tried to create those graphs , and it didnt work, i hope some one share shaders here , i mean just copy paste Graphs text.

              Comment


                #52
                It doesn't work with SSS.
                Basically, it's just about combining 2 or 3 renders of the same scene, using camera player and scenecapture components.
                GLASSES & WATER SHADERS & CUSTOM PLANAR REFLECTIONS on my Youtube Channel: https://www.youtube.com/channel/UCP2...26Y2bEV4kfl9kA

                Comment


                  #53
                  I guess that your next challenge will be a nice mirror shader

                  allez release ce materiaux sur le store que j'achette ça desuite

                  Comment


                    #54
                    Did anyone see this? https://youtu.be/xkDBzt0_ZMU?t=48

                    At around 0:48 they have a steamed up piece of glass with what appears to be a mask dictating how blurred the background is. Does anyone know how this was accomplished?

                    Comment


                      #55
                      @meian : A nice mirror shader ? Yes, that's something i'm working on.
                      @wilkes : Interesting. Id like to know it too !
                      GLASSES & WATER SHADERS & CUSTOM PLANAR REFLECTIONS on my Youtube Channel: https://www.youtube.com/channel/UCP2...26Y2bEV4kfl9kA

                      Comment


                        #56
                        Originally posted by RyanB View Post
                        It can be done but requires looking up several copies of the SceneColor node and offsetting them and then averaging them. This technique is a bit slow though. It is probably possible to do something better in code like use one of the downresed buffers for bloom. I asked BrianK about this and the reason it isn't done already is that the bloom buffers are from the previous frame and have to be reprojected with camera movement. This means when there is a camera cut there will be no information for one frame. And when rotating the camera quickly you would see weird behavior on the edge of the screen that revealed new parts of the blurred image. I wouldn't expect an epic solution to this anytime soon as a result of these issues but maybe one day.
                        How do you access these buffers?

                        Comment


                          #57
                          Here is mu setup for blurred glass material but it does not work so far. Could you check if I am missing something?

                          Click image for larger version

Name:	GlassBlur.png
Views:	2
Size:	358.3 KB
ID:	1091214

                          Click image for larger version

Name:	GlassBlur_details.png
Views:	2
Size:	41.5 KB
ID:	1091215

                          Code:
                          Custom Material Expression:
                          float3 CurColor;
                          float2 BaseUV = MaterialFloat2(ScreenAlignedPosition(Parameters.ScreenPosition).xy);
                          float2 NewUV = BaseUV;
                          float StepSize = Distance / (int) DistanceSteps;
                          float CurDistance;
                          float2 CurOffset;
                          float TwoPi = 6.283185;
                          float Substep;
                          float2 ScenePixels=View.RenderTargetSize*BaseUV;
                          ScenePixels+=View.TemporalAAParams.r;
                          float2 RandomSamp = ((uint)(ScenePixels.x) + 2 * (uint)(ScenePixels.y)) % 5;
                          RandomSamp+=TempAARandom+Texture2DSample(Tex,TexSampler,ScenePixels);
                          RandomSamp/=6;
                          RandomSamp-=0.5;
                          RandomSamp*=TempAARandom;
                          
                          int i;
                          if (DistanceSteps<1)
                          {
                          return DecodeSceneColorForMaterialNode(NewUV);
                          }
                          else
                          {
                          while ( i < (int) DistanceSteps)
                          {
                          
                          CurDistance += StepSize;
                          for (int j = 0; j < (int) RadialSteps; j++)
                          {
                          Substep++;
                          CurOffset.x = cos(TwoPi*((RandomSamp+Substep) / RadialSteps));
                          CurOffset.y = sin(TwoPi*((RandomSamp+Substep) / RadialSteps));
                          CurOffset *=DistanceMask;
                          NewUV.x = BaseUV.x + (CurOffset.x * (CurDistance));
                          NewUV.y = BaseUV.y + (CurOffset.y * (CurDistance));
                          CurColor += DecodeSceneColorForMaterialNode(NewUV);
                          }
                          Substep+=0.618;
                          i++;
                          }
                          CurColor = CurColor / ((int)DistanceSteps*(int)RadialSteps);
                          return CurColor;
                          }
                          Last edited by TheJamsh; 07-11-2017, 06:17 AM. Reason: code tags
                          Team Leader | Lead Gameplay Programmer at Burning Knight Studio

                          Portfolio

                          Comment


                            #58
                            Hi,
                            I'm sorry but I don't use shader code with custom node so I can't help you for this.
                            GLASSES & WATER SHADERS & CUSTOM PLANAR REFLECTIONS on my Youtube Channel: https://www.youtube.com/channel/UCP2...26Y2bEV4kfl9kA

                            Comment


                              #59
                              For those who can't figure out how to actually use this material, remember to set parameters Distance to around 0.01 and distance and radial steps to around 20

                              Comment


                                #60
                                Is that a scene? I really need some frosted glass. I was reading through this thread but can't seem to get it to work or get results like this. How'd you get it?

                                Comment

                                Working...
                                X