Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. The 2023.1 beta is now available for testing. To find out what's new, have a look at our 2023.1 feature highlights.
    Dismiss Notice

WebCamKind.ColorAndDepth on android?

Discussion in '2018.3 Beta' started by Thaina, Sep 12, 2018.

  1. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    828
    I have dual back camera on android. Can't it use depth texture?

    Will it anytime soon? Any problem or limitation?
     
  2. Deleted User

    Deleted User

    Guest

  3. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    828
    @Neophenz My android have dual back and it does not work. It seem the release note mention that it only work in iOS and don't work in android, even android also have dual back
     
  4. Mykolas_M

    Mykolas_M

    Unity Technologies

    Joined:
    Oct 13, 2016
    Posts:
    6
    Hey so let me just try to understand what you're trying to do, I am correct in assuming that you want to get a depth preview from your dual hardware camera?
    On ios it's possible since ios devices have a depth camera.
    My knowledge is limited in this subject so correct me if I'm wrong. On android having a "dual" camera, doesn't actually equal to having a depth camera.
    That means that doesn't matter you can have 5 cameras but if the android os doesn't provide a way for us to get depth data we can't do much about it.

    You could maybe/possibly, program a plugin which takes two images with the dual cameras and then based on some algorithm translate that into some sort of depth data and then pass that into Unity. But I can only image what this would take or even if this is possible.
     
  5. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    828
    @Mykolas_M What I know is in ios dual camera (not a TrueDepth camera) is the depth just came from a disparity map, not a real depth camera. So technically both android dual camera and ios dual camera has the same depth capability and technicality . And actually they was using it just for the same thing, a bokeh photoshot. So if ios dual camera can do anything, android should also able to too

    But right, I'm not sure about the detail of lower level api in each platform, I would research a little bit more
     
  6. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    828
  7. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,805
    AFAIK the difference here is that Apple provides the depth data as a iOS platform feature regardless of the used technique and device (ie. dual cameras or depth sensors as newest iPhones have both). Android platform does not have any depth data support at the moment(?) and it would not make sense for Unity implement such support by themselves for different models. It would have to be a platform feature that phone manufacturers feed data to from their cameras and Android passing the standardized data to Unity.
     
    Thaina likes this.
  8. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    828
    @Ostwind I see now the android SDK is the blocking issue. Thank you very much