# URP管线自身代码问题

URP管线自身代码问题

7.7.1

  • 修复通过 CameraCaptureBridge.AddCaptureAction 抓屏抓到的是没经过后处理的

    • 408行开始
                  if (renderingData.cameraData.captureActions != null)
                  {
              
              
                      m_CapturePass.Setup(m_ActiveCameraColorAttachment);
                      EnqueuePass(m_CapturePass);
                  }
      
                  // if we applied post-processing for this camera it means current active texture is m_AfterPostProcessColor
                  var sourceForFinalPass = (applyPostProcessing) ? m_AfterPostProcessColor : m_ActiveCameraColorAttachment;
      
      替换为
                  // if we applied post-processing for this camera it means current active texture is m_AfterPostProcessColor
                  var sourceForFinalPass = (applyPostProcessing) ? m_AfterPostProcessColor : m_ActiveCameraColorAttachment;
      
                  if (renderingData.cameraData.captureActions != null)
                  {
              
              
                      m_CapturePass.Setup(sourceForFinalPass);
                      EnqueuePass(m_CapturePass);
                  }
      
  • 修复相机勾选 Post Processing 后,通过 CameraCaptureBridge.AddCaptureAction 抓屏屏幕卡住

    • 426行开始
          bool cameraTargetResolved =
          // final PP always blit to camera target
          applyFinalPostProcessing ||
          // no final PP but we have PP stack. In that case it blit unless there are render pass after PP
          (applyPostProcessing && !hasPassesAfterPostProcessing) ||
          // offscreen camera rendering to a texture, we don't need a blit pass to resolve to screen
          m_ActiveCameraColorAttachment == RenderTargetHandle.CameraTarget;
      
      替换为
          bool cameraTargetResolved =
          // final PP always blit to camera target
          applyFinalPostProcessing ||
          // no final PP but we have PP stack. In that case it blit unless there are render pass after PP
          (applyPostProcessing && resolvePostProcessingToCameraTarget) ||
          // offscreen camera rendering to a texture, we don't need a blit pass to resolve to screen
          m_ActiveCameraColorAttachment == RenderTargetHandle.CameraTarget;
      
  • 修复启用 UniversalRenderPipelineAsset 的 MSAA 后,通过 ScreenCapture.CaptureScreenshotIntoRenderTexture 抓屏出错
    7.3.1没有这个问题
    这个也不是URP代码问题,问题出在传入的 texture 上,该 texture 创建时不要设置
    m_texture.antiAliasing = QualitySettings.antiAliasing;

7.3.1

  • 修复通过 CameraCaptureBridge.AddCaptureAction 抓屏抓到的是没经过后处理的

    • 375行开始
                  if (renderingData.cameraData.captureActions != null)
                  {
              
              
                      m_CapturePass.Setup(m_ActiveCameraColorAttachment);
                      EnqueuePass(m_CapturePass);
                  }
      
                  // if we applied post-processing for this camera it means current active texture is m_AfterPostProcessColor
                  var sourceForFinalPass = (applyPostProcessing) ? m_AfterPostProcessColor : m_ActiveCameraColorAttachment;
      
      替换为
                  // if we applied post-processing for this camera it means current active texture is m_AfterPostProcessColor
                  var sourceForFinalPass = (applyPostProcessing) ? m_AfterPostProcessColor : m_ActiveCameraColorAttachment;
      
                  if (renderingData.cameraData.captureActions != null)
                  {
              
              
                      m_CapturePass.Setup(sourceForFinalPass);
                      EnqueuePass(m_CapturePass);
                  }
      
  • 修复相机勾选 Post Processing 后,通过 CameraCaptureBridge.AddCaptureAction 抓屏屏幕卡住

    • 393行开始
          bool cameraTargetResolved =
          // final PP always blit to camera target
          applyFinalPostProcessing ||
          // no final PP but we have PP stack. In that case it blit unless there are render pass after PP
          (applyPostProcessing && !hasPassesAfterPostProcessing) ||
          // offscreen camera rendering to a texture, we don't need a blit pass to resolve to screen
          m_ActiveCameraColorAttachment == RenderTargetHandle.CameraTarget;
      
      替换为
          bool cameraTargetResolved =
          // final PP always blit to camera target
          applyFinalPostProcessing ||
          // no final PP but we have PP stack. In that case it blit unless there are render pass after PP
          (applyPostProcessing && !dontResolvePostProcessingToCameraTarget) ||
          // offscreen camera rendering to a texture, we don't need a blit pass to resolve to screen
          m_ActiveCameraColorAttachment == RenderTargetHandle.CameraTarget;
      

猜你喜欢

转载自blog.csdn.net/qmladm/article/details/142372078