TomorrowTodayLabs / NewtonVR

A virtual reality interaction system for unity based on physics.
MIT License
787 stars 194 forks source link

Objects stacked on top of others jump around when the bottom on is moved #87

Open capitaljmedia opened 8 years ago

capitaljmedia commented 8 years ago

Hi,

I've got a base building game where you place blocks on top of each other to build a base. You can also carry a stack of blocks. These blocks are all nvr interactable objects. In a version of newtonVR from the summer (very old) this used to work perfectly, now with the recent versions the blocks that are on top of the one you are holding slide and jump around as you move the bottom one. This is more exaggerated by increasing the mass and drag of the objects or with a lower framerate it is far worse.

This also occurs in the newton sample scene if you try to move around the stack of yellow blocks for example, move them horizontally and you will see the top block jump and shift position. If you increase the drag to 2 on those blocks the effect will be increased. The block that you are holding also does some jitter while just moving left and right horizontally.

zite commented 8 years ago

Thanks for reporting this (and other bugs!). I tried to reproduce this and was very surprised to see the editor dropping a bunch of frames, which seems to be causing this. Some of the issue at least seems to be caused by VR.WaitForGPU. Which it seems unity is fixing in 5.5. See the thread here: https://forum.unity3d.com/threads/vr-vive-performance-problems-regular-vr-waitforgpu-spikes.434291/

It seems like this is caused by the editor redrawing stuff it doesn't need to be. If you enable "maximize on play" in the game window then the issue seems to go away.

This does seem related to frame rate. So try *Enabling Player Settings -> Other settings -> Graphics Jobs and Single-Pass Stereo Rendering".

Other than that, we will continue to try and fix PhysX framerate issues but I'm not sure how far we'll get. Hopefully this does actually get fixed in Unity 5.5.

capitaljmedia commented 8 years ago

Thanks. Yeah, in a build it definitely is better but still happens a bit. In the older version of newton that I was using it never occurred. It could be related to the unity version as well, I'm not sure exactly what version we were using before we updated newton but it's possible it was 5.4.2 or 5.4.1.