@@ -72,7 +72,7 @@ void HnRenderBoundBoxTask::Sync(pxr::HdSceneDelegate* Delegate,
7272 *DirtyBits = pxr::HdChangeTracker::Clean;
7373}
7474
75- static std::string GetBoundBoxPSMain (bool IsGL )
75+ static std::string GetBoundBoxPSMain ()
7676{
7777 static_assert (HnFrameRenderTargets::GBUFFER_TARGET_COUNT == 7 , " Did you change the number of G-buffer targets? You may need to update the code below." );
7878
@@ -83,21 +83,6 @@ void main(in BoundBoxVSOutput VSOut,
8383 ss << " out float4 Color : SV_Target" << HnFrameRenderTargets::GBUFFER_TARGET_SCENE_COLOR << ' ,' << std::endl
8484 << " out float4 MotionVec : SV_Target" << HnFrameRenderTargets::GBUFFER_TARGET_MOTION_VECTOR;
8585
86- if (IsGL)
87- {
88- // Normally, bound box shader does not need to write to anything but
89- // color and motion vector targets.
90- // However, in OpenGL this somehow results in color output also being
91- // written to the MeshID target. To work around this issue, we use a
92- // custom shader that writes 0.
93- ss << ' ,' << std::endl
94- << " out float4 MeshId : SV_Target" << HnFrameRenderTargets::GBUFFER_TARGET_MESH_ID << ' ,' << std::endl
95- << " out float4 Normal : SV_Target" << HnFrameRenderTargets::GBUFFER_TARGET_NORMAL << ' ,' << std::endl
96- << " out float4 BaseColor : SV_Target" << HnFrameRenderTargets::GBUFFER_TARGET_BASE_COLOR << ' ,' << std::endl
97- << " out float4 Material : SV_Target" << HnFrameRenderTargets::GBUFFER_TARGET_MATERIAL << ' ,' << std::endl
98- << " out float4 IBL : SV_Target" << HnFrameRenderTargets::GBUFFER_TARGET_IBL;
99- }
100-
10186 ss << R"( )
10287{
10388 BoundBoxOutput BoundBox = GetBoundBoxOutput(VSOut);
@@ -107,21 +92,9 @@ void main(in BoundBoxVSOutput VSOut,
10792 Color = float4(BoundBox.Color.rgb, 0.0);
10893
10994 MotionVec = float4(BoundBox.MotionVector, 0.0, 1.0);
95+ }
11096)" ;
11197
112- if (IsGL)
113- {
114- ss << R"(
115- MeshId = float4(0.0, 0.0, 0.0, 1.0);
116- Normal = float4(0.0, 0.0, 1.0, 1.0);
117- BaseColor = float4(0.0, 0.0, 0.0, 0.0);
118- Material = float4(0.0, 0.0, 0.0, 0.0);
119- IBL = float4(0.0, 0.0, 0.0, 0.0);
120- )" ;
121- }
122-
123- ss << " }\n " ;
124-
12598 return ss.str ();
12699}
127100
@@ -185,7 +158,7 @@ void HnRenderBoundBoxTask::Prepare(pxr::HdTaskContext* TaskCtx,
185158 BoundBoxRndrCI.RenderTargetMask = ((1u << HnFrameRenderTargets::GBUFFER_TARGET_SCENE_COLOR) |
186159 (1u << HnFrameRenderTargets::GBUFFER_TARGET_MOTION_VECTOR));
187160
188- const std::string PSMain = GetBoundBoxPSMain (BoundBoxRndrCI. pDevice -> GetDeviceInfo (). IsGLDevice () );
161+ const std::string PSMain = GetBoundBoxPSMain ();
189162
190163 BoundBoxRndrCI.PSMainSource = PSMain.c_str ();
191164
0 commit comments