The struct s_light represents a light's source. This source has a position in space and an intensity color, i.e., red, purple etc. More...
#include <lights.h>
Data Fields | |
t_point | position |
t_color | intensity |
t_bool | in_shadow |
The struct s_light represents a light's source. This source has a position in space and an intensity color, i.e., red, purple etc.
ABOUT THE HEADER LIGHTS.H
The light algorithm implemented on this project is called The Phong Reflection Model, named by its creator Bui Tuong Phong. It simulates the interaction between three light sources. They are: ambient reflection, diffuse reflection and specular reflection. In other words, respectively, background light, the light reflected from a matte surface and the reflection of the source light itself. The last one, depends only on the angle between the reflection vector and the eye vector and is controlled by a parameter that's called shininess. The higher the shininess, the smaller and tigher the specular highlight is.
position | Stores the point light's position. |
intensity | Stores the information about how bright a point light is. |
in_shadow | Stores TRUE or FALSE whether the light is being shadowed or not. |