Announcement

Collapse
No announcement yet.

Radar/Sonar Pulse Post Processing Material

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

  • Radar/Sonar Pulse Post Processing Material

    Hey there.
    Now, I've been thinking about one effect since I've seen it in several games. And a few months ago, I saw a vine-video of exactly what I wanted, but I couldn't find the creator and, since I'm not that good at materials, let alone Post Processing, I've been trying it out but giving up soon after for the last months. I just wanted to try to get it done before asking somewhere, but now I know I don't have the slightest idea of what to do.
    The video is this one: Sonar Pulse

    So as one can easily see, the effect I'm trying to duplicate is that of a Sonar/Radar Pulse going through the whole map.
    The thing I knew for a fact was that this could be achieved with a Post Processing Material, so I've been playing around with it. Just a few hours ago, while searching for something on Google, I found this thread where the Creator of the thread is asking the exact same thing. The guy that answered had made a material which, as he said, should get the creator of the thread started on making his own material.

    This is the material the guy made. I figured I'd replicate that one to see how it works and how it looks.

    Now, it already looks pretty cool, but it still isn't quite what I wanted from it. Trying to change the material just caused it to not work anymore, which I obviously didn't want, so I thought asking on the forums might help. Below, you can see how it looks for me:
    Click image for larger version

Name:	SCREENSHOT.jpg
Views:	1
Size:	800.7 KB
ID:	1140647
    Since it's just a picture, I think it's necessary to say that the blue circles that you see just get bigger gradually and infinitely.
    The "infinitely" is one problem I see with it. I'd rather have it go for a certain distance and then fade out.
    The other problem would be that, if you look at the "background" in the picture, even if it might be hard to see, you can see that it kind of gets weird with blue lines going all over the place. Also, it doesn't quite look like the vine-video I linked.

    So yeah, that's how far I got with my researching and playing around on my own, so I figured I'd ask the people on this forum if they had any idea about how to do a proper sonar-pulse. I hope someone knows how to do it and can help me with it because I always loved that scanning-effect you see in several games and even movies and I wanted to replicate it.
    Thanks in advance for any answers and I apologize for the (probably) bad formatting.
    Cheers!

  • #2
    Hi there,
    here's another version of the Sonar PP which looks more like the effect from the video, using the fractions of the distance rather than sine/cosine this time.
    Please note than you can significantly change the apperance/color curve by changing the 'Curve' and 'Brightness' parameters.

    Click image for larger version

Name:	sonarpp0294ubq.png
Views:	1
Size:	250.6 KB
ID:	1060875

    http://www.pasteall.org/55080/c
    3.14159265359

    Comment


    • #3
      Originally posted by mAlkAv!An View Post
      Hi there,
      here's another version of the Sonar PP which looks more like the effect from the video, using the fractions of the distance rather than sine/cosine this time.
      Please note than you can significantly change the apperance/color curve by changing the 'Curve' and 'Brightness' parameters.

      [ATTACH=CONFIG]16821[/ATTACH]

      http://www.pasteall.org/55080/c
      Oh, thanks! I'll replicate that today. A question though. What's the code from pasteall.org good for? I'm not a programmer and I can't really understand what's going on in there. Is it just the PP-Material in code or what is it?

      Comment


      • #4
        you can paste that code into your material editor and it will construct that material network for you

        Comment


        • #5
          Alright. Thanks!

          Comment


          • #6
            Cool just what I have been looking for. I do have a question is it possible to add in a texture somewhere? So we don't just get a color but also a pattern? Again thanks for this it's really nice.
            Do Not Argue Toxic Game
            Balloony PoP get it on Google Play
            Fishy Blub Blub
            get it on Google Play

            Comment


            • #7
              Just stumbled upon this thread and thought I would show another method for achieving such a result.

              Scan Material Features:
              1. Dynamic Animation Scaling
              2. Field Distance
              3. Ranged Animation Modified By Normalized Equations




              Scan Function:
              Code:
              float iTime = Time_Input;
              float tRate = Time_Rate;
              float bValue = 0.0;
              float3 normalizeCamPos = (0-Camera_Position);
              float3 normalizeWorldPos = (0-ABSWorld_Position);
              float distanceCalculation = (distance(normalizeCamPos*(0-(Radius/10000)), normalizeWorldPos*(0-(Radius/10000))));
              float3 cFresnel = (clamp((dot(Camera_Vector, World_Normal)),0,1));
              float3 invertFresnel = cFresnel.xyz = float3(1, 1, 1) - cFresnel.xyz;
              float scanSync = (clamp((lerp(cFresnel, bValue, distanceCalculation)),0,1));
              float3 manualScan = (clamp((((distance(normalizeCamPos, normalizeWorldPos))-100000)/10000),0,1));
              float3 invertManualScan = manualScan.xyz = float3(-1, -1, -1) - manualScan.xyz;
              float tVariable = (pow(((frac((iTime*(tRate*-1))+distanceCalculation))*invertManualScan),10));
              float3 sColor = Scan_Color;
              float clampMask = (clamp((tVariable*scanSync),0,1));
              float3 finalScan = (lerp(bValue, sColor*invertFresnel, clampMask));
              
              return finalScan;
              In order to show World Normal Modification, I chose to implement a pixelation function. There was a video posted by Unreal already for creating this effect within the material browser using some nodes. I simply took the equation and translated it into HLSL.

              Pixelation Function:
              Code:
              float res = 80.0;
              float2 inUV = Texture_Coordinate;
              float2 comUV = ((floor(inUV*(floor(res))))/(floor(res)));
              
              return comUV;
              I hope this is useful

              -Jeremy-
              Portfolio
              UE3 - Advanced FX Masterclass Part 1 DVD
              UE3 - Advanced FX Masterclass Part 2 DVD

              Comment


              • #8
                @JBaldwin

                I hope you don't mind, but I made a copy of your post here in Community Content, Tools, and Tutorials.

                https://forums.unrealengine.com/show...FX-Radar-Pulse

                It's just too cool of a setup not to share there as well.
                Tim Hobson | Learning Resources | Epic Games
                UE4 Documentation
                Wiki Troubleshooting Guides: Lighting | Swarm Agent | Destructibles |
                _____________________________________________
                Follow me on Twitter @TimHobsonUE4 | My Personal Website
                Photons Be Free: Mini-Tutorials and other Curiosities

                Comment


                • #9
                  No problem, feel free to post it wherever it has a chance to be a help

                  -Jeremy-
                  Portfolio
                  UE3 - Advanced FX Masterclass Part 1 DVD
                  UE3 - Advanced FX Masterclass Part 2 DVD

                  Comment


                  • #10
                    thank you so much

                    Comment


                    • #11
                      Anyone ever get the OP effect to work?
                      I notice there is an input to the shader called Normal_Vector which doesnt appear to be used.

                      Doesn't quite work for me.. I think the effect is not beginning at the camera..
                      Last edited by RE-Games; 10-02-2016, 12:22 PM.

                      Comment


                      • #12
                        Hey! It's a great effect but how do I overlay it on top of the original scene I had (forgive me - I'm a bit of a noob). When I add it as a postpro material it replaces everything and the weighting is just on or off.
                        Basically - I set up the post pro for the scene and achieved a nice atmosphere. Adding this post pro material completely replaces this.
                        I would like to be able to activate that post pro material on a mouse click event for it to play once and the bright sonar effect is additive on top of the scene I have.
                        Cheers.

                        Comment

                        Working...
                        X