|
static double | reflectance (double cosine, double index) |
| Calculate the reflectance of the dielectric material.
|
|
◆ Dielectric() [1/2]
Raytracer::Materials::Dielectric::Dielectric |
( |
double | refractionIndex | ) |
|
Construct a new Dielectric object.
This function constructs a new Dielectric object with the given refraction index.
- Parameters
-
refractionIndex | The refraction index of the dielectric. |
- Returns
- A new Dielectric object.
◆ Dielectric() [2/2]
Raytracer::Materials::Dielectric::Dielectric |
( |
double | refractionIndex, |
|
|
const Utils::Color & | albedo ) |
Construct a new Dielectric object.
This function constructs a new Dielectric object with the given refraction index and albedo.
- Parameters
-
refractionIndex | The refraction index of the dielectric. |
albedo | The albedo of the dielectric. |
- Returns
- A new Dielectric object.
◆ emitted()
Calculate the refracted ray.
This function calculates the refracted ray. The function returns the refracted ray.
- Parameters
-
uv | The unit vector. |
normal | The normal vector. |
index | The refraction index. |
- Returns
- The refracted ray.
Implements Raytracer::Interfaces::IMaterial.
◆ reflectance()
double Raytracer::Materials::Dielectric::reflectance |
( |
double | cosine, |
|
|
double | index ) |
|
static |
Calculate the reflectance of the dielectric material.
This function calculates the reflectance of the dielectric material. The function returns the reflectance of the dielectric material.
- Parameters
-
cosine | The cosine of the angle. |
index | The refraction index. |
- Returns
- The reflectance of the dielectric material.
◆ scatter()
Scatter the ray with the dielectric material.
This function scatters the ray with the dielectric material. The function returns true if the ray is scattered. The function returns false if the ray is not scattered. The function updates the attenuation and scattered ray.
- Parameters
-
ray | The ray to scatter. |
payload | The payload of the ray. |
attenuation | The attenuation of the ray. |
scattered | The scattered ray. |
- Returns
- true if the ray is scattered, false otherwise.
Implements Raytracer::Interfaces::IMaterial.
The documentation for this class was generated from the following files:
- /Users/javii/Code/raytracer/include/materials/Dielectric.hpp
- /Users/javii/Code/raytracer/sources/materials/Dielectric.cpp