Raytracer
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Raytracer::Materials::Lambertian Class Reference
Inheritance diagram for Raytracer::Materials::Lambertian:
Raytracer::Interfaces::IMaterial

Public Member Functions

 Lambertian (const Utils::Color &albedo)
 Construct a new Lambertian object.
 
 Lambertian (std::shared_ptr< Interfaces::ITexture > texture)
 Construct a new Lambertian object.
 
bool scatter (const Core::Ray &ray, const Core::Payload &payload, Utils::Color &attenuation, Core::Ray &scattered) const override
 Scatter the ray with the Lambertian material.
 
Utils::Color emitted (double u, double v, const Utils::Point3 &point) const override
 Emitted light of the Lambertian material.
 

Constructor & Destructor Documentation

◆ Lambertian() [1/2]

Raytracer::Materials::Lambertian::Lambertian ( const Utils::Color & albedo)

Construct a new Lambertian object.

This function constructs a new Lambertian object with the given albedo. The Lambertian material scatters light with the given albedo.

Parameters
albedoThe albedo of the Lambertian material.
Returns
A new Lambertian object.

◆ Lambertian() [2/2]

Raytracer::Materials::Lambertian::Lambertian ( std::shared_ptr< Interfaces::ITexture > texture)

Construct a new Lambertian object.

This function constructs a new Lambertian object with the given texture. The Lambertian material scatters light with the given texture.

Parameters
textureThe texture of the Lambertian material.
Returns
A new Lambertian object.

Member Function Documentation

◆ emitted()

Raytracer::Utils::Color Raytracer::Materials::Lambertian::emitted ( double u,
double v,
const Utils::Point3 & point ) const
overridevirtual

Emitted light of the Lambertian material.

This function returns the emitted light of the Lambertian material. The function returns the emitted light of the material at the given point.

Parameters
uThe u coordinate of the texture.
vThe v coordinate of the texture.
pointThe point to get the emitted light from.
Returns
The emitted light of the material.

Implements Raytracer::Interfaces::IMaterial.

◆ scatter()

bool Raytracer::Materials::Lambertian::scatter ( const Core::Ray & ray,
const Core::Payload & payload,
Utils::Color & attenuation,
Core::Ray & scattered ) const
overridevirtual

Scatter the ray with the Lambertian material.

This function scatters the ray with the Lambertian 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
rayThe ray to scatter.
payloadThe payload of the ray.
attenuationThe attenuation of the ray.
scatteredThe 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: