Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question HDR and alpha in URP - not possible?

Discussion in 'Universal Render Pipeline' started by ElliotB, Jul 24, 2021.

  1. ElliotB

    ElliotB

    Joined:
    Aug 11, 2013
    Posts:
    297
    Hi,

    I was trying to output to a buffer format with an alpha channel in URP with HDR enabled and it looks like this is unsupported. When HDR is disabled the output buffer format is R8G8B8A8_UNorm, when I enable HDR the output buffer changes to B10G11R11_UFloatPack32, which does not have an alpha channel.

    I have read that in HDRP there is an option in the render pipeline asset to change the render buffer format. See eg:
    https://docs.unity3d.com/Packages/c....high-definition@7.2/manual/Alpha-Output.html

    I looked but could not find an equivalent option for URP. Is alpha+HDR is not currently supported for URP? If not, is it possible we could have the buffer format option added to the pipeline asset?

    Cheers,
    Elliot
     
    nasos_333 and DrViJ like this.
  2. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,551
    I am also having a similar issue, the new Blitter class for full screen quad render is not drawing to transparency, i assume that could be the reason also.

    This renders URP useless going forward, as nothing in complex effects will work.
     
  3. ElliotB

    ElliotB

    Joined:
    Aug 11, 2013
    Posts:
    297
    You can use custom shaders with the Blitter API, so if your source and dest textures have alpha you can still use and output these values. You can check what your texture formats are using the frame debugger.
     
    nasos_333 likes this.
  4. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,551
    Hi, the issue is that in the full screen renderer to camera the rendertexture is the camera one, that is the defaultHDR format and seems as you mention that transparency is not working when blit to full screen quad, with a custom shader that does try to change it, is always opaque.

    I try to replace my code due to this warning

    warning CS0618: 'RenderingUtils.fullscreenMesh' is obsolete: 'Use Blitter.BlitCameraTexture instead of CommandBuffer.DrawMesh(fullscreenMesh

    Maybe can try use a custom rendertatget as destination, but not sure if the function will use the correct full screen dimensions, as in the example code.

    https://docs.unity3d.com/Packages/c...rsal@14.0/manual/customize/blit-overview.html
     
    Last edited: Nov 19, 2023