Edge detection with Normal and depth

Hi,
I was wondering if someone could point me on achieving robust edge detection with threejs.
I have found this example to be useful, but it only works based on pixel differences and does not work when there is no contrast at adjacent pixels.
Sobel edge detection example
But, I want to achieve this
Implemented in Unity

You might want to look into the OutlineEffect. It is not a postprocessor and there is not much documentation and no examples but it is really great.

I have used it in my splatmap-paint experiment: http://test.ngongo-b.net/shaderExperiment/TilePaint.html

Feel free to explore and rip any part of my code in this experiment.

The effect is really great, much better than any edge detection effect I played with in Unity. And very simple to use.

This is a screenshot from my current project:

3 Likes

Thanks for help.:slight_smile:

Hi Fedor_van_Eldijk,

I have got the same issue with Sobel edge detection in Three.js, can you share your idea to solve this problem. I am very new to this webgl renderer, and I try your link above but it doesn’t work any more.

Thanks.