Fix physical material when no lights
@@ -180,7 +180,6 @@ impl Material for PhysicalMaterial {
}
program.use_uniform("metallic", self.metallic)?;
program.use_uniform_if_required("roughness", self.roughness)?;
- program.use_uniform("albedo", self.albedo)?;
if program.requires_uniform("albedoTexture") {
if let Some(ref texture) = self.albedo_texture {
program.use_texture("albedoTexture", texture)?;
@@ -204,6 +203,7 @@ impl Material for PhysicalMaterial {
}
}
}
+ program.use_uniform("albedo", self.albedo)?;
program.use_uniform("emissive", self.emissive)?;
if program.requires_uniform("emissiveTexture") {
if let Some(ref texture) = self.emissive_texture {
