1 #ifndef R2_LIGHT_DIRECTIONAL_H 2 #define R2_LIGHT_DIRECTIONAL_H 47 vec3
reflection = reflect (observer_to_surface, n);
80 const vec3 specular_color,
81 const float specular_exponent)
86 pow (base_factor, specular_exponent);
89 return color * specular_color;
vec3 R2_lightDirectionalDiffuseTerm(const R2_light_directional_t light, const R2_light_directional_vectors_t v)
vec3 direction
The light direction. Assumed to be normalized.
vec3 color
The light color. The components are assumed to be in the range [0, 1].
Vectors used when calculating directional lighting.
vec3 reflection
Reflection between observer and normal (referred to as R in most texts)
vec3 surface_to_light
Direction from surface to light source (referred to as L in most texts)
vec3 normal
The surface normal (referred to as N in most texts)
vec3 R2_lightDirectionalSpecularTerm(const R2_light_directional_t light, const R2_light_directional_vectors_t v, const vec3 specular_color, const float specular_exponent)
float intensity
The light intensity.
A directional light type.
R2_light_directional_vectors_t R2_lightDirectionalVectors(const R2_light_directional_t light, const vec3 p, const vec3 n)
vec3 observer_to_surface
Direction from observer to surface (referred to as V in most texts)