only setting uniforms for lit materials

This commit is contained in:
devZoGok
2025-06-15 18:21:09 +03:00
parent c8538aaa40
commit a09f47535e
+3
View File
@@ -188,6 +188,9 @@ namespace vb01{
Vector3 position = node->localToGlobalPosition(Vector3::VEC_ZERO), direction = node->getGlobalAxis(2);
for(Material *m : materials){
Material::BoolUniform *uniform = ((Material::BoolUniform*)m->getUniform("lightingEnabled"));
if(!(uniform && uniform->value)) continue;
Shader *shader = m->getShader();
shader->use();
shader->setInt((int)type, "lights[" + to_string(thisId) + "].type");