From 1a771d9a157bebffad42573d114240a4bfe7f611 Mon Sep 17 00:00:00 2001 From: iurii Date: Thu, 5 Sep 2024 19:07:25 +0300 Subject: fixed specular --- src/main.odin | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/main.odin b/src/main.odin index bb4803e..2b8dd3e 100644 --- a/src/main.odin +++ b/src/main.odin @@ -403,6 +403,7 @@ main :: proc() { shader.set_vec3(lighting_shader, cstring("object_color"), &object_color) shader.set_vec3(lighting_shader, cstring("light_color"), &light_color) shader.set_vec3(lighting_shader, cstring("light_position"), &light_pos) + shader.set_vec3(lighting_shader, cstring("view_position"), &camera.position) aspect: f32 = 800.0 / 600.0 projection := linalg.matrix4_perspective_f32( @@ -426,6 +427,7 @@ main :: proc() { gl.BindVertexArray(cube_vao) gl.DrawArrays(gl.TRIANGLES, 0, 36) + // lamp cube object drawing shader.use(light_cube_shader) shader.set_mat4(light_cube_shader, cstring("projection"), &projection) shader.set_mat4(light_cube_shader, cstring("view"), &view) -- cgit 1.4.1-2-gfad0