Subversion Repositories gelsvn

Rev

Rev 443 | Rev 601 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
443 jab 1
#ifndef __GEOMETRY_MATERIAL_H__
2
#define __GEOMETRY_MATERIAL_H__
78 jab 3
 
4
#include <string>
5
#include <vector>
6
#include "CGLA/Vec3f.h"
7
#include "CGLA/Vec3i.h"
8
 
79 jab 9
namespace Geometry
78 jab 10
{
178 bj 11
		struct Material
12
		{
13
				/// Name of material
14
				std::string name;
15
 
16
				/// Diffuse reflection
17
				float diffuse[4];			
18
 
19
				/// Ambient reflection
20
				float ambient[4];
21
 
22
				/// Specular reflection
23
				float specular[4];		
24
 
25
				/// Specular exponent
26
				float shininess;			
78 jab 27
 
510 jrf 28
        /// Index of refraction
29
        float ior;
421 jrf 30
 
31
        /// Transmission filter
32
        float transmission[3];
33
 
34
        /** Illumination model
35
 
36
              1 - Color and ambient
37
              2 - Color and ambient and highlight
38
              3 - Reflection
39
              4 - Reflection and refraction
40
            Refer to the MTL format specification for more models. 
41
            Only numbers from 0 to 10 have a specific meaning. */
42
        int illum;
43
 
44
        bool has_texture;
178 bj 45
				std::string tex_path, tex_name;
46
				int tex_id;
47
 
48
			Material():	name("default"),
510 jrf 49
					 tex_path(""), tex_name(""), tex_id(-1), has_texture(false) 
178 bj 50
						{
510 jrf 51
                ior = 1.5f;
423 jrf 52
								shininess = 0.0f;
195 jrf 53
								diffuse[0] = 0.8f;
54
								diffuse[1] = 0.8f;
55
								diffuse[2] = 0.8f;
56
								diffuse[3] = 1.0f;
57
								ambient[0] = 0.2f;
58
								ambient[1] = 0.2f;
59
								ambient[2] = 0.2f;
60
								ambient[3] = 1.0f;
61
								specular[0] = 0.0f;
62
								specular[1] = 0.0f;
63
								specular[2] = 0.0f;
64
								specular[3] = 1.0f;
421 jrf 65
                transmission[0] = 0.0f;
66
                transmission[1] = 0.0f;
67
                transmission[2] = 0.0f;
68
                illum = 2;
178 bj 69
						}
70
		};
78 jab 71
}
72
 
73
#endif