interaction_urp
interaction_urp copied to clipboard
Right Eye Not Clearing View.
Hello!
First of all, let me thank you for this amazing work and for your efforts to translate the Oculus SDK shaders to URP. I always worked with the URP when developing for the Oculus Quest and one thing that annoyed me the most is that they don't have a way to fix their own shaders and port them out of the SRP.
I tried myself, but I am not very good at shaders and I got stuck on the Oculus Hands of the brand new Interaction SDK, I actually didn't know how to translate the Surface Shader with multiple passes to a URP shader.
Introduction
After trying your latest release package, I ran into a couple of problems and bugs that I thought you should be aware of. The issues involve broken references, a couple of shader errors and the main problem which is described on this issue title.
I managed to fix the broken references and the shader errors (I will explain here how in case anyone may need it) but not ~~the hand flickering~~ and the right eye issue. I am going to explain the issues in the in the order in which I found them.
To reproduce
- Happens on every scene of the .unitypackage.
- Unity Version: 2020.3.29f1
- Oculus Integration v38.0
Broken References
I don't know if this is may be only in my particular case, which I don't think so but I didn't check before so I can't be assured.
Some of the references of the Grabbables of the scene BasicGrab URP
are not set up correctly. This produces errors after entering Play Mode. In my case, each interactable object over the desk needed an extra reference to be set on the Inspector.
On each object SimpleGrabXXX
of the scene, under the root Interactables
every child named HandGrabInteractable
needs a reference to it's parent (the actual SimpleGrabXXX
) on the field Grabbable
of the script Hand Grab Interactable
. Let me show this:
Also, in my case and on the same objects I lost the reference to the Pointer Interactable
exposed field of the script PointerGrabbableConnection
. The solution is either also assign the parent (the SimpleGrabXXX
) or to remove the component.
Other broken reference I noticed where on the camera rig. Under each XXXHandSynthetic
prefab, on the Hand Modifier
object, the DataModifier
field should be assigned to either the LeftHand
or the RightHand
objects, located under the Hands
object of the InputOVR
.
Shader Errors
I got two weird shader compilation errors on two of the translated shaders:
- Oculus Hand Outline, lines 115 and 117.
- Oculus Hand Color, lines 105 and 107.
The issue is quite simple to fix, on each line, there are these two macros written:
UNITY_SETUP_INSTANCE_ID(v); // Lines 105 (Oculus Hand Color) and 115 (Oculus Hand Outline).
UNITY_TRANSFER_INSTANCE_ID(v, OUT); // Lines 107 (Oculus Hand Color) and 117 (Oculus Hand Outline).
This throws me an error saying that v
is not defined. Actually, the parameter of the vertex shader is named IN
so changing this to:
UNITY_SETUP_INSTANCE_ID(IN); // Lines 105 (Oculus Hand Color) and 115 (Oculus Hand Outline).
UNITY_TRANSFER_INSTANCE_ID(IN, OUT); // Lines 107 (Oculus Hand Color) and 117 (Oculus Hand Outline).
fixed the issue for me.
Right Hand Flickering and Right Eye Issue
After fixing the problems above I managed to enter the Play mode without any errors and with the interactions and shaders working and showing correctly (no pink materials). This issue is quite difficult to explain by words, so I prepared a little video to show it:
https://user-images.githubusercontent.com/47715589/160030236-6531940d-e8f6-483c-8d70-2850d6058ff5.mp4
The video was recorded using the Oculus Mirror tool and the Oculus Link within the Unity Editor. ~~The first part shows the view of the left eye, which is pretty much perfect. This part is intended to show the problem with the right hand shader flickering constantly~~. I actually fixed this while writing this issue, I had an object enabled which didn't have to be.
The second part is after I update the Oculus Mirror setting to display the view of the right eye, which looks so chaotic. I am not a professional of this kind of "graphics" things but seems to me that the camera isn't clearing the previous draw (I don't recall the name for that). Both cameras (on left and right eye) have the exact same configuration.
At first I thought it could be some issue with the renderer features added through the Configure Project
tool but after disabling them the problem persists and I don't know what can be causing it.
Just to clarify, on other scenes with the default Oculus Hands and a simple material this problem does not happen.
Additional context
A couple days ago, the Oculus Integration Package got the v38.0 update, and I think that, at least for the broken references issue, is the reason for some of the errors that I found. Actually, the issue with the Interactables, is for a new exposed field which I think that it wasn't exposed on the v37.0 and which has no default value, also, an assertion throws if it's null.
Forgive me if my english is bad at any point, it's not my primary language.
Thank you for the detailed report! I'm traveling this week but I will attempt to get all of this resolved when I return home. I suspect that you are correct and the new release likely broke some things.
Okay! I will also look into the package further to see if anything else is broken. Thank you!
Thanks for all the work you've done on this! I wanted to check and see if you'd managed to figure out the right eye issue. It's kind of fun, but also kind of unusable. :)
/edit: the redrawing issue does seem to be related to the camera's Environment settings. If you switch Skybox to Solid Color, it doesn't seem to happen anymore.
@justinross, Yeah, I finally figured it out not a long time ago to be honest, but I completely forgot about the issue :`P.
It happened due to some kind of error in the skybox shader provided by the Oculus package. I think it's called ThreeGradientSkybox or something like that. If you switch it, or, in your case, switch to a Solid Color background, it no longer happens.
I didn't have time to test it enough, but in the V40 of the Oculus Integration most of the custom shaders have been upgraded to support the URP, so you may have a look now (I think there's still some shaders that aren't compatible) and see if has been fixed.
What happens now (and I think that also happened with the shaders of this package) is that, for what I've noticed, the particles don't render correctly over some backgrounds. For example, the fire on the provided example Torch does not get visible when there's something behind with almost any Oculus shader. But for that I don't actually know any solution.
EDIT: This last thing I mentioned about the fire, started happening to me just after the upgrade to V40. In fact, in the video I provided to this issue didn't happen as I just saw.