Announcement

Collapse
No announcement yet.

Echolocation Material Effect

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

    Echolocation Material Effect

    Hey there everyone,
    I've been trying to achieve an Echolocation effect with Post Processing Material but I've been stuck. I've figured out how to get the effect to work but only with one location. I want to be able to have the effect work on many different locations.

    Here is an example of how I want it to work and look like. I've also attached a picture of the material I've made so far.


    #2
    You don't need to make it in the post process, use sphere meshes
    you can set you post process to before translucency.
    then make a new material with and inverted depth fade, apply to sphere meshes that expand on impact.
    probably two sided.
    Last edited by IndieGameCove; 03-04-2019, 01:48 AM.
    YT Channel: https://www.youtube.com/channel/UCoc...KYPSK6g7vZ5CNg

    Comment


      #3
      I was able to achieve the outline effect but using Depth Fade and setting the post process to "before translucency".
      The only thing that's left is to make all the parts of the objects that are in the sphere to get the Post Process Outline effect. Not sure how to do that.
      I've attached the outline Material and the Scene result.

      Click image for larger version

Name:	EcholocationMaterial_02.PNG
Views:	8
Size:	161.9 KB
ID:	1591080

      Click image for larger version

Name:	EcholocationMaterialScene_02.PNG
Views:	7
Size:	320.1 KB
ID:	1591079

      Comment


        #4
        Get rid of the lerp, get ridrof the black color parameter, take the white color multiplied by a scalar parameter and feed it into the in emmisive.

        Depthfade with parameters-> invert -> multiply by scalar parameter -> power with a scalar parameter-> opacity
        YT Channel: https://www.youtube.com/channel/UCoc...KYPSK6g7vZ5CNg

        Comment


          #5
          here
          YT Channel: https://www.youtube.com/channel/UCoc...KYPSK6g7vZ5CNg

          Comment


            #6
            Originally posted by IndieGameCove View Post
            here
            Great, that simplified my Material for the circle effect. But I still am not able to figure out how to make the outline effects on all the objects inside the sphere. The effect I want to achieve is as I showed in the first image but with for example multiple spheres in the level.

            Comment


              #7
              Oh I get think what your going for now, in the video I didn't notice the outlines only appear in the spheres.
              I'm not sure how to do that, maybe they are spawning in point lights along with spheres?
              or maybe they don't need the spheres with the right light function.
              Last edited by IndieGameCove; 03-05-2019, 02:38 AM.
              YT Channel: https://www.youtube.com/channel/UCoc...KYPSK6g7vZ5CNg

              Comment


                #8
                Read about Custom Stencils, you can just mask your outline effect with a stencil of your sphere.

                Comment


                  #9
                  I haven't used stencils before so I could be wrong but I think that method would create a screen space mask rather than a localized effect.
                  YT Channel: https://www.youtube.com/channel/UCoc...KYPSK6g7vZ5CNg

                  Comment


                    #10
                    No, it will be localized effect since you use your sphere as a mask aka stencil. Let me know if you want some ss on how to setup this.

                    Edit: I just tested it, it wont work for that you want to do. Use "3D sphere gradient" instead, just make sure that "Calculate camera inside" is set on true. Ignore the background lines, I didnt have the time to modify your code. So I just copied it from your screenshot to show you how to setup the "3D sphere gradient" logic. I hope this helps you.


                    Click image for larger version  Name:	spheremask2.JPG Views:	1 Size:	186.3 KB ID:	1591898
                    Click image for larger version  Name:	SphereMask.JPG Views:	1 Size:	386.8 KB ID:	1591897
                    Last edited by NasteX; 03-06-2019, 04:58 AM.

                    Comment


                      #11
                      he's trying to make a bunch of spheres at different locations.
                      something like that sphere gradient or a spheremask in a pointlight light function just inverted should do the trick. so long as all the other lights and baked lighting is cleared out of the level anyway.

                      maybe borrow some of the math in this decal.
                      https://www.tomlooman.com/recreating...th-station-fx/


                      in the pp you can mask out what is lit and what is not by sampling the postprocessinput0.

                      you could try doing postprocessinput0 minus basecolor if your not in forward shading.
                      Last edited by IndieGameCove; 03-06-2019, 06:16 AM.
                      YT Channel: https://www.youtube.com/channel/UCoc...KYPSK6g7vZ5CNg

                      Comment


                        #12
                        I got it working with custom stencils.

                        You just need to flip the normals of a sphere inside a 3D software, so that the outside part is inside. Then go to the Project Settings > Postprocessing > Custom Depth-Stencil pass > Enabled with Stencil.

                        Then you go to the Sphere with the flipped normals Rendering settings and check the Render CustomDepth Pass, Leave Custom Depth Stencil Write Mask to Default, and change the CustomDepth Stencil Value to 1. And make sure that Render in Main Pass is unchecked, because we dont need to see the sphere, we only want to use the sphere to mask the PP effect.

                        Now you can spawn/shoot those spheres and go inside/outside them.

                        Bellow are the screenshots for proofand Stencil masking logic:

                        Click image for larger version

Name:	SphereMask.JPG
Views:	7
Size:	230.7 KB
ID:	1591939

                        Click image for larger version

Name:	SPhereRenderSettings.JPG
Views:	8
Size:	56.9 KB
ID:	1591938

                        Click image for larger version

Name:	spheremask2.JPG
Views:	8
Size:	147.3 KB
ID:	1591936

                        Click image for larger version

Name:	spheremask3.JPG
Views:	7
Size:	84.2 KB
ID:	1591937

                        Comment


                          #13
                          Originally posted by NasteX View Post
                          I got it working with custom stencils.

                          You just need to flip the normals of a sphere inside a 3D software, so that the outside part is inside. Then go to the Project Settings > Postprocessing > Custom Depth-Stencil pass > Enabled with Stencil.

                          Then you go to the Sphere with the flipped normals Rendering settings and check the Render CustomDepth Pass, Leave Custom Depth Stencil Write Mask to Default, and change the CustomDepth Stencil Value to 1. And make sure that Render in Main Pass is unchecked, because we dont need to see the sphere, we only want to use the sphere to mask the PP effect.

                          Now you can spawn/shoot those spheres and go inside/outside them.

                          Bellow are the screenshots for proofand Stencil masking logic:
                          I tried your approach and it worked but not as intended. I want the things to be outlined only in the sphere area but with your approach everyone in the sphere and behind them gets outlined.


                          I was able to achieve the effect using lights. Not sure if that's the most efficient way but I was able to get the exact result I wanted. I've attached the files for anyone who want's to use them.

                          Click image for larger version

Name:	EcholocationMaterialScene_03.PNG
Views:	7
Size:	232.4 KB
ID:	1592633
                          Attached Files

                          Comment


                            #14
                            Nice! Well, I have misunderstood you then. Anyway I learned some new things in the process, so its win/win situation. Good luck with your project!

                            Comment


                              #15
                              I was messing around with decals this weekend and found the spheremask can create a 3d sphere. so you could use decals instead of lights. make the ring blue and then the center of the sphere red. then the post processing can sample the scene color and if it is blue make it white and if it is red unmask the edge detection. should give better performance than lights.
                              YT Channel: https://www.youtube.com/channel/UCoc...KYPSK6g7vZ5CNg

                              Comment

                              Working...
                              X