Hotrian / OpenVRDesktopDisplayPortal

Put your favorite Desktop Window directly into any OpenVR game!
Other
449 stars 96 forks source link

Internally, World and Screen Overlays are offset by Z +1 #25

Closed Hotrian closed 8 years ago

Hotrian commented 8 years ago

Internally, World and Screen based overlays have been offset by +1 on the Z axis, because at the world center (0, 0, 0), Screen overlays are not visible because they are at the same depth as the HMD, and not in front of it. To work around this, way back before v1.0.0 I offset the Overlay by +1 on the Z axis so that it was always visible by default. Unfortunately, this lead to some trickiness in changes for v1.0.5, so I dropped the +1 offset.

I never bothered to drop the +1 offset before because it wasn't causing any harm, but now I believe we should drop the offset and default Screen overlays to having an actual Z value of 1 instead. This breaks compatibility with older profiles, because they will all be offset by -1, so I'm adding a patch to the system that will attempt to add +1 to Screen overlays when they are first created (and first loaded for older saves), subtract 1 when switching to Controller or World overlays (so they are at the proper position), and add +1 back to them when switching back to Screen. The patch will also need to add +1 to old World Overlay saves, but newly created World Overlays should default to the world center.

As a result, the Z number should change, but it's location should end up the same.

This should be the last major change before I run final testing on v1.0.5, and release.

Although some changes must be made to the save system as well thanks to changes in 34349ba0afcea2e52b529a4d35b87efbd0c77a1b, but these two things I think are the last changes for this release.

Hotrian commented 8 years ago

This is fixed with f7bf60e. I believe that takes care of everything in 1.0.5! Running final testing :). Will close with release.