I am working with an OpenGL ES 2.0 shader and need to find the point of intersection between two line segments in 2D space. I receive them in terms of both coordinates of both lines. Because they are line segments I would also need to know if they actually intersect in the first place.
I can find many ways to do this but I would like to know what method would have the best performance in GLSL.