|
Ray Tracer Common Project
Image rendering program based on the ray tracing technique.
|
Textured object material. More...
#include <texturedmaterial.hpp>
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 Material * | defaultMaterial () |
| The default material. More... | |
Protected Attributes inherited from rt::Material | |
| color | _diffuse |
| double | _reflexion |
| photon | _emission |
| vector | _disturbance |
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...
| void rt::TexturedMaterial::addTexture | ( | Texture * | texture, |
| TextureMap * | map, | ||
| Influence | influence = DiffuseColor |
||
| ) |
Add a texture to the material.
| texture | A pointer to the texture. |
| map | A pointer to the TextureMap used to map a surface element to the Texture. |
|
virtual |
Get the diffuse color of a surface element.
| e | A surface element attached (or not) to this material. |
Reimplemented from rt::Material.
1.8.15