Shading that incorporates ambient, diffuse, and specular properties, where specular highlights are calculated using the Blinn-Phong formula.
- iOS 8.0+
- macOS 10.8+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 3.0+
The Blinn-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.
A vector halfway between the light vector
Land the (normalized) eye vector
E(the vector from the point being shaded to the viewer), calculated using the formula
H = normalize(L + E).