googlesamples / arcore-depth-lab

ARCore Depth Lab is a set of Depth API samples that provides assets using depth for advanced geometry-aware features in AR interaction and rendering. (UIST 2020)
https://augmentedperception.github.io/depthlab/
Apache License 2.0
763 stars 152 forks source link

Doesn't compile in Unity v2019.3 > several scripts are missing #4

Closed yearofthewhopper closed 4 years ago

yearofthewhopper commented 4 years ago

This is the output after importing using the arcore sdk in unity with the realism examples. Project won't compile past this and i checked to make sure all the scripts were imported. (none of the below scripts are included in this repo)

Assets/ARRealismDemos/Common/Scripts/AttachDepthTexture.cs(64,27): error CS0117: 'Frame.CameraImage' does not contain a definition for 'UpdateDepthTexture'
Assets/ARRealismDemos/Common/Scripts/DepthTextureController.cs(90,27): error CS0117: 'Frame.CameraImage' does not contain a definition for 'UpdateDepthTexture'
Assets/ARRealismDemos/Common/Scripts/DepthVisualizationEffect.cs(130,27): error CS0117: 'Frame.CameraImage' does not contain a definition for 'UpdateDepthTexture'
Assets/ARRealismDemos/Common/Scripts/AttachDepthTextureToMaterial.cs(83,27): error CS0117: 'Frame.CameraImage' does not contain a definition for 'UpdateDepthTexture'
Assets/ARRealismDemos/Common/Scripts/NoticeHelper.cs(101,22): error CS0117: 'Session' does not contain a definition for 'IsDepthModeSupported'
Assets/ARRealismDemos/Common/Scripts/NoticeHelper.cs(101,43): error CS0103: The name 'DepthMode' does not exist in the current context
Assets/ARRealismDemos/ScreenSpaceDepthMesh/Scripts/DepthPulseEffect.cs(213,27): error CS0117: 'Frame.CameraImage' does not contain a definition for 'UpdateDepthTexture'
Assets/ARRealismDemos/CollisionDetection/Scripts/FreeSpaceRenderer.cs(157,35): error CS0117: 'Frame.CameraImage' does not contain a definition for 'UpdateDepthTexture'
ruofeidu commented 4 years ago

Thank you for your interest in Depth Lab!

Would you mind confirming that your ARCore SDK is v1.18.0? I have just followed our instructions and built Depth Lab with https://github.com/google-ar/arcore-unity-sdk/releases/tag/v1.18.0 using Unity 2018.4. Please let me know if you encounter any issues by providing details of your platform, Unity version, and ARCore version. Thank you!

yearofthewhopper commented 4 years ago

@ruofeidu yes I am using ARCore SDK is v1.18.0 in 2019.3v Unity. The same issue persists.

ruofeidu commented 4 years ago

Thank you for your report! We are investigating this.

It looks like your ARCore SDK is not v1.18.0 to me. Frame.CameraImage.UpdateDepthTexture is a newly added API in ARCore 1.18:

* Added [`Frame.UpdateDepthTexture()`](https://developers.google.com/ar/reference/unity/class/GoogleARCore/Frame/CameraImage#updatedepthtexture) to update the input texture using the latest depth data from ARCore.

Would you like to build Depth Lab with Unity 2018.4 and reimport https://github.com/google-ar/arcore-unity-sdk/releases/download/v1.18.0/arcore-unity-sdk-1.18.0.unitypackage? Thank you so much!

yearofthewhopper commented 4 years ago

This is the output error now that I have double checked that my ARCore SDK is v1.18.0 and recompiled

(Filename: Assets/ARRealismDemos/Common/Scripts/DepthSource.cs Line: 155)

NullReferenceException: Object reference not set to an instance of an object
  at DepthSource.get_DepthTexture () [0x00014] in MYUSERPATH/Downloads/arcore-depth-lab-master 2/Assets/ARRealismDemos/Common/Scripts/DepthSource.cs:155
ruofeidu commented 4 years ago

Is this a runtime error? Would you like to make sure to set the Build Platform to Android? Thank you!

yearofthewhopper commented 4 years ago

thank you! This worked. I have set my platform to android and built only for android and was able to compile. Though I don't have an android device so I was unable to test this all the way through. Any thoughts on utilizing the cross platform ability of unity to make it so these examples can compile for iOS or is that not possible?

ruofeidu commented 4 years ago

Glad that you have fixed this issue! Currently, Depth Lab only works in ARCore without the support of instant preview, while I do believe our library can be made available in iOS with depth maps (latest iPad Pro).

yearofthewhopper commented 4 years ago

i can confirm that this does not compile for latest iPad Pro either, unfortunately. screenshot of result on iPad Pro link with supported devices shows which leads to a misleading link that states that "all arcore features" work with this device. @ruofeidu

fredsa commented 4 years ago

@yearofthewhopper Thanks for the feedback. We're updating the documentation to be more clear w.r.t. device support. See https://github.com/googlesamples/arcore-depth-lab/issues/3#issuecomment-649917929