A light source for the Blinn-Phong shading model.
More...
#include <types.h>
A light source for the Blinn-Phong shading model.
Lights illuminate meshes during rendering. A directional light (the default) shines from a direction toward the origin — its position is treated as a direction vector. Point lights are not yet supported.
- Example: setting up two lights
glm::vec3 Vec3
3-component floating-point vector (xyz).
An RGBA color with floating-point components.
A light source for the Blinn-Phong shading model.
All settings that control rendering output.
std::vector< Light > lights
List of light sources.
- See also
- RenderOptions, RenderOptions::lights, RenderOptions::ambient
-
shade_pixel(), shade_pixel_multi()
Definition at line 179 of file types.h.
◆ color
| Color scimesh::Light::color = Color(1.0f, 1.0f, 1.0f, 1.0f) |
Color of the light (default: white).
Each channel multiplies the surface color during shading.
Definition at line 189 of file types.h.
◆ intensity
| float scimesh::Light::intensity = 1.0f |
Brightness multiplier (default: 1.0).
Values > 1.0 produce brighter-than-white illumination (may saturate).
Definition at line 194 of file types.h.
◆ is_directional
| bool scimesh::Light::is_directional = true |
Whether this is a directional light (default: true).
When true, light rays are parallel (like the sun). Point lights (not yet implemented) would set this to false.
Definition at line 200 of file types.h.
◆ position
| Vec3 scimesh::Light::position = Vec3(0.0f, 0.0f, 1.0f) |
Position of the light.
When is_directional == true (the default), this is interpreted as a direction vector (the light is infinitely far away).
Definition at line 184 of file types.h.
The documentation for this struct was generated from the following file: