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

Textured object material. More...

#include <texturedmaterial.hpp>

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

Public Types

enum  Influence { DiffuseColor, Reflexion, Emission, Normal }
 

Public Member Functions

 TexturedMaterial (const color &diffuse, double reflexion=0.0, const photon &emission=photon(), const vector &disturbance=vector(0.0, 0.0, 1.0))
 
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
 
void addTexture (Texture *texture, TextureMap *map, Influence influence=DiffuseColor)
 Add a texture to the material. More...
 
- Public Member Functions inherited from 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. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from rt::Material
static MaterialdefaultMaterial ()
 The default material. More...
 
- Protected Attributes inherited from rt::Material
color _diffuse
 
double _reflexion
 
photon _emission
 
vector _disturbance
 

Detailed Description

Textured 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.

You can add some Texture to a material to alter material properties sush as diffuse color. You can also imagine Texture altering surface normal...

Member Function Documentation

◆ addTexture()

void rt::TexturedMaterial::addTexture ( Texture texture,
TextureMap map,
Influence  influence = DiffuseColor 
)

Add a texture to the material.

Parameters
textureA pointer to the texture.
mapA pointer to the TextureMap used to map a surface element to the Texture.

◆ diffuse()

color rt::TexturedMaterial::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 from rt::Material.


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