Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    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:
    1,166
    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:
    1,166
    @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:
    1,166
    @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:
    1,166
  7. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    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:
    1,166
    @Ostwind I see now the android SDK is the blocking issue. Thank you very much