Search Unity

Shader - Make 2d sprite Visible through walls

Discussion in 'Shaders' started by Lukbebalduke, Nov 10, 2019.

  1. Lukbebalduke

    Lukbebalduke

    Joined:
    May 19, 2019
    Posts:
    6
    Hey there!

    I'm trying to achieve a specific visual effect: make 2d sprites visible through walls (or any other sprite that renders on top of it). The image below gives an example of the desired effect.



    There are tons of examples out there explaining how to achieve this effect in 3D games, but I haven't found yet a solution to this effect in 2d games.

    Right now I'm looking for any clues on how to achieve it. Does anyone have an idea on how to approach this?

    Also, I would like to know if there is a specific name to describe this effect - it probably would help me a lot when searching for solutions or talking about this particular effect.

    Thanks in advance :)
     
  2. vals261

    vals261

    Joined:
    Jan 4, 2018
    Posts:
    6
    Hey, did you ever find an answer? I'm actually trying to achieve the same effect, but can't find much that it is recent
     
  3. Sir_Rosenfeld

    Sir_Rosenfeld

    Joined:
    Jan 9, 2019
    Posts:
    3
    Use stencil shaders.

    This should be exactly what you're looking for :