miniRT
By Marcelo Magalhães and Ygor G. Sena, 2023.
s_light Struct Reference

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>

Collaboration diagram for s_light:

Data Fields

t_point position
 
t_color intensity
 
t_bool in_shadow
 

Detailed Description

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.

Parameters
positionStores the point light's position.
intensityStores the information about how bright a point light is.
in_shadowStores TRUE or FALSE whether the light is being shadowed or not.