clray
diff src/mesh.cc @ 16:9e4a28063394
cl compiler segfaults...
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 09 Aug 2010 04:18:21 +0100 |
parents | 754faf15ba36 |
children | 8baea9b66b50 |
line diff
1.1 --- a/src/mesh.cc Sun Aug 08 09:51:45 2010 +0100 1.2 +++ b/src/mesh.cc Mon Aug 09 04:18:21 2010 +0100 1.3 @@ -28,6 +28,7 @@ 1.4 CMD(KA), \ 1.5 CMD(KD), \ 1.6 CMD(KS), \ 1.7 + CMD(KR), \ 1.8 CMD(NS), \ 1.9 CMD(NI), \ 1.10 CMD(D), \ 1.11 @@ -84,6 +85,7 @@ 1.12 float shininess; // Ns 1.13 float ior; // Ni 1.14 float alpha; // d, Tr 1.15 + float refl; // Kr (my extesnsion) 1.16 1.17 string tex_dif, tex_spec, tex_shin, tex_alpha; // map_Kd, map_Ks, map_Ns, map_d 1.18 string tex_refl; // refl -type sphere|cube file 1.19 @@ -316,7 +318,7 @@ 1.20 mat.ks[2] = vmtl[i].specular.z; 1.21 1.22 mat.kt = 1.0 - vmtl[i].alpha; 1.23 - mat.kr = 0.0; // TODO 1.24 + mat.kr = vmtl[i].refl; 1.25 mat.spow = vmtl[i].shininess; 1.26 1.27 matlib.push_back(mat); 1.28 @@ -487,6 +489,12 @@ 1.29 parse_color(&mat.specular); 1.30 break; 1.31 1.32 + case CMD_KR: 1.33 + if((tok = strtok(0, SEP)) && is_float(tok)) { 1.34 + mat.refl = atof(tok); 1.35 + } 1.36 + break; 1.37 + 1.38 case CMD_NS: 1.39 if((tok = strtok(0, SEP)) && is_float(tok)) { 1.40 mat.shininess = atof(tok);