Hello,
I've been using Vuforia 9.7.5 and Unity 2019.4.20f1 with the Universal Render Pipeline (URP). I'm using a custom Scriptable Render Pipeline (SRP) with four render passes to achieve the following:
- Sample the Vuforia background camera texture
- Draw the Vuforia background camera texture to the screen
- Draw the scene geometry normally (opaques, transparents, etc.)
- Modify the Vuforia background and draw the modified version to the screen on top of the scene geometry
The problem is I'm encountering is with step #4. The camera texture that I've sampled is available in step 2, but by the time step 4 is reached, the texture is just black. More specifically, the texture does not seem to be accessible after the the "Before Opaques" step in the SRP.
In step 1, I have tried a number of different methods of copying the pixels from the texture. I have tried Graphics.CopyTexture, as well as blitting to a new material's texture, and a render texture. The results are the same regardless.
This issue does not present itself if using the CameraDevice.Instance.GetCameraImage() method to get the background image, however, I'd like to avoid this, as there is no performant way to copy the pixels in the VuforiaImage class to a new texture.
I've seen this post in the forums [https://developer.vuforia.com/forum/unity/suggested-workaround-when-accessing-unity-materials-interferes-background-texture-updates], although I'm not sure if it is relevant to my issue, as the sample project provided in that post does not use URP and does not compile when using Vuforia 9.7.5.
Any help would be greatly appreciated.
Thanks,
Dave