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

Question Edge Detect that ignores slope change

Discussion in 'Shaders' started by andyz, Oct 4, 2021.

  1. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,246
    I have an old shader with various edge detection algorithms and the best is Roberts Cross Depth Normals test.
    However I can not make it edge detect small step changes while ignoring steep slopes that change gradient smoothly.
    Either the little steps (same normal, small depth change) are ignored or the slopes are all dark as they steepen (so no line, just a big black area!).
    Anyone know the solution or have an edge detection shader (using built-in) that is better than that?

    the image shows the problem in a bowl with high depth sensitivity (so small steps detected) and low normal sensitivity

    edge.png