Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

Question I'm trying to make thing that quite the opposite of Stencil Buffer, How can I do it?

Discussion in 'Shaders' started by Panutat-R, Dec 12, 2022.

  1. Panutat-R

    Panutat-R

    Joined:
    Jun 14, 2022
    Posts:
    1
    I'm trying to make transparent object (let's name it "Filter") that can be seen through just like it's not even there, but it will make some specific objects(let's call them "Ghost") invisible when "Ghost" are behind "Filter" from camera view. If "Ghost" comes in front of "Filter", we will able to see it normally.

    When the "Ghost" is behind the "Filter", player can't see it but may able to see other objects
    Behind.jpg

    When the "Ghost" come through the "Filter", player will able to see it just fine.
    Pass.jpg

    That is how I want it to be.

    Please help me!! I'm quite new in these Shader stuffs!!
     
    Last edited: Dec 12, 2022