Start a new topic

Camera issues in editor on Windows 10

With the 8.3.0 SDK (and perhaps the previous SDK) the camera view can sometimes be distorted within the editor on Windows 10 when running in Unity 2018.2 and Unity 2018.3, but not in Unity 2018.1. And not on OS X. And we have seen this issue only on 2 of 4 Windows 10 computers. We have tested with embedded cameras, external web cams, and remote camera using the Unity Remote 5 Android app. Each of those cameras displays a different incorrect scaling and does not cover the full screen.


I have attached an example image of the video within the editor from a particular Windows 10 machine. The scaling of the image is wrong and there are black borders typically on the right side and top of the screen. We have seen reports of black or missing video in this forum and we are wondering if we are seeing a variation of that.


For now we will continue to use Unity 2018.1 as we haven't experienced these issues with 2018.1.

image.png
(135 KB)

Hi, 


Attached you will find a new version of the WikitudeUnityPlugin.dll file which contains additional logging related to camera rendering. If possible, please replace the one in /Assets/Wikitude/Dependencies/ with this one and send us the logged values. They should look something like this:


Screen.width: 540 Screen.height: 383
CurrentTexture.width: 1280 CurrentTexture.height: 720
_feed.deviceName: FaceTime HD Camera
_feed.requestedWidth: 640_feed.requestedHeight: 480
_feed.width: 1280_feed.height: 720
_feed.texelSize.x: 0.00078125_feed.texelSize.y: 0.001388889
Camera Angle: 0
cameraFrameAspectRatio: 1.777778
scaling.x: 1.260905 scaling.y: 1
UnityEngine.Debug:Log(Object)


The .dll is compatible with the 8.5 release.


Thank you,

Alexandru

dll

Hi, 


I was finally able to reproduce the issue. It seems to be caused by having a scaling value in the Windows Display settings that is larger than 100%. I guess Unity changed how it handled this on Windows and somehow affected our rendering.

We'll try to include a fix for this in the next update, but until then, please try to run without scaling, at least to verify that this is the source of the bug for you as well.


Thank you,

Alexandru

Hi !


I don't how you found this but thanks a lot for resolving my issue. It's actually good and i can keep going finally.


(I changed from 125% display to 100 % in Windows Settings ).


Hi,


Thank you for reporting this issue. This is the first report we've had with camera frame rendering not working correctly in the Editor, and I don't think it's connected to other reports that happen on specific devices.

We also couldn't reproduce the issue on our devices (Windows 10, Unity 2018.2). Does this issue happen in the example project provided in the download package as well, or just in your project?


Thank you,

Alexandru

Alexandru!
I can confirm that this is THE issue!

Thank you for helping us find out the solution. For now we will use 100% scaling on our windows devices. I guess this is a good bug to find for the wikitude dev team as well. Thank you for your help!

I will wait eagerly for a new patch note with this scaling fix.

Norman and Tactic LLC

It does seem to happen with the example projects in the download package.


This is a screen image from the unity editor on a second laptop (not the same one from the images above), running Windows 10 and Unity 2018.2.18f1. The laptop used in the previous images was a Microsoft Surface Book 2 and the image above is from a Lenovo ThinkPad X1. The image has a black bar on the side and has incorrect aspect ratio in that it seems stretched vertically or compressed horizontally. This is the scene "Object Tracking - Simple" in the example project. 


image


I found that when embedding the "Game" window in the editor program it would have correct aspect ratio but with black bars on the right and top sides. Popping it out of the editor (as I did in order to to the screen-copy) made the aspect ratio incorrect but with only the black bar on the right side.


We found the same issues with Unity 2018.3.6f1 when testing last week. So for now we will continue using 2018.1.9f2 for our Wikitude projects.

Hi,

I had the same problem and I tried to replace the WikitudeUnityPlugin  that you gave but there is an issue. now i  have a black screen instead of a cropped screen.


I'm currently looking for solutions but my errors are the following :

 

TypeLoadException: Could not load list of method overrides due to assembly:C:\Users\lmougin\Documents\Unity3D\Projets\WikitudeProject\Assets\Wikitude\Dependencies\WikitudeBridge.dll type:IPlatformBridge member:void {0}(intptr) signature:InitializeCoordinateSystem

System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (System.RuntimeTypeHandle type) (at <23c160f925be47d7a4fd083a3a62c920>:0)

Wikitude.BridgeFactory..cctor () (at <38e43d3a963543259c454dd3f5c33dad>:0)

Rethrow as TypeInitializationException: The type initializer for 'Wikitude.BridgeFactory' threw an exception.

