From eb270458de24c7346adc1ab0a4fe1c409a2008ae Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 23 May 2024 19:37:47 +0200 Subject: refactor(engine): seperate light properties in shader --- engine/src/renderer/opengl.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'engine/src') diff --git a/engine/src/renderer/opengl.rs b/engine/src/renderer/opengl.rs index c97d8dd..89f920c 100644 --- a/engine/src/renderer/opengl.rs +++ b/engine/src/renderer/opengl.rs @@ -434,27 +434,30 @@ fn set_point_light_uniforms( ); gl_shader_program.set_uniform_vec_3fv( - &create_point_light_uniform_name(point_light_index, "diffuse"), + &create_point_light_uniform_name(point_light_index, "phong.diffuse"), &point_light.diffuse.clone().into(), ); gl_shader_program.set_uniform_vec_3fv( - &create_point_light_uniform_name(point_light_index, "specular"), + &create_point_light_uniform_name(point_light_index, "phong.specular"), &point_light.specular.clone().into(), ); gl_shader_program.set_uniform_1fv( - &create_point_light_uniform_name(point_light_index, "constant"), + &create_point_light_uniform_name(point_light_index, "attenuation_props.constant"), point_light.attenuation_params.constant, ); gl_shader_program.set_uniform_1fv( - &create_point_light_uniform_name(point_light_index, "linear"), + &create_point_light_uniform_name(point_light_index, "attenuation_props.linear"), point_light.attenuation_params.linear, ); gl_shader_program.set_uniform_1fv( - &create_point_light_uniform_name(point_light_index, "quadratic"), + &create_point_light_uniform_name( + point_light_index, + "attenuation_props.quadratic", + ), point_light.attenuation_params.quadratic, ); } -- cgit v1.2.3-18-g5258