Search Unity

Question Whats the correct way to resolve "'RenderingUtils.fullscreenMesh' is obsolete"?

Discussion in 'Universal Render Pipeline' started by AndrewCzarnietzki, Feb 27, 2023.

  1. AndrewCzarnietzki

    AndrewCzarnietzki

    Joined:
    Jul 23, 2013
    Posts:
    189
    Hey,

    After upgrading, we now have a number of these:

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

    These are mostly in unsupported assets that we want to do minimal support for. Instead of rewriting them from scratch, we'd prefer to do the smallest adjustment possible. What is the correct process for adjusting these?


    Code (CSharp):
    1.                   if (xTextureSwap.Swap())
    2.                     {
    3.                         cmd.SetGlobalTexture(xSourceTex, cameraColorTarget);
    4.                         material.SetTexture(xTexture, xTextureSwap.TAATextureB);
    5.                         cmd.SetRenderTarget(xTextureSwap.XTextureA);
    6.                         cmd.DrawMesh(RenderingUtils.fullscreenMesh, Matrix4x4.identity, material, 0, 0);
    7.                         cmd.SetGlobalTexture(taaSourceTex, xTextureSwap.XTextureA);
    8.                         cmd.SetRenderTarget(cameraColorTarget);
    9.                         cmd.DrawMesh(RenderingUtils.fullscreenMesh, Matrix4x4.identity, material, 0, 1);
    10.                     }

    Thanks!
     
  2. jack-gravitysketch

    jack-gravitysketch

    Joined:
    Jun 30, 2022
    Posts:
    5
    +1 to this question!
     
  3. diesoftgames

    diesoftgames

    Joined:
    Nov 27, 2018
    Posts:
    122
    +1, would love a simple sample for this
     
  4. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    +1000,

    Also why is Unity team breaking things without any easy explanation on how to replace them ?
     
  5. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
  6. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    I have tried without any sucess, the sample Unity gives above produces an undefined texture, so is not working

    Is it possible to have at least a working code so we can start loosing the few months of our life remaking our image effects from scratch ?

    Or better yet, is it possible to Not deprecate the function, so we save collectively more than 10 billion hours of needleds development ?
     
    Last edited: Nov 3, 2023
    Radivarig likes this.
  7. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    I managed to fix it, the key was that needed to replace also my previous vertex function with the one in the Blit.hlsl of the Unity side, i had to copy it as it uses some common structs and rename them also.
     
  8. Radivarig

    Radivarig

    Joined:
    May 15, 2013
    Posts:
    121
    @nasos_333 can you provide some code of what didn't work vs what did please?
     
  9. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    What i did is include the new Blit external hlsl, removed the usual vert i had in my shader and replaced with Vert from that file.

    Or can see what the Vert implements and recreate in your vertex code for example
     
    Radivarig likes this.