9.4. Two-Sided Lighting
To mimic OpenGL's two-sided lighting behavior, you need to invert the surface normal and perform the same computations as defined in the preceding section, using the back-facing material properties. You can probably do it more cleverly than this, but it might look like Listing 9.13. The functions DirectionalLight, PointLight, and SpotLight that are referenced in this code segment are identical to the functions described in Section 9.2 except that the value glBackMaterial.shininess is used in the computations instead of the value glFrontMaterial.shininess.
Listing 9.13. Two-sided lighting computation
There is no need to perform clamping on the values assigned to gl_BackSecondaryColor and gl_BackColor because these are automatically clamped by definition.