parent
0ab683e827
commit
aa3c00a784
1 changed files with 10 additions and 19 deletions
|
|
@ -731,18 +731,13 @@ public:
|
|||
updateUniformBuffers();
|
||||
}
|
||||
|
||||
void updateUniformBuffers(bool viewchanged = true)
|
||||
{
|
||||
if (viewchanged)
|
||||
void updateUniformBuffers()
|
||||
{
|
||||
uboVS.projection = camera.matrices.perspective;
|
||||
uboVS.modelView = camera.matrices.view;
|
||||
uboVS.viewPos = camera.viewPos;
|
||||
}
|
||||
else
|
||||
{
|
||||
uboVS.depth += frameTimer * 0.15f;
|
||||
if (uboVS.depth > 1.0f)
|
||||
if (uboVS.depth > 1.0f) {
|
||||
uboVS.depth = uboVS.depth - 1.0f;
|
||||
}
|
||||
memcpy(uniformBufferVS.mapped, &uboVS, sizeof(uboVS));
|
||||
|
|
@ -768,13 +763,9 @@ public:
|
|||
if (!prepared)
|
||||
return;
|
||||
draw();
|
||||
if (!paused || camera.updated)
|
||||
updateUniformBuffers(camera.updated);
|
||||
if (!paused) {
|
||||
updateUniformBuffers();
|
||||
}
|
||||
|
||||
virtual void viewChanged()
|
||||
{
|
||||
updateUniformBuffers(true);
|
||||
}
|
||||
|
||||
virtual void OnUpdateUIOverlay(vks::UIOverlay *overlay)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue