@@ -112,6 +112,13 @@ PBR_Renderer::PSOKey::PSOKey(RenderPassType _Type,
112112 DebugView = DebugViewType::None;
113113 }
114114
115+ if (DebugView == DebugViewType::SceneDepth)
116+ {
117+ // Rendering scene depth with blending does not make sense,
118+ // so force alpha mode to opaque.
119+ AlphaMode = ALPHA_MODE_OPAQUE;
120+ }
121+
115122 if (Flags & PSO_FLAG_UNSHADED)
116123 {
117124 AlphaMode = ALPHA_MODE_OPAQUE;
@@ -1382,7 +1389,7 @@ ShaderMacroHelper PBR_Renderer::DefineMacros(const PSOKey& Key) const
13821389 Macros.Add (" PCF_FILTER_SIZE" , KernelSize);
13831390 }
13841391
1385- static_assert (static_cast <int >(DebugViewType::NumDebugViews) == 34 , " Did you add debug view? You may need to handle it here." );
1392+ static_assert (static_cast <int >(DebugViewType::NumDebugViews) == 35 , " Did you add debug view? You may need to handle it here." );
13861393 // clang-format off
13871394 Macros.Add (" DEBUG_VIEW" , static_cast <int >(Key.GetDebugView ()));
13881395 Macros.Add (" DEBUG_VIEW_NONE" , static_cast <int >(DebugViewType::None));
@@ -1419,6 +1426,7 @@ ShaderMacroHelper PBR_Renderer::DefineMacros(const PSOKey& Key) const
14191426 Macros.Add (" DEBUG_VIEW_IRIDESCENCE_THICKNESS" , static_cast <int >(DebugViewType::IridescenceThickness));
14201427 Macros.Add (" DEBUG_VIEW_TRANSMISSION" , static_cast <int >(DebugViewType::Transmission));
14211428 Macros.Add (" DEBUG_VIEW_THICKNESS" , static_cast <int >(DebugViewType::Thickness));
1429+ Macros.Add (" DEBUG_VIEW_SCENE_DEPTH" , static_cast <int >(DebugViewType::SceneDepth));
14221430 // clang-format on
14231431
14241432 static_assert (static_cast <int >(LoadingAnimationMode::Count) == 3 , " Did you add new loading animation mode? You may need to handle it here." );
@@ -2596,7 +2604,7 @@ void* PBR_Renderer::WriteSkinningData(void* pDst, const WriteSkinningDataAttribs
25962604
25972605const char * PBR_Renderer::GetDebugViewTypeString (DebugViewType DebugView)
25982606{
2599- static_assert (static_cast <int >(DebugViewType::NumDebugViews) == 34 , " Please update the switch below to handle the new debug view type" );
2607+ static_assert (static_cast <int >(DebugViewType::NumDebugViews) == 35 , " Please update the switch below to handle the new debug view type" );
26002608 switch (DebugView)
26012609 {
26022610#define DEBUG_VIEW_TYPE_CASE (Type ) \
@@ -2636,6 +2644,7 @@ const char* PBR_Renderer::GetDebugViewTypeString(DebugViewType DebugView)
26362644 DEBUG_VIEW_TYPE_CASE (IridescenceThickness);
26372645 DEBUG_VIEW_TYPE_CASE (Transmission);
26382646 DEBUG_VIEW_TYPE_CASE (Thickness);
2647+ DEBUG_VIEW_TYPE_CASE (SceneDepth);
26392648#undef DEBUG_VIEW_TYPE_CASE
26402649
26412650 default :
0 commit comments