Photoshop layer effects using shaders

How do you create photoshop layer effects like multiply and dodge using shaders?

It’s all a matter of mathematics. Check the following link

http://photoblogstop.com/photoshop/photoshop-blend-modes-explained