gpuray_glsl

view src/material.h @ 4:2ed3da7dc0bc

broken
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 10 Nov 2014 01:26:00 +0200
parents
children
line source
1 /*
2 Simple introductory ray tracer
3 Copyright (C) 2012 John Tsiombikas <nuclear@member.fsf.org>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef MATERIAL_H_
19 #define MATERIAL_H_
21 #include "vmath/vmath.h"
23 // colors are simply RGB vectors
24 typedef Vector3 Color;
26 class Texture;
28 class Material {
29 public:
30 // phong model parameters
31 Color diffuse; // amount of diffuse light scattering (per color channel)
32 Color specular; // amount of specular light reflection (per color channel)
33 float shininess; // higher shininess values -> more focused specular refl.
35 Color emission; // emissive light
37 // additional raytracing parameters
38 float reflectivity; // range [0, 1]
39 float transparency; // range [0, 1]
40 float ior; // index of refraction
42 Texture *tex;
43 Vector4 mega_rect; // tex coords for the megatexture
45 Material();
46 Material(const Color &dcol, const Color &scol = Color(1.0, 1.0, 1.0), float spow = 60.0,
47 float refl = 0.0, float refr = 0.0, float ior = 1.0);
48 };
50 #endif // MATERIAL_H_