title: Inner glow effect for primitives using GLSL ES 2.0
body: <p>I'm trying to create an inner glow effect for a triangle fan primitive using GLSL ES 2.0 - though only the outer edges are to be subject to the effect at hand. I guess there are many ways to do this, but haven't found any description so far. </p>
  
  <p>There is the technique described in <a href="https://stackoverflow.com/questions/9130567/make-the-edges-of-a-textured-polygon-glow-in-opengl-es-2-0">Make the edges of a textured polygon glow in OpenGL ES 2.0</a>, however, this doesn't work for me as I'm working purely with primitive at this stage.</p>
  
  <p>My initial thought was to somehow calculate the distance to the nearest edge in the fragment shader, and then set the color according to wether or not the distance falls within the bounds of some threshold value or not. (Of course, the color and alpha is to be a function of the distance from the nearest edge - the exact gradient profile is not important at this point.)</p>
  
  <p>This approach poses two problems:</p>
  
  <p>1) How do I calculate the distance from a fragment to the nearest edge?
  2) How do I exclude common edges in this process, i.e. edges that are common to two (or more) triangles?</p>
  
  <p>Is this a sensible approach, and if so: how do I resolve my two issues? Suggestions for alternative approaches are also greatly appreciated. (For instance, I've been reading that texture data need not be an image, and that it may be utilized for custom purposes. Could a non-image texture be part of the solution?) :)</p>