Lag when using render texture camera
Hello.
I am having this problem with Gear VR on Unity. I am rendering some objects in the scene into a render texture to be used inside a scene shader as reflection. Everything works fine except that the camera that renders the objects has a very big lag and the objects seem always to be 1 -2 frames behind.
At first I had the texture camera attached to the CenterEyeAnchor in the camera setup provided with Unity example. Since the lag was huge I searched the forums for an answer so I ended up attaching a script to the camera on either PreRender or PreCull. None of them solve the issue and the reflection lags a lot behind. For debugging I attached a sphere to the camera and the sphere also seems to lag 1 frame behind but is not as noticable as the reflection (I can see it if I tap the headset with the finger).
This would be the code however it does not work and the reflection is useless at this point. Also the reflection does not seem to be stereo but a single perspective. Is there a proper way to do stereo render textures ?
Here is a video of the problem filmed on the headset. The flicker part should be a reflection.
https://www.youtube.com/watch?v=scTQWIJ ... e=youtu.be
Thanks
-Aurel
I am having this problem with Gear VR on Unity. I am rendering some objects in the scene into a render texture to be used inside a scene shader as reflection. Everything works fine except that the camera that renders the objects has a very big lag and the objects seem always to be 1 -2 frames behind.
At first I had the texture camera attached to the CenterEyeAnchor in the camera setup provided with Unity example. Since the lag was huge I searched the forums for an answer so I ended up attaching a script to the camera on either PreRender or PreCull. None of them solve the issue and the reflection lags a lot behind. For debugging I attached a sphere to the camera and the sphere also seems to lag 1 frame behind but is not as noticable as the reflection (I can see it if I tap the headset with the finger).
Vector3 VRRotation = UnityEngine.VR.InputTracking.GetLocalRotation(UnityEngine.VR.VRNode.RightEye).eulerAngles;
camera.transform.rotation = Quaternion.Euler(new Vector3(VRRotation.x, 180 + VRRotation.y, VRRotation.z));
This would be the code however it does not work and the reflection is useless at this point. Also the reflection does not seem to be stereo but a single perspective. Is there a proper way to do stereo render textures ?
Here is a video of the problem filmed on the headset. The flicker part should be a reflection.
https://www.youtube.com/watch?v=scTQWIJ ... e=youtu.be
Thanks
-Aurel
