framebuffer to render texture feature

Hello!

I’m trying to grab the current screen and write it to a render texture. (I know there is the Opaque Texture available by default but I need something that includes transparent objects as well)

here is the code for the render feature:

I have it executing after rendering transparents - and then I render some objects using the texture (this is for distortion)

It is working fine in the editor but on device (Android) the texture is black…

Does anybody know what I might be doing wrong?

Thanks so much for the help,

seb

PS. I should add that this is with Unity 2020.3.23f1 and URP 10.6.0

mmh nobody?

I attached a super simple project to reproduce the issue. It just doesn’t work on device, editor seems fine. I guess I should file a bug…

7750470–975102–distortion_test.rar (302 KB)

Your code seems to use GetTemporaryRT in a command buffer. Have you read the docs for that? It says, among other things, “Any temporary textures that were not explicitly released will be removed after camera is done rendering, or after Graphics.ExecuteCommandBuffer is done.” That seems to mean your code is immediately destroying your temporary texture, long before you can use it for anything.

You should disable MSAA,and observe result.