Cardboard-VR-Unity-SDK
Cardboard-VR-Unity-SDK copied to clipboard
No resizing of stereo view for iPhone 12 Pro
When building for iOS, the stereo view works as intended, except when running it on an iPhone 12 Pro. The two images render correctly, but only take up approximately half of the screen size, without ever resizing. Is there a place in any of the scripts where support for the newest iPhones can be added?
Yeah see this also, I think Unity reports the wrong dpi for iPhone 12s. Presumably the cardboard elements will not take all the screen on an iPhone Max but if it is wrong size for carboard lenses it is a breaking issue
Yeah I see this too on an iPhone 12
We are also having this issue, Iphone 12 Max. Using Unity 2019.4.11f
I don't have a newest iPhone in my hand so I can't do bugfix on this subject, need help on this one.
Can anyone report what Screen.dpi Unity reports for iPhone 12 models - I suspect this is wrong and might be related (Have no iphone 12 on hand right now either). How is the scale of the eye views decided @cdytoby? Is it in mobfish code?
https://github.com/mobfishgmbh/Cardboard-VR-Unity-SDK/blob/master/Assets/Cardboard/Scripts/Behaviours/CardboardPostCamera.cs
This MonoBehaviour is about drawing the eye mesh for each eye, including modifying the orthogonal projection matrix.
https://github.com/mobfishgmbh/Cardboard-VR-Unity-SDK/blob/master/Assets/Cardboard/Scripts/CardboardLensDistortion.cs
In this code contains how the eye mesh is created. private static extern void CardboardLensDistortion_getDistortionMesh(...)
. This method is exactly how the mesh is retrieved.
The eye mesh should be retrieved from native c++ code correctly, with the value correctly scaled with screen coordinate "normalized" from -1 to 1 on both x and y axis.
If I understand correctly, the related C++ code can't calculate these scale correctly, and returned the incorrect value.
https://github.com/googlevr/cardboard/releases
Based on google vr official releases, they do modified their code to make it correct for new iphones, by adding more dpis to their code.
So in order to update this, the native plugin repository should be updated, which is hosted here (a fork from official one).
https://github.com/mobfishgmbh/cardboard
I can't simply use the official one because this one has some modification, including bug fix and add an event callback.
Yep are the fixes to be ported across? https://github.com/googlevr/cardboard/issues/144
- Download https://github.com/mobfishgmbh/cardboard
- Need update file screen_params.mm to https://github.com/googlevr/cardboard/blob/master/sdk/screen_params/ios/screen_params.mm
- Build and replase libsdk.a file
1. Download https://github.com/mobfishgmbh/cardboard 2. Need update file screen_params.mm to https://github.com/googlevr/cardboard/blob/master/sdk/screen_params/ios/screen_params.mm 3. Build and replase libsdk.a file
Could you elaborate on how to build with updated screen_params.mm to a new libsdk.a?
Could you elaborate on how to build with updated screen_params.mm to a new libsdk.a?
You can create libsdk.a from the updated sdk by using Xcode.
1. Download https://github.com/mobfishgmbh/cardboard 2. Need update file screen_params.mm to https://github.com/googlevr/cardboard/blob/master/sdk/screen_params/ios/screen_params.mm 3. Build and replase libsdk.a file
Could you elaborate on how to build with updated screen_params.mm to a new libsdk.a?
thanks, I think! - much smaller - stripped of debugging info or something?