Search Unity

Question What is best practice for full-screen blit?

Discussion in 'Universal Render Pipeline' started by Kichang-Kim, Nov 9, 2022.

  1. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,012
    Hi. I found that URP's full-screen blit code is quite different between the best practice on document and actual implementation.

    For example, you can find that Blitter.BlitCameraTexture() is recommended method for blitting in online document:
    https://docs.unity3d.com/Packages/c...rsal@14.0/manual/customize/blit-overview.html

    But FullScreenPassRendererFeature.cs in URP used
    Code (CSharp):
    1. CoreUtils.SetRenderTarget(cmd, cameraData.renderer.GetCameraColorBackBuffer(cmd));
    2. CoreUtils.DrawFullScreen(cmd, passMaterial);
    Also, document says that SetupRenderPasses() should be used for storing cameraColorTarget:
    https://docs.unity3d.com/Packages/c...iversal@14.0/manual/upgrade-guide-2022-1.html

    But FullScreenPassRendererFeature.cs uses "cameraData.renderer.GetCameraColorBackBuffer(cmd)" directly in its execution method.

    So what is correct best-practice?

    Thanks.
     
  2. Radivarig

    Radivarig

    Joined:
    May 15, 2013
    Posts:
    121
  3. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,012
    Radivarig likes this.
  4. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    It constantly changes and thus is not easy to suggest one solution as is per Unity version.

    Better start on the upcoming RenderGraph version if want to be future proof, as this is the latest version.

    They also promised not to change this one, though i give this around zero chance :)
     
    Radivarig likes this.