phong VEX function

phong, blinn, and specular return the illumination for specular highlights using different lighting models.

Context: surface

See also: ashikhmin, phonglobe, Writing a PBR shader

  1. vector phong(vector nml, vector V, float shinyness)

  2. bsdf phong(float exponent)

  3. bsdf phong(vector nml, float exponent)

See writing a PBR shader for information on BSDFs.

phong, blinn, and specular return the illumination for specular highlights using different lighting models.

V represents the normalized vector from the surface to the eye (-normalize(I)). shinyness is the Phong exponent (typically around 20 or higher). roughness represents the surface roughness (typically 0 to 1).

You can optionally specify a light mask.

BSDF version

  1. bsdf phong(float exponent)

  2. bsdf phong(vector nml, float exponent)

A phong reflection.

  • exponent - phong exponent.