normal maps

This commit is contained in:
devZoGok
2021-10-19 19:06:40 +03:00
parent d52be66e3d
commit e95e40177a
9 changed files with 53 additions and 16 deletions
+6 -3
View File
@@ -40,8 +40,11 @@ namespace vb01{
void Material::update(){
shader->use();
if(type==MATERIAL_2D)
if(type==MATERIAL_2D){
shader->setBool(lightingEnabled,"lightingEnabled");
if(normalMapEnabled)
shader->setBool(normalMapEnabled,"normalMapEnabled");
}
shader->setBool(texturingEnabled,"texturingEnabled");
if(type==MATERIAL_GUI){
shader->setBool(diffuseColorEnabled,"diffuseColorEnabled");
@@ -52,9 +55,9 @@ namespace vb01{
for(Texture *t : diffuseMapTextures)
t->update();
for(Texture *t : normalMapTextures)
t->update();
t->update(2);
for(Texture *t : specularMapTextures)
t->update();
t->update(3);
}
else {
shader->setVec4(diffuseColor,"diffuseColor");