Disabled UI rendering in camera previews

This commit is contained in:
antopilo
2024-09-13 17:26:21 -04:00
parent 89ea32a4b3
commit 1b89eaa695
3 changed files with 9 additions and 7 deletions

View File

@@ -2695,7 +2695,7 @@ namespace Nuake {
auto sceneRenderer = Engine::GetCurrentScene()->m_SceneRenderer;
sceneRenderer->BeginRenderScene(cam->GetPerspective(), cam->GetTransform(), cam->Translation);
sceneRenderer->RenderScene(*Engine::GetCurrentScene().get(), *virtualCamera.get());
sceneRenderer->RenderScene(*Engine::GetCurrentScene().get(), *virtualCamera.get(), false);
virtualCamera->Clear();
ImGui::Image((void*)virtualCamera->GetTexture()->GetID(), { 640, 360 }, { 0, 1 }, {1, 0});

View File

@@ -139,7 +139,7 @@ namespace Nuake
/// </summary>
/// <param name="scene">Scene to render</param>
/// <param name="framebuffer">Framebuffer to render the scene to. Should be in the right size</param>
void SceneRenderer::RenderScene(Scene& scene, FrameBuffer& framebuffer)
void SceneRenderer::RenderScene(Scene& scene, FrameBuffer& framebuffer, bool renderUI)
{
ZoneScoped;
@@ -179,8 +179,10 @@ namespace Nuake
);
// World Space UI
DebugRendererPass(scene);
if (renderUI)
{
DebugRendererPass(scene);
}
Ref<Texture> finalOutput = mShadingBuffer->GetTexture();
if (scene.GetEnvironment()->BloomEnabled)
@@ -291,7 +293,7 @@ namespace Nuake
}
mToneMapBuffer->Unbind();
if (sceneEnv->SSREnabled)
if (sceneEnv->SSREnabled && renderUI)
{
sceneEnv->mSSR->Resize(framebufferResolution);
sceneEnv->mSSR->Draw(mGBuffer.get(), framebuffer.GetTexture(), mView, mProjection, scene.GetCurrentCamera());
@@ -449,7 +451,7 @@ namespace Nuake
continue;
}
if (!uiComponent.IsWorldSpace)
if (!uiComponent.IsWorldSpace && renderUI)
{
// Fetch resource from resource manager using UUID
Ref<UIResource> uiResource = ResourceManager::GetResource<UIResource>(uiComponent.UIResource);

View File

@@ -54,7 +54,7 @@ namespace Nuake
void Update(const Timestep time, bool isEditorUpdate = false);
void BeginRenderScene(const Matrix4& projection, const Matrix4& view, const Vector3& camPos);
void RenderScene(Scene& scene, FrameBuffer& framebuffer);
void RenderScene(Scene& scene, FrameBuffer& framebuffer, bool renderUI = true);
FrameBuffer& GetGBuffer() const
{