|
raytracer
Parallel Ray Tracer written from scratch (no graphics API).
|
#include <lambertian.h>


Public Member Functions | |
| Lambertian () | |
| Lambertian (const common::Vec3 &_albedo) | |
| Ray | get_scattered (const Ray &ray_in, const common::Vec3 &intersection, const common::Vec3 &normal) const override |
| common::Vec3 | get_color (const Ray &ray_in, const common::Vec3 &intersection, const common::Vec3 &normal) const override |
| common::Vec3 | get_albedo () const |
| MaterialType | get_type () const override |
| Public Member Functions inherited from raytracer::raytracer::Material | |
| virtual | ~Material ()=default |
Additional Inherited Members | |
| Static Public Member Functions inherited from raytracer::raytracer::Material | |
| static common::Vec3 | reflect (const common::Vec3 &dir_in, const common::Vec3 &normal) |
| static common::Vec3 | refract (const common::Vec3 &dir_in, const common::Vec3 &normal, double refractive_index) |
A matte material, which scatters rays in random directions around the surface normal.
| raytracer::raytracer::Lambertian::Lambertian | ( | ) |
Creates a Lambertian material with a zero albedo (black).

|
explicit |
Creates a Lambertian material with the given albedo (color).
| _albedo | The color of the material. |

|
nodiscard |
Getter for the albedo of the material.


|
nodiscardoverridevirtual |
Computes the color the surface contributes to a ray that hits it, which is multiplied with the color of the scattered ray.
| ray_in | The incoming ray. |
| intersection | The point where the incoming ray hits the surface. |
| normal | The normal to the surface at the intersection point. |
Implements raytracer::raytracer::Material.
Reimplemented in raytracer::raytracer::LambertianTexture.


|
nodiscardoverridevirtual |
Computes the ray that leaves the surface after an incoming ray hits it.
| ray_in | The incoming ray. |
| intersection | The point where the incoming ray hits the surface. |
| normal | The normal to the surface at the intersection point. |
Implements raytracer::raytracer::Material.


|
inlinenodiscardoverridevirtual |
Returns the type of the material, used to identify the concrete class.
Implements raytracer::raytracer::Material.
Reimplemented in raytracer::raytracer::LambertianTexture.