It there a way to do edge detection on plane?
I believe this isn't possible at present without adding additional geometry to indicate the &quot;edgeiness&quot;. However, this can be achieved (in a slightly &quot;hacky&quot; way) if you have a single face by way of the 'inset face' operation.
For example, consider the following mesh :

In edit mode, select the face and press I to start the inset operation then move the cursor to size the inset. If you need to inset further than the geometry allows (concave faces can result in overlapping edges) then you can Scale or manually manipulate the vertices to get the desired shape - the 'fade' will be along the extent of the inset face :

Then all that is required is to allocate the gradient by either using Vertex Colors or UV coordinates. For example, in the UV editor you can select all the 'Inner' vertices and move those to the top edge of the UV map, then select all the 'Outer' vertices and move those to the bottom edge of the UV map and then use the Y element of the UV map to give your edge gradient :

Then you can simply use the UV 'V' coordinate ('Y' from the Separate XYZ) to represent the distance from the edge :