A material has a surface color and four attributes from the Phong Reflection Model: ambient, diffuse, specular and shininess. Each one of these attributes accept a non negative floating point number. For ambient, diffuse and specular, the typical values are between 0 and 1. For shininess, values between 10 (very large highlight) and 200 (very small) highlight seem to work best, though there is no actual upper bound. More...
#include <materials.h>
Data Fields | |
t_color | color |
t_color | ambient |
float | diffuse |
float | specular |
float | shininess |
t_pattern | pattern |
A material has a surface color and four attributes from the Phong Reflection Model: ambient, diffuse, specular and shininess. Each one of these attributes accept a non negative floating point number. For ambient, diffuse and specular, the typical values are between 0 and 1. For shininess, values between 10 (very large highlight) and 200 (very small) highlight seem to work best, though there is no actual upper bound.
color | Stores the material's color in RGB values. |
ambient | Represents the background lighting or the light reflected from other objects in the enviroment. |
diffuse | Represents the light reflected from a matted surface. It depends only on the angle between the light source and surface normal. |
specular | Represents the reflection of the light source itself and results in the bright sport on a curved surface. It depends on the angle between the reflection vector and the eye vector. Thus, it's also controlled by the parameter shininess. |
shininess | Represents the shininess. The higher the shininess, the smaller and tigher the specular highlight. |
pattern | Represents the pattern texture of a given material. It can be a striped or a checkered pattern. |