Hi, I am using a commandbuffer for a simple grab of the camera buffer into a temp rendertexture that is used later in a material (a helmet visor). The problem is that the blit flips the Y coordinate of the uvs. I could correct for this by changing the helmet shader (1-uv.y), but when switching into VR it stops flipping the uvs, so I can’t rely on a constant solution. After having switched to VR once, the uvs stop being flipped even after returning to screen mode, which is disconcerting. I am using single pass stereo (NOT instanced). Here is some of the code:
RenderTextureDescriptor desc;
if (VR.VRController.Instance.VREnabled) {
desc = UnityEngine.XR.XRSettings.eyeTextureDesc;
} else {
desc = new RenderTextureDescriptor(Screen.width, Screen.height, RenderTextureFormat.DefaultHDR);
}
desc.depthBufferBits = 0;
holoRenderTex = RenderTexture.GetTemporary(desc);
blitCommand = new CommandBuffer();
blitCommand.name = "HUDBlit";
blitCommand.Blit(BuiltinRenderTextureType.CurrentActive, holoRenderTex);
holoCamera.AddCommandBuffer(CameraEvent.AfterEverything, blitCommand);
glassMat.SetTexture("_HoloTex", holoRenderTex);