summary refs log tree commit diff
path: root/src/GFX/Binder.cpp
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2022-10-23 02:48:51 +0200
committerMel <einebeere@gmail.com>2022-10-23 02:48:51 +0200
commit75a9c87b50cef2f1d749bd9042a9348bc28b4c09 (patch)
tree8d82f3cbbb5bdc63c7e5b6431dac3d49b23a478d /src/GFX/Binder.cpp
parent589bfb5cad0052856077ce867f3858ca3741d95d (diff)
downloadmeowcraft-75a9c87b50cef2f1d749bd9042a9348bc28b4c09.tar.zst
meowcraft-75a9c87b50cef2f1d749bd9042a9348bc28b4c09.zip
Sun lighting
Diffstat (limited to 'src/GFX/Binder.cpp')
-rw-r--r--src/GFX/Binder.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/GFX/Binder.cpp b/src/GFX/Binder.cpp
index e7b7e4c..70d045c 100644
--- a/src/GFX/Binder.cpp
+++ b/src/GFX/Binder.cpp
@@ -10,7 +10,8 @@ BindableMesh Binder::load(Mesh& mesh) {
         store_indices(mesh.raw_indices(), mesh.indices_size());
     }
     store_in_attribute_list(0, 3, mesh.raw(), mesh.size() * 3);
-    store_in_attribute_list(1, 2, mesh.raw_tex_coords(), mesh.tex_coords_size() * 2);
+    store_in_attribute_list(1, 3, mesh.raw_normals(), mesh.normals_size() * 3);
+    store_in_attribute_list(2, 2, mesh.raw_tex_coords(), mesh.tex_coords_size() * 2);
     unbind_vao();
 
     return {vao, mesh.indices_size()};
@@ -50,12 +51,14 @@ void BindableMesh::bind() const {
     glBindVertexArray(m_vao);
     glEnableVertexAttribArray(0);
     glEnableVertexAttribArray(1);
+    glEnableVertexAttribArray(2);
 }
 
 void BindableMesh::unbind() {
     glBindVertexArray(0);
     glDisableVertexAttribArray(0);
     glDisableVertexAttribArray(1);
+    glDisableVertexAttribArray(2);
 }
 
 size_t BindableMesh::size() const {