Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How to discard pixels using Depth Texture?

Discussion in 'Shaders' started by mbrownie825, Sep 1, 2023.

  1. mbrownie825

    mbrownie825

    Joined:
    Aug 25, 2023
    Posts:
    8
    I'm drawing a segment AB on the background plane with my shader. Is it possible to discard pixels behind cube (red color) using depth texture?

    draw2.png
     
    Last edited: Sep 3, 2023