-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMaterial.h
87 lines (71 loc) · 2.02 KB
/
Material.h
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#pragma once
#include "Vector2.h"
#include "Shape.h"
#include "Ray.h"
#include "rgb.h"
#include "ONB.h"
class Material
{
public:
Material() { this->emission = rgb(); }
virtual rgb AmbientResponse(const Vector3 &tex_point, const Vector2 &uv) { return rgb(); }
virtual rgb EmissionResponse() { return this->emission; }
//////////////////////////////////////////////////////////////////////////
virtual bool IsDiffuse() { return false; }
virtual bool ExplicitBRDF(const Vector3 &tex_point, const Vector2 &uv, rgb &) { return false; }
virtual void setEmission(float inintensity) {}
virtual bool DiffuseDirection(const ONB &,
const Vector3 &incident,
const Vector3 &tex_point,
const Vector2 &uv,
Vector2 &seed,
rgb &,
Vector3 &) {
return false;
}
//////////////////////////////////////////////////////////////////////////
virtual bool IsPhongMetal() { return false; }
virtual bool PhongMetalDirection(const ONB &,
const Vector3 &incident,
const Vector3 &tex_point,
const Vector2 &uv,
Vector2 &seed,
rgb &,
Vector3 &) {
return false;
}
//////////////////////////////////////////////////////////////////////////
virtual bool IsDielectric() { return false; }
virtual bool SpecularDirection(const ONB &uvw,
const Vector3 &in_dir,
const Vector3 &tex_pos,
const Vector2 &uv,
Vector2 &rseed,
rgb &ratio,
Vector3 &reflection) {
return false;
}
virtual void setColor(const rgb&) {}
//////////////////////////////////////////////////////////////////////////
virtual bool IsRefract() { return false; }
virtual bool RefractDirection(const ONB &uvw,
const Vector3 &in_dir,
const Vector3 &tex_pos,
const Vector2 &uv,
Vector2 &rseed,
rgb &ratio,
Vector3 &refraction) {
return false;
}
virtual bool IsMixRefractflec() { return true; }
virtual bool RefractflecDirection(const ONB &uvw,
const Vector3 &in_dir,
const Vector3 &tex_pos,
const Vector2 &uv,
Vector2 &rseed,
rgb &ratio,
Vector3 &refraction, Vector3& reflection, float& Fe) {
return false;
}
rgb emission;
};