Search Unity

Question URP Full screen blit example not doing transparency

Discussion in 'Universal Render Pipeline' started by svenneve, Apr 20, 2023.

  1. svenneve

    svenneve

    Joined:
    May 14, 2013
    Posts:
    80
    The URP example (https://docs.unity3d.com/Packages/c...renderer-features/how-to-fullscreen-blit.html) in the docs mention this being a fullscreen blit, but it doesn't seem to apply the effect to the complete rendered image, just the opaque rendered stuff.
    On top of that, it just erases any effects applied before it in the render features stack.

    Is there any example that actually does do a full screen blit? Including transparency? One that respects previously applied effects as well.

    It's probably me, but the whole way post processing works, and what blit class to use seems to be a poorly documented clusterf***
     
    nasos_333 likes this.
  2. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    769
    Hi, the full screen pass renderer feature in 2022.2+ is what you're looking for.
    Renderer Features.png

    You can tick the "Color" option in "Requirements" of the renderer feature and sample scene color with URP Sample Buffer Node in a full screen shader graph.

    If you'd like a code-based solution, you should use Blit (try cmd.Blit() if XR support is not needed) to copy the camera's color target into another render texture, and use it to replace the "_CameraOpaqueTexture" in the shader.
     
    clabbe likes this.
  3. clabbe

    clabbe

    Joined:
    Aug 9, 2013
    Posts:
    26
    In addition to what's been said: in your shader i guess you are using
    '_CameraOpaqueTexture' like in the example?
    Try '_CameraColorTexture' instead if you want the color data from all render queues.
     
    nasos_333 likes this.
  4. svenneve

    svenneve

    Joined:
    May 14, 2013
    Posts:
    80
    Thanks all, I'll try that and see if it works in our version of Unity and URP