Eusth / HoneySelectVR

MIT License
109 stars 28 forks source link

Weird Reflection/Shimmer While Moving Headset while Controller is On #37

Open kideternal opened 7 years ago

kideternal commented 7 years ago

On Vive with at least one controller turned-on, looking at a model and moving your head around results in a weird shimmer/lighting issue with anything reflective (skin/surfaces/etc.) It's almost like there's a flashlight strapped to your head.

The issue isn't there if all controllers are off.

kideternal commented 7 years ago

I'd try to fix this myself, but I can't figure out how to attach to the debugger without crashing, in order to inspect what effects are being added to the Head/Camera. (I believe something needs to be moved to the Camera's parent rather than on the Camera itself.)

Eusth commented 7 years ago

I don't think it's possible to attach a debugger. Try the dump function or GameObjectList.dll.

This issue is probably a "feature" caused by the camera sync in StandingMode.cs. (Or its child class)

kideternal commented 7 years ago

It took a fair amount of tinkering, but I figured it out!

You just need to add a child GameObject to SteamVR.Head and then put the Camera on that.

My guess was that Illusion's lighting (shimmer+shadows) is tied to the Camera's localRotation somehow, so when it's attached to the SteamVR Head/HMD directly it causes the lighting to rotate as you move your head. However, when using a keyboard/mouse, the Camera is presumably attached to a "Camera" object beneath a Player, which is rotated by the mouse and thus no shimmer effect. My hunch was right.

Long story short, the fix is to replace the following two lines of code at line 50 of StandingMode.cs: VRCamera.Instance.Blueprint.transform.position = VR.Camera.SteamCam.head.position; VRCamera.Instance.Blueprint.transform.rotation = VR.Camera.SteamCam.head.rotation; ... with the following: GameObject go = new GameObject("CameraHead"); go.transform.SetParent(VR.Camera.SteamCam.head); VRCamera.Instance.Blueprint.transform.position = go.transform.position; VRCamera.Instance.Blueprint.transform.rotation = go.transform.rotation;

I only had time for a quick test in HS, but didn't notice any other issues, which surprised me, but there you have it! (Again; not sure about checking-in code just yet, and not sure how it would affect other titles.)

kideternal commented 7 years ago

After further testing, one issue I've found with this implementation is that after you "dock" the UI somewhere via grip buttons, it may reappear duplicated attached to the control when toggling to the "interact/gesture" mode. (It disappears toggling away to other modes.)

voaeilt commented 6 years ago

Is this project still active? Because with version 0.6 I still have this anoying spotlight on my head.