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. Dismiss Notice

Getpixels32 from WebCamTexture is broken

Discussion in 'iOS and tvOS' started by jcarpay, Oct 5, 2015.

  1. jcarpay

    jcarpay

    Joined:
    Aug 15, 2008
    Posts:
    558
    Case number 733487
    Can someone at UT please take a look at this?
     
  2. jcarpay

    jcarpay

    Joined:
    Aug 15, 2008
    Posts:
    558
  3. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,600
    there are two issues in play here:
    first of all you code is terribly wrong:

    Code (csharp):
    1.  
    2. webcamTexture = new WebCamTexture(640, 480);
    3. data = new Color32[640 * 480];
    4. webcamTexture.GetPixels32(data);
    5.  
    the extents you request are used by unity/OS ONLY as "i want something like that", so you might get totally different extents (e.g. it wont work even on editor on osx).

    second issue:

    even you would correctly query extents, there is indeed a bug with ios WebCamTexture being forced to report 16x16. That is fixed and will be backported to 5.2.something
     
  4. jcarpay

    jcarpay

    Joined:
    Aug 15, 2008
    Posts:
    558
    I don't see anything wrong with the code. Yes, the extents are hardcoded for this bug report as those values should work with iOS / iPad. Thanks for confirming the bug. Nice to hear it's fixed.
     
  5. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,600
    >>the extents are hardcoded for this bug report as those values should work with iOS / iPad
    ah, ok, got ya. Then yes 16x16 fix is coming to patch release soonish
     
    jcarpay likes this.
  6. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,600
    should be fixed in 5.2.1 Patch 4
     
  7. jcarpay

    jcarpay

    Joined:
    Aug 15, 2008
    Posts:
    558
    Nice, thanks!!