Forum Discussion
oculus_dzne
10 years agoExplorer
Grab a screenshot from Rift and immediately display it
Hello everyone,
for an experiment we would like to grab a a screenshot from the rift (i.e what the Unity camera renders to it) and display it immediately for about a second. We tried the following code:
However, this results in a certain flicker for 2 seconds (although it looks fine in the editor). How else can we achieve this?
Thanks in advance
/Seb
for an experiment we would like to grab a a screenshot from the rift (i.e what the Unity camera renders to it) and display it immediately for about a second. We tried the following code:
Camera camOV = mainCam; //OVRPlugin OVRController
camOV.targetTexture = tex; // A public RenderTexture
RenderTexture currentRT = RenderTexture.active;
RenderTexture.active = camOV.targetTexture;
camOV.Render();
Texture2D imageOverview = new Texture2D (camOV.targetTexture.width, camOV.targetTexture.height, TextureFormat.RGB24, false);
imageOverview.ReadPixels (new Rect (0, 0, camOV.targetTexture.width, camOV.targetTexture.height), 0, 0);
imageOverview.Apply ();
yield return new WaitForSeconds (2);
//RenderTexture.active = currentRT;
camOV.targetTexture = RenderTexture.active;
However, this results in a certain flicker for 2 seconds (although it looks fine in the editor). How else can we achieve this?
Thanks in advance
/Seb
No RepliesBe the first to reply
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device