blinn
Shading that incorporates ambient, diffuse, and specular properties, where specular highlights are calculated using the Blinn-Phong formula.
Declaration
static let blinn: SCNMaterial.LightingModelDiscussion
The Blinn-Phong approximation of real-world reflectance calculates the color of a point on a surface using the following formula:
color = ambient * al + diffuse * max(0, dot(N, L)) + specular * pow(max(0, dot(H, N)), shininess)Some terms refer to the material’s properties: ambient, diffuse, specular, and shininess. The other terms are as follows:
alThe sum of all ambient lights in the scene (a color).
NThe 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 normal property.
LThe (normalized) vector from the point being shaded to the light source.
HA vector halfway between the light vector
Land the (normalized) eye vectorE(the vector from the point being shaded to the viewer), calculated using the formulaH = normalize(L + E).