It's basically adding
Code:
Color *= dot(vViewPixelDir, vNormal);

to a shader.

(edit: you'll need to calculate those two vectors but that is just as simple)

A tiny bit more if you want to adjust the intensity and prevent issues with negative results.
But that dot-product is the idea behind the whole thing.

Last edited by Kartoffel; 06/20/16 14:19.

POTATO-MAN saves the day! - Random