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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Shader Graph Edges on Intersecting Transparent Objects

Discussion in 'Shader Graph' started by PixelNAUTS_Alex, May 26, 2022.

  1. PixelNAUTS_Alex

    PixelNAUTS_Alex

    Joined:
    Sep 14, 2012
    Posts:
    56
    Hey all, I'm adding an edge outline when I intersect objects to help blend things.
    I have a shader that uses the scene depth to find intersections. It works great against opaque objects but I would like to use it on transparent objects. Is there a way to achieve this?

    White = transparent
    Green = Opaque
    upload_2022-5-26_12-17-16.png

    Subgraph for depth detection
    upload_2022-5-26_12-18-17.png

    Shader
    upload_2022-5-26_12-20-31.png
     
  2. WilliamMAPearson

    WilliamMAPearson

    Joined:
    Feb 15, 2018
    Posts:
    1
    Did you ever find an answer, I am also looking to do something similar.
     
  3. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,123
    It might be possible if you set correct rendering order and enable z-write for these transparent objects.