Fovia's C++ Client/Server API
Phong Lighting Model

This version of Fovia's HDVR™ Library supports the following headlight Phong Lighting model:

\[I = K_d*cos(\alpha) + K_s*cos(\alpha)^n\]


$K_d$ is the diffuse coefficient
$K_s$ is the specular reflection coefficient
$\alpha$ the angle between the scalar field's gradient vector and the viewing vector
$n$ is the power of specular reflection (shininess)

The Phong lighting model is applied if the gradient magnitude is higher then gradient sensitivity threshold (RENDER_PARAMS::RaycastingPrecision), otherwise the sub-volume would be processed as a homogeneous body. The homogeneous body lighting model assumes that the diffuse reflection component is equal to $K_d * cos(45o)$ and $K_s = 0.0$.

The $K_d$ functions as a brightness coefficient (RENDER_PARAMS::Brightness). The $K_d$ range is allowed to be [0,1], but for the majority of scenes the optimal $K_d$ range is [0.5,1]. The RENDER_PARAMS::Brightness is normalized to fit the above range, so the actual values are [0,255].

The $K_s$ functions as the specular reflection coefficient (RENDER_PARAMS::Reflection) The valid range for $K_s$ is [0,1]. RENDER_PARAMS::Reflection will be normalized to the above range from it's actual range [0,255].

The $n$ functions as the shininess coefficient (RENDER_PARAMS::Shininess). It emphasizes the bumps/relief of surface. The higher the shininess the more "metal" like the surface looks. The lower shininess the more "matte skin" like the surface looks. The contribution of this component is defined by $K_s$. The allowed range for $K_s$ range is [0,1] however for majority scenes the optimal $K_s$ range is [0.1, 0.4]. Once again, the actual values to be passed in are [0,255].