summaryrefslogtreecommitdiff
path: root/engine/src/renderer
diff options
context:
space:
mode:
Diffstat (limited to 'engine/src/renderer')
-rw-r--r--engine/src/renderer/mod.rs15
1 files changed, 1 insertions, 14 deletions
diff --git a/engine/src/renderer/mod.rs b/engine/src/renderer/mod.rs
index 4f9d7e6..d843020 100644
--- a/engine/src/renderer/mod.rs
+++ b/engine/src/renderer/mod.rs
@@ -372,16 +372,6 @@ fn apply_light(
);
gl_shader_program.set_uniform_vec_3fv(
- cstr!("light.ambient"),
- // There cannot be both a material ambient color and a global ambient color
- &if material_flags.use_ambient_color {
- Color::WHITE_F32.into()
- } else {
- global_light.ambient.clone().into()
- },
- );
-
- gl_shader_program.set_uniform_vec_3fv(
cstr!("light.diffuse"),
&light_source
.map_or(Color::WHITE_F32, |(light_source, _)| {
@@ -401,13 +391,10 @@ fn apply_light(
gl_shader_program.set_uniform_vec_3fv(
cstr!("material.ambient"),
- // When using the material ambient color is disabled, the ambient color has to be
- // white and not black since the material's ambient color is multiplied
- // with the global ambient light in the shader
&if material_flags.use_ambient_color {
material.ambient.clone()
} else {
- Color::WHITE_F32
+ global_light.ambient.clone().into()
}
.into(),
);