X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fmaterial.cc;h=26ab63d40a01eec083d18dd1e1da68bb85c96720;hp=ac8c11247909590c776e2f6fcacacd28fb93daa2;hb=d47a663825bd358d2165c1a4b040cc828aeb4991;hpb=8137121400748ee8afb1608253aae15323c5e3a2 diff --git a/src/material.cc b/src/material.cc index ac8c112..26ab63d 100644 --- a/src/material.cc +++ b/src/material.cc @@ -2,6 +2,8 @@ #include #include "opengl.h" #include "material.h" +#include "sdr.h" +#include "app.h" Material::Material() : diffuse(1.0f, 1.0f, 1.0f) @@ -9,6 +11,9 @@ Material::Material() shininess = 0.0f; alpha = 1.0f; memset(stdtex, 0, sizeof stdtex); + + reflect = 0.0f; + flat_mirror = false; } void Material::setup() const @@ -20,17 +25,79 @@ void Material::setup() const glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, ks); glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, shininess); + /* int ntex = std::min((int)textures.size(), 8); // TODO: use max texture units for(int i=0; i::iterator it = std::find(textures.begin(), textures.end(), tex); + if(it != textures.end()) { + textures.erase(it); + } + + for(int i=0; i