Search Unity

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