summaryrefslogtreecommitdiff
path: root/model.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'model.cpp')
-rw-r--r--model.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/model.cpp b/model.cpp
index 4c5edcc..778d945 100644
--- a/model.cpp
+++ b/model.cpp
@@ -20,7 +20,9 @@ struct Mat_Cbuffer {
float metalness;
float roughness;
float ao;
- char pad[40];
+ char pad2[8];
+ float camera_pos[3];
+ char pad[20];
};
void Material::use(
@@ -316,6 +318,9 @@ void Model_Instance::update_cbuffers(
mat.metalness = sm.metalness;
mat.roughness = sm.roughness;
mat.ao = sm.ao;
+ mat.camera_pos[0] = cam.position.x;
+ mat.camera_pos[1] = cam.position.y;
+ mat.camera_pos[2] = cam.position.z;
}
dev->unmap_buffer(mvp);
dev->unmap_buffer(mat);