czm_getSpecular

czm_getSpecular

Calculates the specular intensity of reflected light.

Parameters:
Name Type Description
lightDirectionEC vec3 Unit vector pointing to the light source in eye coordinates.
toEyeEC vec3 Unit vector pointing to the eye position in eye coordinates.
normalEC vec3 The surface normal in eye coordinates.
shininess float The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight.
Returns:
float The intensity of the specular highlight.
Example
float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);
float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);
vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);
See:
Source: