wrld3d / unity-api

Issue tracking for the WRLD Unity SDK
28 stars 8 forks source link

Game Objects are Disabled and Reenabled Constantly when using in a VR project #16

Open GabrielBakker opened 7 years ago

GabrielBakker commented 7 years ago

The WRLD Map API disables parts of the world that are not on screen, in order to make your game run faster and focus the processing power on the parts of the world that ARE on screen.

However, when a person is wearing VR headgear, they tend to turn their heads frequently and look all around them. On a scene where the observer is sitting at a high point and a significant portion of the WRLD map can be seen, this causes a big problem.

As the user turns their head (imagine just shaking your head "no"), all the objects in the world are disabled and reenabled over and over again. This looks goofy, takes the viewer out of the experience, and also wastes processing power disabling and reenabling objects over and over.

I've gotten a lot of negative reviews so far over this issue.

But the whole thing could be fixed pretty easily --- if we were to make the objects not disable until they have been off the screen for 15 seconds, instead of that happening instantly, that would go a LONG way to help this problem.

ArslanJafri commented 7 years ago

Hi @GabrielBakker, I have used WRLD Map API with HTC Vive and a solution that I had used was to display and stream using different cameras. If the camera component is disabled then Unity doesn't seem to change its values when running in VR. I was able to use that to my advantage because when I had control over the streaming camera then I could stream from different angles or using different FOV.

One solution could be to simply stream a large area from top down streaming camera and then use another camera for the VR headgear. Another option was to have a larger fov for the streaming camera than the viewing VR Camera. This way map would be enabled before it could come into view by the VR Camera.

GabrielBakker commented 7 years ago

Ok. Thanks for this idea. I'll see if I can make it work this afternoon.

Can I just change the cameras pov? Or should I position it behind the player? The problem is you're seeing a lot of distance in the game so a little turn of the head can cover a lot of map. So if i put the camera behind the player i might have to put it pretty far behind the player in order to make this behavior better. And if do that my concern is that it will lower the quality of the models because the camera is so far back from them.

Still though I'm going to try it and play around with different camera positions and see if I can get good results.

On Jul 24, 2017 1:40 AM, "Syed Ali Arslan Jafri" notifications@github.com wrote:

Hi @GabrielBakker https://github.com/gabrielbakker, I have used WRLD Map API with HTC Vive and a solution that I had used was to display and stream using different cameras. If the camera component is disabled then Unity doesn't seem to change its values when running in VR. I was able to use that to my advantage because when I had control over the streaming camera then I could stream from different angles or using different FOV.

One solution could be to simply stream a large area from top down streaming camera and then use another camera for the VR headgear. Another option was to have a larger fov for the streaming camera than the viewing VR Camera. This way map would be enabled before it could come into view by the VR Camera.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/wrld3d/unity-api/issues/16#issuecomment-317324354, or mute the thread https://github.com/notifications/unsubscribe-auth/Aco2B0v1li9h2262tleXfB6WKUurmi7yks5sRC5CgaJpZM4Ofa9A .

mistodon commented 7 years ago

At the moment, it is intended behaviour that streamed in data is disabled as soon as it is outside the frustum of the streaming Camera. The streaming camera and the camera which is used to render the scene are not necessarily intended to be the same Camera.

The solutions given by @ArslanJafri above, and the solutions mentioned in #7 are currently the intended way to resolve this problem.

However, as this will likely be required by all VR projects (and possibly other use-cases) we are considering providing more flexibility over what map tiles are streamed and when. I'm going to mark this as an Enhancement for those features.

In the meantime, please let us know how you get on with the other suggestions.

Thanks again for the feedback.