As described in this blog post, dispersion occurs when a material's refraction index varies based incident light frequency. Dispersion can be approximated in OpenGL by splitting the RGB color space into six individual colors (red, yellow, green, cyan, blue and purple) and performing pixel operations on each channel separately.

Moving the mouse in the demo below will move the position of the magnifying glass lense.