Skip to content

Commit 8c83292

Browse files
USD Viewer: set debug view mode through render delegate
1 parent af2751e commit 8c83292

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Samples/USDViewer/src/USDViewer.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023 Diligent Graphics LLC
2+
* Copyright 2023-2024 Diligent Graphics LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -583,8 +583,10 @@ void USDViewer::UpdateUI()
583583
DebugViews[static_cast<size_t>(PBR_Renderer::DebugViewType::Thickness)] = "Volume Thickness";
584584
static_assert(static_cast<size_t>(PBR_Renderer::DebugViewType::NumDebugViews) == 33, "Did you add a new debug view mode? You may want to handle it here");
585585

586-
if (ImGui::Combo("Debug view", &m_RenderParams.DebugViewMode, DebugViews.data(), static_cast<int>(DebugViews.size())))
587-
UpdateRenderParams = true;
586+
if (ImGui::Combo("Debug view", &m_DebugViewMode, DebugViews.data(), static_cast<int>(DebugViews.size())))
587+
{
588+
m_Stage.RenderDelegate->SetDebugView(static_cast<PBR_Renderer::DebugViewType>(m_DebugViewMode));
589+
}
588590
}
589591

590592
{

Samples/USDViewer/src/USDViewer.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023 Diligent Graphics LLC
2+
* Copyright 2023-2024 Diligent Graphics LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -111,6 +111,8 @@ class USDViewer final : public SampleBase
111111
USD::HnPostProcessTaskParams m_PostProcessParams;
112112
USD::HnBeginFrameTaskParams m_FrameParams;
113113

114+
int m_DebugViewMode = 0;
115+
114116
struct ModelInfo
115117
{
116118
std::string Name;

0 commit comments

Comments
 (0)