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

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?

                  if (xTextureSwap.Swap())
                    {
                        cmd.SetGlobalTexture(xSourceTex, cameraColorTarget);
                        material.SetTexture(xTexture, xTextureSwap.TAATextureB);
                        cmd.SetRenderTarget(xTextureSwap.XTextureA);
                        cmd.DrawMesh(RenderingUtils.fullscreenMesh, Matrix4x4.identity, material, 0, 0);
                        cmd.SetGlobalTexture(taaSourceTex, xTextureSwap.XTextureA);
                        cmd.SetRenderTarget(cameraColorTarget);
                        cmd.DrawMesh(RenderingUtils.fullscreenMesh, Matrix4x4.identity, material, 0, 1);
                    }

Thanks!

4 Likes

+1 to this question!

+1, would love a simple sample for this

+1000,

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

Found some data on it

https://docs.unity3d.com/Packages/com.unity.render-pipelines.core@14.0/api/UnityEngine.Rendering.Blitter.html

I think is false to use Blitter.BlitCameraTexture, as looks different functionality

Maybe this is a betetr choice ?

BlitQuad(CommandBuffer, Texture, Vector4, Vector4, int, bool)
Blit a texture using a quad in the current render target

Also seems there is a sample here:
https://docs.unity.cn/Packages/com.unity.render-pipelines.universal@14.0/manual/renderer-features/how-to-fullscreen-blit.html

Also for latest URP 15, 17
https://docs.unity.cn/Packages/com.unity.render-pipelines.universal@15.0/manual/customize/blit-overview.html

https://docs.unity.cn/Packages/com.unity.render-pipelines.universal@15.0/manual/renderer-features/how-to-fullscreen-blit.html

https://docs.unity.cn/Packages/com.unity.render-pipelines.universal@17.0/manual/renderer-features/how-to-fullscreen-blit.html

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 ?

1 Like

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.

@nasos_333 can you provide some code of what didn’t work vs what did please?

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

1 Like