-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMaterial.h
More file actions
47 lines (36 loc) · 1019 Bytes
/
Material.h
File metadata and controls
47 lines (36 loc) · 1019 Bytes
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
#ifndef MATERIAL_H
#define MATERIAL_H
#include <cassert>
#include <vecmath.h>
#include "Ray.h"
#include "Hit.h"
#include "texture.hpp"
#include "Noise.h"
class Material
{
public:
Material( const Vector3f& d_color ,const Vector3f& s_color=Vector3f::ZERO, float s=0,
float r =0, int rough = 0 );
virtual ~Material();
virtual Vector3f getDiffuseColor() const ;
float getShininess() const;
Vector3f Shade( const Ray& ray, const Hit& hit,
const Vector3f& dirToLight, const Vector3f& lightColor ) ;
static Vector3f pointwiseDot( const Vector3f& v1 , const Vector3f& v2 );
float clampedDot( const Vector3f& L , const Vector3f& N )const;
void loadTexture(const char * filename);
float getRefractionIndex();
int getRoughness()const;
Vector3f getDiffuseColor();
Vector3f getSpecularColor();
void setNoise(const Noise & n);
protected:
Vector3f diffuseColor;
float refractionIndex;
float shininess;
Vector3f specularColor;
Texture t;
Noise noise;
int roughness;
};
#endif // MATERIAL_H