@AlexColgan Hello!
Just stumbled upon the issue myself. I'd like to know if it is planned to fix this issue anytime soon or just not the priority at all?
Or maybe there is a simple fix I should have been able to extrapolate from this thread. If so, could you point me the way? I have checked the camera matrix but it seems to be the same regardless of the render pipeline.
I have managed to isolate two factors of error when the lightweight render pipeline is used:
- The reason for the hand flying away is that the offset seem to be repeatedly applied on the hand. The hand location and rotation from the leap motion sensor is still tracked.
- When this "apply offset" section of the code is commented, the hands manage to stay in place but don't manage to follow the headset. Since those offset are not those to separate the headset from the room but to separate the leap sensor from the tracker, it most likely doesn't follow it either when flying away.
I reckon that maybe some graphics related form of storage was used and is no longer functional. I tested Shader.SetGlobalMatrix which still seems to record effectively the data from the previous frame.
I tried to delve into the code that records previous poses to do the temporal warp but to no avail. It gets a bit confusing to me and I'd rather avoid going into how frames are dealt with.
Any help at all would be most welcome, I hope you have a great day regardless.
EDIT:
I actually found where the issue was coming from. Quite simply, LightWeight Render Pipeline no longer calls OnPreCull
callback. Instead, you need to subscribe (indirectly) OnPreCull
to UnityEngine.Experimental.Rendering.RenderPipeline.beginCameraRendering
in Start
callback.
I actually did the subscription for a method I called OnBeginCameraRendering
where
private void OnBeginCameraRendering(Camera camera)
{
if (camera == _cachedCamera)
{
OnPreCull();
}
}
There are still some light issues where the "hand swimming" fix is not as fluid as it used to be. Hands sometimes teleport a bit to be in the correct position. I'll look into that as well but I'm not too confident about it.
Most likely, this jittering is due to the fact that OnPreCull
is called earlier than beginCameraRendering
. I tried calling OnPrecull
at the end of LateUpdate
but to no avail for some unknown reason. (edit: forgot to mention the name of the class i was referring to: LeapXRServiceProvider
)
EDIT (again): ok so I've found 2 more places in the code that uses those somewhat obsolete callbacks. There is a OnPreRender
in LeapImageRetriever.cs
and there is another OnPreCull
in LeapEyeDislocator
. The fact that OnPreRender
is called after OnPreCull
may matter but I don't see the connection so I didn't bother with forcing the order. After thoses changes, hand "anti-swimming" is still not as good as it used to be. But I'll take the tradeoff for now.
@AlexColgan This is probably my last edit but if you ever have a way to fully solve the issue, please notify me. Thanks and have a good one!