mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-24 04:57:45 +00:00
Add support for modifying the renderer view matrix
This commit is contained in:
parent
810a3eede3
commit
b216a670b2
2 changed files with 3 additions and 1 deletions
|
@ -113,4 +113,6 @@ public:
|
|||
VkDescriptorSet createDescriptorFor(const RenderModel& model, const RenderMaterial& material);
|
||||
|
||||
int hash(const RenderModel& model, const RenderMaterial& material);
|
||||
|
||||
glm::mat4 view;
|
||||
};
|
|
@ -503,7 +503,7 @@ void Renderer::render(std::vector<RenderModel> models) {
|
|||
|
||||
glm::mat4 p = glm::perspective(glm::radians(45.0f), swapchainExtent.width / (float) swapchainExtent.height,
|
||||
0.1f, 100.0f);
|
||||
glm::mat4 v = glm::lookAt(glm::vec3(0, 1, 1), glm::vec3(0, 1, 0), glm::vec3(0, -1, 0));
|
||||
glm::mat4 v = view;
|
||||
glm::mat4 vp = p * v;
|
||||
|
||||
vkCmdPushConstants(commandBuffer, pipelineLayout, VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(glm::mat4), &vp);
|
||||
|
|
Loading…
Add table
Reference in a new issue