@@ -623,25 +623,6 @@ void main(in BoundBoxVSOutput VSOut,
623623}
624624)" ;
625625
626- static constexpr char BoundBoxPSMainGL[] = R"(
627- void main(in BoundBoxVSOutput VSOut,
628- out float4 Color : SV_Target0,
629- out float4 Normal : SV_Target1,
630- out float4 BaseColor : SV_Target2,
631- out float4 MaterialData : SV_Target3,
632- out float4 MotionVec : SV_Target4,
633- out float4 SpecularIBL : SV_Target5)
634- {
635- BoundBoxOutput BBOutput = GetBoundBoxOutput(VSOut);
636- Color = BBOutput.Color;
637- Normal = float4(0.0, 0.0, 0.0, 0.0);
638- BaseColor = float4(0.0, 0.0, 0.0, 0.0);
639- MaterialData = float4(0.0, 0.0, 0.0, 0.0);
640- MotionVec = float4(BBOutput.MotionVector, 0.0, 1.0);
641- SpecularIBL = float4(0.0, 0.0, 0.0, 0.0);
642- }
643- )" ;
644-
645626void GLTFViewer::CrateBoundBoxRenderer ()
646627{
647628 BoundBoxRenderer::CreateInfo BoundBoxRendererCI;
@@ -655,16 +636,8 @@ void GLTFViewer::CrateBoundBoxRenderer()
655636 BoundBoxRendererCI.RTVFormats [i] = m_GBuffer->GetElementDesc (i).Format ;
656637 BoundBoxRendererCI.DSVFormat = m_GBuffer->GetElementDesc (GBUFFER_RT_DEPTH0).Format ;
657638
658- if (m_pDevice->GetDeviceInfo ().IsGLDevice () || m_pDevice->GetDeviceInfo ().IsWebGPUDevice ())
659- {
660- // Normally, environment map shader only needs to write color and motion vector.
661- // However, on WebGL and WebGPU this results in errors.
662- BoundBoxRendererCI.PSMainSource = BoundBoxPSMainGL;
663- }
664- else
665- {
666- BoundBoxRendererCI.PSMainSource = BoundBoxPSMain;
667- }
639+ BoundBoxRendererCI.PSMainSource = BoundBoxPSMain;
640+ BoundBoxRendererCI.RenderTargetMask = GBUFFER_RT_FLAG_COLOR | GBUFFER_RT_FLAG_MOTION_VECTORS;
668641 }
669642 else
670643 {
0 commit comments