Shading that incorporates ambient, diffuse, and specular properties, where specular highlights are calculated using the Phong formula.
- iOS 8.0+
- macOS 10.8+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 3.0+
The Phong approximation of real-world reflectance calculates the color of a point on a surface using the following formula:
The sum of all ambient lights in the scene (a color).
The surface normal vector at the point being shaded, as supplied by the geometry’s vertex data, interpolated between vertices, and possibly modified by the material’s
The (normalized) vector from the point being shaded to the light source.
The (normalized) vector from the point being shaded to the viewer.
The reflection of the light vector
Lacross the normal vector