PDA

View Full Version : Phong...



Tenson
07-03-2003, 03:49 AM
Can someone please tell me where could I find example of source that contains algorithm 4 interpolation of normals (Phong) to achieve per-pixel lighting.
I made phong lighting model by myself and the only vital part missing are normals™

http://www.opengl.org/discussion_boards/ubb/smile.gif

Mazy
07-03-2003, 04:07 AM
the normal is interpolated across the triangle, the problem is that its not normalized.. the most common solution is to have a cubemap with the normals encoded as colors and use the unnomalized normal that you have to make a lookup and get a normalized vector from the color. either that or just renomalize in a fragmentprogram ( depending on your target HW)