-
Notifications
You must be signed in to change notification settings - Fork 0
/
Material.hh
57 lines (39 loc) · 1.1 KB
/
Material.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
Author: dok
Desc: Contains definitions for a few basic materials
*/
#ifndef Material_hh
#define Material_hh
#include "Color.hh"
class RenderContext;
class Ray;
class HitRecord;
// Big awesome comment here
class Material{
private:
public:
virtual void Preprocess() = 0;
virtual Color Shade(const RenderContext& rc, const Ray& ray, const HitRecord& hrec, int depth) const=0;
};
// Big awesome comment here
class LambertianMaterial : public Material{
private:
float kd, ka;
Color color;
public:
LambertianMaterial(Color color, float kd, float ka);
void Preprocess();
Color Shade(const RenderContext& rc, const Ray& ray, const HitRecord& hrec, int depth) const;
};
// big awesome comment here
class PhongMaterial : public Material{
private:
float kd, ka, ks, ke;
float n;
Color color;
public:
PhongMaterial(Color color, float ke, float kd, float ka, float ks, float shininess);
void Preprocess();
Color Shade(const RenderContext& rc, const Ray& ray, const HitRecord& hrec, int depth) const;
};
#endif