diff options
author | HampusM <hampus@hampusmat.com> | 2024-05-23 19:37:47 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2024-05-23 20:09:54 +0200 |
commit | eb270458de24c7346adc1ab0a4fe1c409a2008ae (patch) | |
tree | 166401361c9b3eb4f72e32cdb8fca8190f54daa1 /engine/src | |
parent | 42f4da1c9670e4e9829a822a50dc708794744ca1 (diff) |
refactor(engine): seperate light properties in shader
Diffstat (limited to 'engine/src')
-rw-r--r-- | engine/src/renderer/opengl.rs | 13 |
1 files changed, 8 insertions, 5 deletions
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, ); } |