0 votes
by (320 points)

Hi,
In optimization work we want to know if is it possible to use GPU optimized function to copy a RenderTexture on Pico G2 4K and Unity Legacy XR SDK.

Function we want to use :

Graphics.CopyTexture(inputRenderTexture, StreamTexture);

or

var asyncGPUReadback = AsyncGPUReadback.Request(inputRenderTexture, 0);
        asyncGPUReadback.WaitForCompletion();
        StreamTexture.SetPixelData(asyncGPUReadback.GetData<byte>(), 0);
        StreamTexture.Apply();

Nowadays we use

StreamTexture.ReadPixels(new Rect(0, 0, inputRenderTexture.width, inputRenderTexture.height), 0, 0);

But it's extremely performance consuming.

Graphics.CopyTexture seems to be the key but we don't now how to use it correctly or if it work on the device. We only have a blank texture after the copy.

Thanks for helping

1 Answer

0 votes
by (6.6k points)

Hi
Maybe you could pack an APK for android phone (android 10) .
See if it works on the android phone first.

by (320 points)

Hi,
thanks for your response

Graphics.CopyTexture is hardware dependent according to unity documentation.

...