1 #ifndef R2_LIGHT_SPHERICAL_H 2 #define R2_LIGHT_SPHERICAL_H 38 const vec3 specular_color,
39 const float specular_exponent)
46 pow (base_factor, specular_exponent);
49 return color * specular_color;
65 const vec3 specular_color,
66 const float specular_exponent)
71 max (0.0, dot (v.
normal, half_v));
73 pow (base_factor, specular_exponent);
76 return color * specular_color;
79 #endif // R2_LIGHT_SPHERICAL_H vec3 color
The light color. The components are assumed to be in the range [0, 1].
Vectors used when calculating positional lighting.
vec3 R2_lightSphericalSpecularBlinnPhongTerm(const R2_light_positional_t light, const R2_light_positional_vectors_t v, const vec3 specular_color, const float specular_exponent)
vec3 surface_to_light
Direction from surface to light source (referred to as L in most texts)
float intensity
The light intensity.
vec3 R2_lightSphericalDiffuseLambertTerm(const R2_light_positional_t light, const R2_light_positional_vectors_t v)
vec3 R2_lightSphericalSpecularPhongTerm(const R2_light_positional_t light, const R2_light_positional_vectors_t v, const vec3 specular_color, const float specular_exponent)
vec3 observer_to_surface
Direction from observer to surface (referred to as V in most texts)
vec3 normal
The surface normal (referred to as N in most texts)
Functions and types related to positional lighting.