How do bevel effects work?

I am looking to add a bevel effect(like in photoshop) to an RGBA image programatically.
I have searched far and wide in order to create this effect but I couldn’t find anything useful.

I found different talks about embossing and bump maps but I couldn’t find anything that involves a light point and that is round.

Could you help me out or atleast point me in the right direction?

Thank you.

Please delete this topic, I already got my answer on: