Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No resizing of stereo view for iPhone 12 Pro #91

Open
TassiDK opened this issue Dec 7, 2020 · 12 comments
Open

No resizing of stereo view for iPhone 12 Pro #91

TassiDK opened this issue Dec 7, 2020 · 12 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@TassiDK
Copy link

TassiDK commented Dec 7, 2020

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?

@andypoly
Copy link

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

@rajandeepsingh13
Copy link

rajandeepsingh13 commented Dec 22, 2020

Yeah I see this too on an iPhone 12

@AerinFloreo
Copy link

We are also having this issue, Iphone 12 Max. Using Unity 2019.4.11f

@cdytoby cdytoby added bug Something isn't working help wanted Extra attention is needed labels Jan 4, 2021
@cdytoby
Copy link
Collaborator

cdytoby commented Jan 4, 2021

I don't have a newest iPhone in my hand so I can't do bugfix on this subject, need help on this one.

@andypoly
Copy link

andypoly commented Jan 4, 2021

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?

@cdytoby
Copy link
Collaborator

cdytoby commented Jan 4, 2021

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.

@andypoly
Copy link

Yep are the fixes to be ported across?
googlevr/cardboard#144

@AndreySkyFoxSidorov
Copy link

AndreySkyFoxSidorov commented Feb 1, 2021

  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

@friggasaint
Copy link

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?

@kaaaana
Copy link

kaaaana commented Feb 12, 2021

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.

@AndreySkyFoxSidorov
Copy link

libsdk.zip

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?

@andypoly
Copy link

thanks, I think! - much smaller - stripped of debugging info or something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

8 participants