Wikitude.WikitudeSDK.CreateWikitudeBridge () (at <f70e8761daad42caa5a92eb4e46f11f6>:0)

Wikitude.WikitudeSDK.get_WikitudeBridge () (at <f70e8761daad42caa5a92eb4e46f11f6>:0)

Wikitude.WikitudeCamera.OnApplicationPause (System.Boolean paused) (at <f70e8761daad42caa5a92eb4e46f11f6>:0)



MissingMethodException: void Wikitude.IPlatformBridge.InitializePlatformCamera()



TypeLoadException: Could not load list of method overrides due to assembly:C:\Users\lmougin\Documents\Unity3D\Projets\WikitudeProject\Assets\Wikitude\Dependencies\WikitudeBridge.dll type:IPlatformBridge member:void {0}(intptr) signature:InitializeCoordinateSystem

System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (System.RuntimeTypeHandle type) (at <23c160f925be47d7a4fd083a3a62c920>:0)

Wikitude.BridgeFactory..cctor () (at <38e43d3a963543259c454dd3f5c33dad>:0)

Rethrow as TypeInitializationException: The type initializer for 'Wikitude.BridgeFactory' threw an exception.

Wikitude.WikitudeSDK.CreatePlatformBridge () (at <f70e8761daad42caa5a92eb4e46f11f6>:0)

Wikitude.WikitudeSDK.get_PlatformBridge () (at <f70e8761daad42caa5a92eb4e46f11f6>:0)

Wikitude.WikitudeCamera.get_CameraTexture () (at <f70e8761daad42caa5a92eb4e46f11f6>:0)

Wikitude.WikitudeCamera.Update () (at <f70e8761daad42caa5a92eb4e46f11f6>:0)







PS : I forgot to say that I am using Unity 2019.2.0b3

Hi,


Yes we are still experiencing this issue. We have noticed other postings that seem to be the same issues that we are experiencing -


https://support.wikitude.com/support/discussions/topics/5000090729

https://support.wikitude.com/support/discussions/topics/5000091607


This is becoming more of a concern for us. As you know, the Google Play store will only accept 64-bit builds as of August, and we cannot produce 64-bit builds with Unity 2018.1.


Today I asked the team to see if the issue had gone away with Unity 2019.1,2f1, but the issue is still present.

Hi,


Thank you for posting the logs. The values sees right to me and are similar to what I'm getting on my devices, when running with this aspect ratio. When these logs were printed, was the camera still displayed with the black borders?


The DLL with the additional is compatible with Wikitude SDK 8.5. I tried it again with a new project downloaded from our website and with Unity 2019.1. I also enabled ".NET 4.x Equivalent" and it still worked for me. Perhaps the project you tried it on is using an older version of the SDK?


Also, thank you for reporting the issue with Plugin - Advanced Custom Camera scene. I can reproduce it and will fix the tiling as soon as possible. When running this scene with an aspect ratio > 1, does the camera look correct, without black borders? Does the same aspect ratio then not work properly the regular samples?

In general, I would not recommend using Input Plugins to work around this issue, unless you're only planning on running in the editor. In the final build there will be additional overhead caused by copying the camera frame from Unity, which can cause some performance degradation.


Best regards,

Alexandru

This issue also occurs with the 'static image' camera. I have attached an example screen shot.

Hi, 


Is this issue still affecting you? I tried on both a Surface and a Lenovo ThinkPad device and still couldn't reproduce the issue. Have you noticed anything else that could help reproduce the issue?


Thank you,

Alexandru

Hello again Alexandru

To follow up, yes the black border appears when using this DLL with the additional debug.

I have double checked and created a new unity 2019.1 with the 8.5 SDK, it still has the offset with the black border. I checked with both .NET 4.x and .NET3.5 (just in case). I adjusted both the Scripting runtime AND api compatibility. These all had the offset. This is all on a microsoft surface book 2.

We will only really use the custom camera for editor, yes. The main issue we're having again is that we need to be able to accurately line up elements to its real world tracker, so having this offset bug in editor is rather troublesome.

I will post more information as i continue debugging. Thank you again.

Hi Alexandru


We downloaded the 8.5 update and retried it with Unity 2018.3 and 2019.1.2. The issues with the camera offset, scaling and cropping are still present. We have posted a video that illustrates the problem - https://youtu.be/wRlie-3N0Q4. This video was made on a Microsoft Surface book 2.


It is at least an inconvenience for us in that we will need to author the Wikitude apps in an earlier editor than we will build the release versions with. And including any features of later versions of Unity (such as the new AR features offered in Unity 2019) will be problematic.

Login or Signup to post a comment