From 2ca743d8df36f8cf863caa9c40f965398f72ef2e Mon Sep 17 00:00:00 2001 From: sanine-a Date: Sun, 24 May 2020 18:49:46 -0500 Subject: add blinn-phong lighting demo --- src/shader.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/shader.c b/src/shader.c index e9d79a6..cba83f7 100644 --- a/src/shader.c +++ b/src/shader.c @@ -119,6 +119,16 @@ void honey_shader_set_vec3(honey_shader shader, /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +void honey_shader_set_mat3(honey_shader shader, + char* matrix_name, + mat3 value) { + glUseProgram(shader); + unsigned int matrix_location = glGetUniformLocation(shader, matrix_name); + glUniformMatrix3fv(matrix_location, 1, GL_FALSE, (float*) value); +} + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + void honey_shader_set_mat4(honey_shader shader, char* matrix_name, mat4 value) { -- cgit v1.2.1