gpuray_glsl
view src/material.cc @ 0:f234630e38ff
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 09 Nov 2014 13:03:36 +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 #include "material.h"
20 Material::Material()
21 : diffuse(1.0, 1.0, 1.0), specular(0.0, 0.0, 0.0)
22 {
23 shininess = 60.0;
24 reflectivity = 0.0;
25 transparency = 0.0;
26 ior = 1.0;
28 tex = 0;
29 }
31 Material::Material(const Color &dcol, const Color &scol, float spow,
32 float refl, float refr, float ior)
33 : diffuse(dcol), specular(scol)
34 {
35 shininess = spow;
36 reflectivity = refl;
37 transparency = refr;
38 this->ior = ior;
40 tex = 0;
41 }