The diffuse term depends on how aligned the face is with the light source; if the face's normal vector is in the same direction as the light source, it is fully lit. If it is perpendicular then is is not lit at all. The dot product essentially gives a measure of how aligned

The specular term depends on how aligned the camera is with the reflected light. The calculation is similar to above except the effect is transformed with a power to adjust the size of the spot you see, so that a matt sphere would have a larger bright spot than a shiny one.

Doing lighting correct is quite a difficult undertaking. The old way of just adding some phong specular to the dot product of the normal and light vector has proven to be not really correct and difficult for artists to control.Already some years now something called physical correct lighting is the standard, but no so easy to set up. There are quite a lot of papers and presentations out there for the ones interested.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org