summaryrefslogtreecommitdiff
path: root/engine/src/renderer
diff options
context:
space:
mode:
Diffstat (limited to 'engine/src/renderer')
-rw-r--r--engine/src/renderer/mod.rs34
1 files changed, 31 insertions, 3 deletions
diff --git a/engine/src/renderer/mod.rs b/engine/src/renderer/mod.rs
index 5125da8..af91257 100644
--- a/engine/src/renderer/mod.rs
+++ b/engine/src/renderer/mod.rs
@@ -383,21 +383,49 @@ fn apply_light(
.into(),
);
+ gl_shader_program.set_uniform_vec_3fv(
+ cstr!("material.ambient"),
+ &material
+ .ambient()
+ .cloned()
+ .unwrap_or(Color { red: 1.0, green: 1.0, blue: 1.0 })
+ .into(),
+ );
+
+ gl_shader_program.set_uniform_vec_3fv(
+ cstr!("material.diffuse"),
+ &material
+ .diffuse()
+ .cloned()
+ .unwrap_or(Color { red: 1.0, green: 1.0, blue: 1.0 })
+ .into(),
+ );
+
+ #[allow(clippy::cast_possible_wrap)]
+ gl_shader_program.set_uniform_vec_3fv(
+ cstr!("material.specular"),
+ &material
+ .specular()
+ .cloned()
+ .unwrap_or(Color { red: 1.0, green: 1.0, blue: 1.0 })
+ .into(),
+ );
+
#[allow(clippy::cast_possible_wrap)]
gl_shader_program.set_uniform_1i(
- cstr!("material.ambient"),
+ cstr!("material.ambient_map"),
material.ambient_map().into_inner() as i32,
);
#[allow(clippy::cast_possible_wrap)]
gl_shader_program.set_uniform_1i(
- cstr!("material.diffuse"),
+ cstr!("material.diffuse_map"),
material.diffuse_map().into_inner() as i32,
);
#[allow(clippy::cast_possible_wrap)]
gl_shader_program.set_uniform_1i(
- cstr!("material.specular"),
+ cstr!("material.specular_map"),
material.specular_map().into_inner() as i32,
);