Light glare depending if you're looking at the source or not

I would like to have an effect like this:
https://gyazo.com/49130b3dff156257ec25850857c634e9

However, I have not seen any posts on how to do this.