SparrowRenderer/phongmaterial.cpp
2015-08-02 23:40:06 +02:00

23 lines
518 B
C++

#include "phongmaterial.h"
#include "texture.h"
#define TEX_ID 0
void PhongMaterial::bindAttributes()
{
shader->bind();
shader->bindVec3(shader->getLocation("materialKd"), kd);
shader->bindVec3(shader->getLocation("materialKs"), ks);
shader->bindFloat(shader->getLocation("materialNs"), ns);
if(tex != NULL)
{
tex->bind(TEX_ID);
shader->bindInteger(shader->getLocation("baseTexture"), TEX_ID);
}
}
void PhongMaterial::setTexture(Texture* myTexture)
{
tex = myTexture;
}