Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Making walls invisible that are close to the camera

Discussion in 'Shaders' started by Malian, Mar 30, 2015.

  1. Malian

    Malian

    Joined:
    Mar 30, 2015
    Posts:
    1
    Hi girls and guys,

    I'm fairly new when it comes to shaders. I really just started with some very basic tutorials but came to realize that for what I actually want to do I might need a big bump into the right direction :) I'm more the kind of guy that looks at a working example and then understands why it is working. Sadly, I'm often lost when it is the other way around and I have to invent something I don't fully understand in the first place.

    To cut it short:
    In my game I have an isometric perspective. The camera follows my character always at a certain height looking down at an angle of 45 degrees. And if, for example, she is in a small room with high walls I mostly see the walls - which is sad for all the effort that went into level design. So I wondered if I could assign a shader to those walls that should disappear when they are at or below a certain distance to the camera.
    My first thought was to place a light at camera position and have a shader that makes everything invisible where that light hits the object... but I guess this is just my rudimentary understanding of how the world works :)
    I came across another shader that showed a colored silhouette of the character when behind a wall. But I would really like to see the room through the wall.

    I hope you can help :)