Skip to content

Commit 24f4808

Browse files
USD and GLTF Viewers: added scene depth debug view mode
1 parent f82099d commit 24f4808

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Samples/GLTFViewer/src/GLTFViewer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -993,8 +993,9 @@ void GLTFViewer::UpdateUI()
993993
{GLTF_PBR_Renderer::DebugViewType::IridescenceThickness, "Iridescence Thickness"},
994994
{GLTF_PBR_Renderer::DebugViewType::Transmission, "Transmission"},
995995
{GLTF_PBR_Renderer::DebugViewType::Thickness, "Volume Thickness"},
996+
{GLTF_PBR_Renderer::DebugViewType::SceneDepth, "Scene Depth"},
996997
};
997-
static_assert(_countof(DebugViews) == 34, "Did you add a new debug view mode? You may want to handle it here");
998+
static_assert(_countof(DebugViews) == 35, "Did you add a new debug view mode? You may want to handle it here");
998999

9991000
ImGui::Combo("Debug view", &m_RenderParams.DebugView, DebugViews, _countof(DebugViews), 15);
10001001
}
@@ -1485,6 +1486,8 @@ void GLTFViewer::Update(double CurrTime, double ElapsedTime)
14851486
const auto& SCDesc = m_pSwapChain->GetDesc();
14861487

14871488
CurrCamAttribs.f4ViewportSize = float4{static_cast<float>(SCDesc.Width), static_cast<float>(SCDesc.Height), 1.f / SCDesc.Width, 1.f / SCDesc.Height};
1489+
CurrCamAttribs.fNearPlaneZ = ZNear;
1490+
CurrCamAttribs.fFarPlaneZ = ZFar;
14881491
CurrCamAttribs.fHandness = CameraView.Determinant() > 0 ? 1.f : -1.f;
14891492
CurrCamAttribs.mView = CameraView;
14901493
CurrCamAttribs.mProj = CameraProj;

Samples/USDViewer/src/USDViewer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,8 @@ void USDViewer::UpdateUI()
915915
DebugViews[static_cast<size_t>(PBR_Renderer::DebugViewType::IridescenceThickness)] = "Iridescence Thickness";
916916
DebugViews[static_cast<size_t>(PBR_Renderer::DebugViewType::Transmission)] = "Transmission";
917917
DebugViews[static_cast<size_t>(PBR_Renderer::DebugViewType::Thickness)] = "Volume Thickness";
918-
static_assert(static_cast<size_t>(PBR_Renderer::DebugViewType::NumDebugViews) == 34, "Did you add a new debug view mode? You may want to handle it here");
918+
DebugViews[static_cast<size_t>(PBR_Renderer::DebugViewType::SceneDepth)] = "Scene Depth";
919+
static_assert(static_cast<size_t>(PBR_Renderer::DebugViewType::NumDebugViews) == 35, "Did you add a new debug view mode? You may want to handle it here");
919920

920921
if (ImGui::Combo("Debug view", &m_Stage.DebugViewMode, DebugViews.data(), static_cast<int>(DebugViews.size()), 15))
921922
{

0 commit comments

Comments
 (0)