Edge detection for the *material*, not the mesh

there’s not enough information to do this with normals or sdf. derivates and slope detection won’t do that either. i tried a bunch. didn’t work. i’m tired now… but… a quick idea left…

you could try to render a duplicate with back faces only into a custom depth buffer. render the front faces into a stencil. in the post shader you check the stencil and when hit you compute the depth difference of the back and front faces to get something to compute the “shade”.

it’s not edge detection per se, more like inverted subsurface shading.