Ray Tracer Common Project
Image rendering program based on the ray tracing technique.
texturedmaterial.hpp
1 #pragma once
2 
3 #include "material.hpp"
4 
5 namespace rt{
6 
20 class TexturedMaterial : public Material{
21 public:
22  enum Influence{
23  DiffuseColor,
24  Reflexion,
25  Emission,
26  Normal
27  };
28 
29  TexturedMaterial(const color & diffuse, double reflexion = 0.0, const photon & emission = photon(), const vector & disturbance = vector(0.0, 0.0, 1.0));
31 
36  virtual color diffuse(const element & e, const photon & external_light) const;
37 
38  virtual double reflexion(const element & e, const photon & external_light) const;
39 
40  virtual photon emission(const element & e, const photon & external_light) const;
41 
42  virtual vector disturbance(const element & e, const photon & external_light) const;
43 
50  void addTexture(Texture *texture, TextureMap *map, Influence influence = DiffuseColor);
51 
52 private:
53  std::list<std::pair<Texture *, TextureMap *> > _diffuse_textures;
54  std::list<std::pair<Texture *, TextureMap *> > _mirror_textures;
55  std::list<std::pair<Texture *, TextureMap *> > _emit_textures;
56  std::list<std::pair<Texture *, TextureMap *> > _normal_textures;
57 };
58 
59 }
Object material.
Definition: material.hpp:39
void addTexture(Texture *texture, TextureMap *map, Influence influence=DiffuseColor)
Add a texture to the material.
Definition: texturedmaterial.cpp:15
Material texture.
Definition: texture.hpp:28
Definition: bitmap.cpp:4
RGBA color representation.
Definition: color.hpp:31
3D vector
Definition: vector.hpp:28
Geometric surface element unit.
Definition: element.hpp:43
Surface element to Texture map.
Definition: texturemap.hpp:27
Light photon class.
Definition: photon.hpp:28
Textured object material.
Definition: texturedmaterial.hpp:20
virtual color diffuse(const element &e, const photon &external_light) const
Get the diffuse color of a surface element.
Definition: texturedmaterial.cpp:32