summaryrefslogtreecommitdiff
path: root/src/renderer/render.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/renderer/render.c')
-rw-r--r--src/renderer/render.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/renderer/render.c b/src/renderer/render.c
index 7884db6..ca625ed 100644
--- a/src/renderer/render.c
+++ b/src/renderer/render.c
@@ -80,7 +80,7 @@ void default_material_init() {
texture_data_upload(&DEFAULT_MATERIAL.specular_texture);
}
-void draw_model(renderer* ren, camera* camera, model* model, transform tf, scene* scene) {
+void draw_model(renderer* ren, camera* camera, model* model, mat4* model_tf, scene* scene) {
// TRACE("Drawing model: %s", model->name);
mat4 view;
mat4 proj;
@@ -103,11 +103,11 @@ void draw_model(renderer* ren, camera* camera, model* model, transform tf, scene
}
// TRACE("Drawing mesh %d", i);
material* mat = &model->materials->data[m->material_index];
- draw_mesh(ren, m, tf, mat, &view, &proj);
+ draw_mesh(ren, m, model_tf, mat, &view, &proj);
}
}
-void draw_mesh(renderer* ren, mesh* mesh, transform tf, material* mat, mat4* view, mat4* proj) {
+void draw_mesh(renderer* ren, mesh* mesh, mat4* model_tf, material* mat, mat4* view, mat4* proj) {
shader lighting_shader = ren->blinn_phong;
// bind buffer
@@ -119,12 +119,12 @@ void draw_mesh(renderer* ren, mesh* mesh, transform tf, material* mat, mat4* vie
uniform_f32(lighting_shader.program_id, "material.shininess", 32.);
// upload model transform
- mat4 trans = mat4_translation(tf.position);
- mat4 rot = mat4_rotation(tf.rotation);
- mat4 scale = mat4_scale(tf.scale);
- mat4 model_tf = mat4_mult(trans, mat4_mult(rot, scale));
+ // mat4 trans = mat4_translation(tf.position);
+ // mat4 rot = mat4_rotation(tf.rotation);
+ // mat4 scale = mat4_scale(tf.scale);
+ // mat4 model_tf = mat4_mult(trans, mat4_mult(rot, scale));
- uniform_mat4f(lighting_shader.program_id, "model", &model_tf);
+ uniform_mat4f(lighting_shader.program_id, "model", model_tf);
// upload view & projection matrices
uniform_mat4f(lighting_shader.program_id, "view", view);
uniform_mat4f(lighting_shader.program_id, "projection", proj);