diff --git a/Core/Core/RenderEngine/RenderEngine.cpp b/Core/Core/RenderEngine/RenderEngine.cpp index 3eda8c7..aef7369 100644 --- a/Core/Core/RenderEngine/RenderEngine.cpp +++ b/Core/Core/RenderEngine/RenderEngine.cpp @@ -86,7 +86,7 @@ std::array RenderEngine::Vertex::get_verte // Bind vertex loc descriptions[0].binding = 0; descriptions[0].location = 0; - descriptions[0].format = VK_FORMAT_R32G32_SFLOAT; + descriptions[0].format = VK_FORMAT_R32G32B32_SFLOAT; descriptions[0].offset = offsetof(Vertex, pos); // Bind color diff --git a/Core/Core/RenderEngine/RenderEngine.hpp b/Core/Core/RenderEngine/RenderEngine.hpp index 76a33f4..c34b233 100644 --- a/Core/Core/RenderEngine/RenderEngine.hpp +++ b/Core/Core/RenderEngine/RenderEngine.hpp @@ -39,7 +39,7 @@ class RenderEngine }; struct Vertex { - glm::vec2 pos; + glm::vec3 pos; glm::vec3 color; static VkVertexInputBindingDescription get_binding_description(); static std::array get_vertex_attribute_descriptions(); @@ -51,13 +51,22 @@ class RenderEngine }; const std::vector vertices_ = { - {{-0.5f, -0.5f}, {1.0f, 0.0f, 0.0f}}, - {{0.5f, -0.5f}, {0.0f, 1.0f, 0.0f}}, - {{0.5f, 0.5f}, {0.0f, 0.0f, 1.0f}}, - {{-0.5f, 0.5f}, {1.0f, 1.0f, 1.0f}} + {{-0.5f, -0.5f, 0.5f}, {1.0f, 0.0f, 0.0f}}, + {{0.5f, -0.5f, 0.5f}, {0.0f, 1.0f, 0.0f}}, + {{0.5f, 0.5f, 0.5f}, {0.0f, 0.0f, 1.0f}}, + {{-0.5f, 0.5f, 0.5f}, {1.0f, 1.0f, 1.0f}}, + {{-0.5f, -0.5f, -0.5f}, {1.0f, 0.0f, 0.0f}}, + {{0.5f, -0.5f, -0.5f}, {0.0f, 1.0f, 0.0f}}, + {{0.5f, 0.5f, -0.5f}, {0.0f, 0.0f, 1.0f}}, + {{-0.5f, 0.5f, -0.5f}, {1.0f, 1.0f, 1.0f}} }; const std::vector indices_ = { - 0, 1, 2, 2, 3, 0 + 0, 1, 2, 2, 3, 0, + 2, 1, 5, 5, 6, 2, + 0, 3, 7, 7, 4, 0, + 3, 2, 6, 6, 7, 3, + 7, 6, 5, 5, 4, 7, + 4, 5, 1, 1, 0, 4 }; ModelManager model_manager_; diff --git a/TestGame/Shaders/vertex.vert b/TestGame/Shaders/vertex.vert index 1fdfb51..531ff89 100644 --- a/TestGame/Shaders/vertex.vert +++ b/TestGame/Shaders/vertex.vert @@ -6,13 +6,13 @@ layout(binding = 0) uniform UniformBufferObject { mat4 proj; } ubo; -layout(location = 0) in vec2 inPosition; +layout(location = 0) in vec3 inPosition; layout(location = 1) in vec3 inColor; layout(location = 0) out vec3 fragColor; void main() { - gl_Position = ubo.proj * ubo.view * ubo.model * vec4(inPosition, 0.0, 1.0); + gl_Position = ubo.proj * ubo.view * ubo.model * vec4(inPosition, 1.0); fragColor = inColor; } \ No newline at end of file