Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to turn off ResolveAA using cmd.GetTemporary

Discussion in 'General Graphics' started by kripto289, Oct 28, 2021.

  1. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    498
    Hello,
    Each command buffer.blit cause resolve aa for camera target, even if I use SetRenderTarget(otherRT);
    upload_2021-10-28_4-33-45.png

    upload_2021-10-28_4-33-56.png

    Here is my code:

    Code (CSharp):
    1. cmd.GetTemporaryRT(customRT_id, descriptor);
    2. cmd.SetRenderTarget(customRT_id);
    3. cmd.Blit(null, customRT_id, volumeLightMat, 0);
    Also even "cmd.SetRenderTarget(customRT_id);" will invoke "ResolveAA" for camera target. WTF?
    I use few custom passes and why unity resolve AA for useless temp camera texture, even if I don't use it??

    I saw this note:
    https://github.com/sienaiwun/Unity_AAResolveOnCommand
    But it works only with RenderTextures, but in my case I should use only command buffer render textures (because render texture doesn't work properly with command buffers in URP)
     
    Last edited: Oct 28, 2021
    JSmithIR likes this.
  2. sewy

    sewy

    Joined:
    Oct 11, 2015
    Posts:
    147
    Hi, I am experiacing the same problem - I wanna get RT, clear it and set it as target for instanced drawing. No need to resolve it every time I touch it.. Any progress on this topic?

    Code (CSharp):
    1. buffer.GetTemporaryRT(tempID, -1, -1, 24, FilterMode.Bilinear, RenderTextureFormat.ARGBHalf);
    2. buffer.SetRenderTarget(tempID);
    3. buffer.ClearRenderTarget(true, true, Color.clear);
    4. //drawInstanced
     
    JSmithIR likes this.
  3. JSmithIR

    JSmithIR

    Joined:
    Apr 13, 2023
    Posts:
    111
    Did anyone ever find a solution? It seems that URP forces us to deal with the resolves they put in place. Insanely frustrating and not user friendly
     
  4. suppertbw

    suppertbw

    Joined:
    Mar 16, 2016
    Posts:
    34
    Currently I'm using RTHandle(Unity 2022.3LTS version) and also encountering this issue, it seems you need to modify urp source code to deal with this issue.
    I wish there would be a more simpler solution.
     
    JSmithIR likes this.
  5. JSmithIR

    JSmithIR

    Joined:
    Apr 13, 2023
    Posts:
    111
    I put in a bug report and have not heard back, though they did confirm it as a bug
     
    kripto289 and sewy like this.