I am working in Unity 2019.4.11f1 and have written a Scriptable Render Feature for my project which is using Universal RP 7.3.1.
The process works completely fine on PC in Editor but has proven troublesome on Oculus Quest 2.
For VR I am using the Oculus XR Plugin 1.4.3.
In my post process I am using a Command Buffer to Blit one texture into another using a custom Shader/Material.
My textures for VR are being set up in a standard way using
var texID = Shader.PropertyToID("_textureID");
var renderTextureDescriptor = XRSettings.eyeTextureDesc;
commandBuffer.GetTemporaryRT(texID , renderTextureDescriptor, FilterMode.Bilinear);
Performing a ping/pong process I am simply doing
commandBuffer.Blit(ping, pong, customMaterial, 0);
commandBuffer.Blit(pong, ping, customMaterial, 1);
Using Render Doc and debugging a frame on my Quest I can see my Blit process is not setting any of the textures for the material. The textures are being set to default/white instead. Imgur: The magic of the Internet
I’ve tried explicitly setting these textures using CommandBuffer.SetGlobalTexture
commandBuffer.SetGlobalTexture ("_MainTex", ping);
But nothing seems to work.
Completely out of ideas on this one, anyone come across this before? I’m not sure what needs to be done to get my textures linked to my Shader.