microsoft / MixedRealityToolkit-Unity

This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
https://aka.ms/mrtkdocs
MIT License
6k stars 2.12k forks source link

Default camera FOV is not set correctly #176

Closed riverar closed 8 years ago

riverar commented 8 years ago

HoloToolkit doesn't seem to touch the vFOV setting in Unity, which defaults at 60. This number is incorrect and results in a very frustrating Unity to Device/Emulator experience.

Right now, I set the device resolution (in Unity's game window) to 1280x720 and use a camera vFOV of 21 to get it close. But official numbers would be appreciated.

jwittner commented 8 years ago

I agree!

jwittner commented 8 years ago

@stbertou I know I sent you that exact number once, do you recall where that was?

angelaHillier commented 8 years ago

Set the game window to use 1280x720 and the camera FOV to 19.3047. This should get you very close to the actual device. I can update the Main Camera prefab in the HoloToolkit to use this FOV.

jwittner commented 8 years ago

@angelaHillier While you're in there, think you could apply this setting from the Configuration menu option too?

angelaHillier commented 8 years ago

Yep, I'll put it there too. Thanks for the reminder!

riverar commented 8 years ago

That number doesn't seem right. (And from my testing, the vFOV in emu/on dev seem to match.) @jwittner's number seems much closer.

With 19.3047 image

With 16.9 image

Is there no spec to describe what this number should really be? Or is there some dynamism in play that I'm unaware of?

angelaHillier commented 8 years ago

Hmmm.. then my source was incorrect and I need to try some more testing (it seemed to match when running on device (at least it gave me a much better approximation). What are you setting your FOV to? Also, your scale for the Game view looks like it's set to 0.79, but it should be at 1, if you want to match the device.

riverar commented 8 years ago

@angelaHillier Edited the post w/ numbers.

Also, it's my understanding that Unity Game Window "scale" is really just a zoom slider for the window itself and should have no bearing on our testing here. (When at 1x it simply adds scroll bars to show the same information.)

angelaHillier commented 8 years ago

@riverar, Yeah, scale just zooms in/out, but it does change side-by-side comparison shots of what is visible on the screen :)

riverar commented 8 years ago

@angelaHillier Agreed, I should have clarified -- I was using the red cube corner as a quick way to rule out the 19.x number.

New shots @ 1x scale

19.3047 image

16.9 image

angelaHillier commented 8 years ago

Hi @riverar, We're still looking into this! Right now, there seems to be a range of values for the Unity game camera (16-20) that best represent the HoloLens FOV. The Emulator reports that the camera.main.fieldOfView running at 16.9716, but to match the visual in Unity, I had to set the FOV to 16.5. However, the second time that I ran the application, the cubes in my application appeared slightly closer to the camera (floating point arithmetic might be causing slight variations in distance....), and I had to set the Unity camera FOV to 16 in order to match the visual. The HoloLens is reporting a slightly larger value for FOV than the emulator and will also vary slightly depending on the user's IPD. We're going to keep testing with different devices to see if we can come up with a solid value before adding it to the HoloToolkit. However, from what I have seen on my own machine, 16-16.5 seems like good values to use in Unity (it's probably better to run at a slightly smaller FOV in Unity so you can ensure that everything will fit on HoloLens).

riverar commented 8 years ago

@angelaHillier It's a bit perplexing this number hasn't been figured out by now, given how it's fundamental to content creation. I'm also concerned that we're running tests to discover this value rather than relying on a constant that some device engineering group should be able to provide -- it was built to some FOV spec, right?!

On reflection, perhaps I touched on a bunch of Microsoft office politics that are better left out of GitHub. 😄

Thanks, will stay tuned!

angelaHillier commented 8 years ago

It's more a question of how to adjust Unity to match the device (the emulator already does a good approximation and it sets the main camera FOV to 16.97). Unity does not seem particularly consistent, however, as using the same FOV does not render the exact same visual (objects are clipped slightly differently). This is what I'm testing and trying to understand.

angelaHillier commented 8 years ago

16 appears to be the best value to use in Unity and that's what we'll set the HoloToolkit camera to. This value is a very close approximation to what the emulator will show (which runs at 16.97). The HoloLens runs ~17.6 (varies slightly based on your IPD). By using a smaller FOV in Unity, you will be able to design your scene within the safe zone for HoloLens.

camerafov

stbertou commented 8 years ago

Sorry that's probably a bit late.. just came back from holidays, the value you shared with me @jwittner is 16.9719639f and it works pretty well for us.

christsaragih commented 7 years ago

U will get a problem if using VR Mode on sphere,. Normaly FOV for VR on sphere is 60 but we just can using FOV 16... it's so damn :(