46 {
48
49 RenderBehaveBuilder builder{ this ,frameInfo.m_FrameIndex, frameInfo.m_ImageIndex };
50
51 builder.BeginRenderPass();
52
53 builder.UpdateUniformBuffer<SpicesShader::View>(0, 0, [&](auto& ubo) {
56 const VkExtent2D windowSize =
m_Device->GetSwapChainSupport().surfaceSize;
57
58 ubo.projection = projectionMatrix;
59
60 ubo.nprojection = projectionMatrix;
61 ubo.nprojection[1][1] *= -1.0f;
62
63 ubo.view = glm::inverse(invViewMatrix);
64
65 ubo.inView = invViewMatrix;
66
67 ubo.sceneTextureSize = {
68 sceneTextureSize.x,
69 sceneTextureSize.y,
70 1.0f / sceneTextureSize.x,
71 1.0f / sceneTextureSize.y
72 };
73
74 ubo.windowSize = {
75 static_cast<float>(windowSize.width),
76 static_cast<float>(windowSize.height),
77 1.0f / static_cast<float>(windowSize.width),
78 1.0f / static_cast<float>(windowSize.height)
79 };
80
81 ubo.stableFrames = stableFrames;
82
83 ubo.fov = fov;
84 });
85
86 builder.UpdateUniformBuffer<SpicesShader::Input>(0, 1, [&](auto& ubo) {
88
89 ubo.gameTime = ts.gt();
90 ubo.frameTime = ts.ft();
91 ubo.mousePos = glm::vec4(
92 static_cast<float>(x),
93 static_cast<float>(y),
94 1.0f / static_cast<float>(x),
95 1.0f / static_cast<float>(y)
96 );
97 });
98
99 builder.EndRenderPass();
100 }
#define SPICES_PROFILE_ZONE
std::tuple< glm::mat4, glm::mat4, unsigned int, float > GetActiveCameraMatrix(FrameInfo &frameInfo)
Get The activated camera entity's view matrix and projection matrix.
std::shared_ptr< VulkanDevice > m_Device
VulkanDevice , Passed by instanced.
static std::shared_ptr< SlateRegister > GetRegister()
Get slate register.