Raytracer
Loading...
Searching...
No Matches
Dielectric.hpp
1#include "interfaces/IMaterial.hpp"
2
3#ifndef __DIELECTRIC_HPP__
4 #define __DIELECTRIC_HPP__
5
6namespace Raytracer::Materials
7{
9 private:
10 double _refractionIndex;
11 Utils::Color _albedo = Utils::Color(1.0, 1.0, 1.0);
12
13 public:
14 Dielectric(double refractionIndex);
15 Dielectric(double refractionIndex, const Utils::Color &albedo);
16 bool scatter(const Core::Ray &ray, const Core::Payload &payload,
17 Utils::Color &attenuation, Core::Ray &scattered) const override;
19 double u, double v, const Utils::Point3 &point) const override;
20 static double reflectance(double cosine, double index);
21 };
22} // namespace Raytracer::Materials
23
24#endif /* __DIELECTRIC_HPP__ */
Definition Payload.hpp:11
Definition Ray.hpp:9
Definition IMaterial.hpp:14
Definition Dielectric.hpp:8
Utils::Color emitted(double u, double v, const Utils::Point3 &point) const override
Calculate the refracted ray.
Definition Dielectric.cpp:110
Dielectric(double refractionIndex)
Construct a new Dielectric object.
Definition Dielectric.cpp:16
static double reflectance(double cosine, double index)
Calculate the reflectance of the dielectric material.
Definition Dielectric.cpp:89
bool scatter(const Core::Ray &ray, const Core::Payload &payload, Utils::Color &attenuation, Core::Ray &scattered) const override
Scatter the ray with the dielectric material.
Definition Dielectric.cpp:52
Definition VecN.hpp:40