aboutsummaryrefslogtreecommitdiff
path: root/src/vulkan_utils.hpp
diff options
context:
space:
mode:
authorvimene <vincent.menegaux@gmail.com>2025-12-29 21:21:09 +0100
committervimene <vincent.menegaux@gmail.com>2025-12-29 21:21:09 +0100
commit8ab4780f134c33a9e11ac0fe0bd866e17d3ee650 (patch)
treee59efd8a466312b790a2d68e679700b47e748c75 /src/vulkan_utils.hpp
parentdd187445972989dc44428e8cf185964da9e5c0c4 (diff)
downloadengine-8ab4780f134c33a9e11ac0fe0bd866e17d3ee650.tar.gz
starting to merge vulkan with the engine
- refactored scene_main to be able to share code between software and hardware renderers, while still sharing code between terminal software renderer and graphical software renderer - made the hardware renderer use scene objects vertices and transforms, instead of hardcoded ones - made the hardware renderer use the scene's camera - made .obj parser create Vector3 instead of Vector4, which didn't made sense - removed unnecessary std:: - lots of small changes
Diffstat (limited to 'src/vulkan_utils.hpp')
-rw-r--r--src/vulkan_utils.hpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/vulkan_utils.hpp b/src/vulkan_utils.hpp
index 1647e91..c822caa 100644
--- a/src/vulkan_utils.hpp
+++ b/src/vulkan_utils.hpp
@@ -39,7 +39,7 @@ struct Vertex {
};
}
- static constexpr std::array<VkVertexInputAttributeDescription, 3> get_attr_descs() {
+ static constexpr std::array<VkVertexInputAttributeDescription, 2> get_attr_descs() {
return {
VkVertexInputAttributeDescription {
.location = 0,
@@ -51,25 +51,21 @@ struct Vertex {
.location = 1,
.binding = 0,
.format = VK_FORMAT_R32G32B32_SFLOAT,
- .offset = offsetof(Vertex, col),
- },
- VkVertexInputAttributeDescription {
- .location = 2,
- .binding = 0,
- .format = VK_FORMAT_R32G32_SFLOAT,
- .offset = offsetof(Vertex, uv),
+ .offset = offsetof(Vertex, normal),
},
};
}
engine::math::Vector3 pos;
- engine::math::Vector3 col;
- engine::math::Vector2 uv;
+ engine::math::Vector3 normal;
};
// TODO: move to a better place. Also, see TODOs for struct Vertex
struct UniformBufferObject {
alignas(16) engine::math::Matrix4 model, view, proj;
+ // TODO: should me Matrix3, but it isn't implemented yet
+ alignas(16) engine::math::Matrix4 camera_rot;
+ alignas(16) engine::math::Vector3 camera_loc;
};
}