Ray Tracer Common Project
Image rendering program based on the ray tracing technique.
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
rt::Material Class Reference

Object material. More...

#include <material.hpp>

Inheritance diagram for rt::Material:
rt::DayNightMaterial rt::TexturedMaterial

Public Member Functions

 Material (const color &diffuse, double reflexion=0.0, const photon &emission=photon(), const vector &disturbance=vector(0.0, 0.0, 1.0))
 Make a new material. More...
 
virtual color diffuse (const element &e, const photon &external_light) const
 Get the diffuse color of a surface element. More...
 
virtual double reflexion (const element &e, const photon &external_light) const
 
virtual photon emission (const element &e, const photon &external_light) const
 
virtual vector disturbance (const element &e, const photon &external_light) const
 

Static Public Member Functions

static MaterialdefaultMaterial ()
 The default material. More...
 

Protected Attributes

color _diffuse
 
double _reflexion
 
photon _emission
 
vector _disturbance
 

Detailed Description

Object material.

A material describes how a geometric element is rendered. More precisely, a material provides all informations needed by rt::ray to compute light comportement on a surface element.

A trivial attribute is the diffuse color of the material, the maner the material absorb the diffuse reflexion.

Constructor & Destructor Documentation

◆ Material()

rt::Material::Material ( const color diffuse,
double  reflexion = 0.0,
const photon emission = photon(),
const vector disturbance = vector(0.0, 0.0, 1.0) 
)

Make a new material.

Parameters
diffuseThe material diffuse color.

Member Function Documentation

◆ defaultMaterial()

Material * rt::Material::defaultMaterial ( )
static

The default material.

Returns
A material used when no Material is given.

◆ diffuse()

color rt::Material::diffuse ( const element e,
const photon external_light 
) const
virtual

Get the diffuse color of a surface element.

Parameters
eA surface element attached (or not) to this material.

Reimplemented in rt::TexturedMaterial, and rt::DayNightMaterial.


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