raytracer
Parallel Ray Tracer written from scratch (no graphics API).
Loading...
Searching...
No Matches
raytracer::raytracer::LambertianTexture Class Reference

#include <lambertian_texture.h>

Inheritance diagram for raytracer::raytracer::LambertianTexture:
Collaboration diagram for raytracer::raytracer::LambertianTexture:

Public Member Functions

 LambertianTexture (Cubemap _cm)
common::Vec3 get_color (const Ray &ray_in, const common::Vec3 &intersection, const common::Vec3 &normal) const override
const Cubemap & get_cubemap () const
MaterialType get_type () const override
Public Member Functions inherited from raytracer::raytracer::Lambertian
 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_albedo () const
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)

Detailed Description

A matte material whose color is sampled from a cubemap texture instead of a single albedo.

Constructor & Destructor Documentation

◆ LambertianTexture()

raytracer::raytracer::LambertianTexture::LambertianTexture ( Cubemap _cm)
explicit

Creates a textured Lambertian material from the given cubemap.

Parameters
_cmThe cubemap from which the color of the material is sampled.

Member Function Documentation

◆ get_color()

common::Vec3 raytracer::raytracer::LambertianTexture::get_color ( const Ray & ray_in,
const common::Vec3 & intersection,
const common::Vec3 & normal ) const
nodiscardoverridevirtual

Computes the color the surface contributes to a ray that hits it, which is multiplied with the color of the scattered ray.

Parameters
ray_inThe incoming ray.
intersectionThe point where the incoming ray hits the surface.
normalThe normal to the surface at the intersection point.
Returns
The color of the surface at the intersection point.

Reimplemented from raytracer::raytracer::Lambertian.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_cubemap()

const Cubemap & raytracer::raytracer::LambertianTexture::get_cubemap ( ) const
nodiscard

Returns a const reference to the cubemap of the material.

Returns
A const reference to the cubemap of the material.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_type()

MaterialType raytracer::raytracer::LambertianTexture::get_type ( ) const
inlinenodiscardoverridevirtual

Returns the type of the material, used to identify the concrete class.

Returns
The type of the material.

Reimplemented from raytracer::raytracer::Lambertian.


The documentation for this class was generated from the following files: