Announcement

Collapse
No announcement yet.

Transparent wall shader

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

    Transparent wall shader

    Hello!

    I've been looking for a way to do a transparent wall shader for my game.

    I need something exactly like this: http://www.youtube.com/watch?v=fOjVY0OXr3U

    I just don't know how to do it... I've tried to contact the author of the movie but he doesn't reply. Someone has any idea of how this is done? I've seen some other thread about the same thing, but i really don't want to use triggers for this, i want something dynamic..

    At a first phase i know i should do a trace(or fast trace) between my camera and the pawn, so that when there is an object in the middle, I may apply something to that object, but what and how?

    Thanks in advance

    Cheers

    #2
    From what I saw, he's just using a material that looks for the pixel depth and uses a lerp node to transition between the two. I was gonna add some examples of how to get some other effects like the one he's using and one which acts like the wall is being broken away the closer you get to it, but Imageshack is being a *****.

    Anyway, this is it in it's simplest form, just play around with it. This will fade out the closer the camera gets to the wall, you can also see the effect in the material editor by zooming in and out.

    Edit: Bad pic, the second number is meant to be a 1.

    Comment


      #3
      He's using a distance calculation. essentially he's using kismet to send off the player's current location to the material instance and then using the 'distance' node to blend a spherical falloff.

      Comment


        #4
        Hello!

        Thank you both for your fast replies!

        Piranhi, thanks for your time! I managed to create it and test it, and it really does the job.. However, i think i explained my problem incorrectly, starting with the thread title..

        I need to be able to apply transparency on any material i have on the map.. including static mesh's. This is one solution, but ultimately i would have to change all the materials i have on the map to incorporate that lerp in the opacity setting..

        My game consists of a top-down camera(not like in a directly -90º angle, more like -60º or -70º, while focusing the pawn) and when we put the pawn too close to a static mesh or wall, the object will block the vision to the pawn. I'm sorry because i explained myself incorrectly in the first post, and this is why i asked if it was done with some kind of trace(which seems a feasible solution).

        KazeoHin, sorry for my ignorance, but i'm not certain of what a spherical falloff is. Is it a object that "subtracts" on the other colliding objects? Where can i find it?

        Thank you for your time,
        Cheers

        Comment


          #5
          You can use the "distance" node (under 'high level' in the material editor) to get a single-value linear distance between two vectors. This creates spherical falloff.

          Comment


            #6
            Sometimes i think i am really dumb...

            I tried this out and the result was...nothing. This happened to me also in another example in another thread. Do i have to use a specific Blending?

            With the Blend_opaque i dont get any results even in the Material preview.
            With other Blend Modes i get something like the desired effect, but i can also see the floor itself through the wall, no matter how far the distance...

            Any ideas?

            Comment

            Working...
            X