Easy way to make Shapes compatible with edge detection outline shader?

Avatar
  • updated
  • Answered

I'm consider using this edge detection outline shader for my project, but unfortunately it doesn't play nicely with Shapes! From my limited shader understanding, what's going on is the edge detection is using a REPLACEMENT shader to detect the outlines, which results in an outline being drawn around the shape's base shape model, regardless of whatever settings the shape has in the inspector (in this case a torus).

I don't know much about shaders, so I was wondering if anyone knew an obvious way to make this compatible with Shapes that I might be missing. Thanks!

Image 83

Reporting a bug? please specify Unity version:
Reporting a bug? please specify Shapes version:
Reporting a bug? please specify Render Pipeline:
Pinned replies
Avatar
Freya Holmér creator
  • Answer
  • Answered

this is unfortunately really complicated, because you essentially need to make your replacement shader respond to shader properties and modify the vertices in its vertex shader just like shapes does, and every shape has its own very specially tailored shader, so, very much not straightforward

edge detection shaders relying on the existing depth buffer should work though, as long as your shapes write to depth

Avatar
Freya Holmér creator
  • Answer
  • Answered

this is unfortunately really complicated, because you essentially need to make your replacement shader respond to shader properties and modify the vertices in its vertex shader just like shapes does, and every shape has its own very specially tailored shader, so, very much not straightforward

edge detection shaders relying on the existing depth buffer should work though, as long as your shapes write to depth

Avatar
sean w

Ahhhh okay yeah that does not sound straightforward. Thanks for the quick response, I'm gonna search for some edge detection that uses the depth buffer then!