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

WebCamTexture MarkNonReadable for Android

Discussion in 'Android' started by Prodigga, Sep 22, 2014.

  1. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,121
    Hey guys

    I recently discovered "MarkNonReadable" which has given me a massive performance boost with WebCamTextures on iOS. (I have decent resolution WCT's running relatively smooth only an iPhone4, which is awesome).

    I've noticed that...for some reason, this function is unavailable on Android. I have no need to read the texture at all. I would like to mark it as non readable to increase performance. Right now, my Galaxy S4 is performing worse than my iPhone4 (With the WCT scaled up appropriately to look nice on the Galaxy S4's higher resolution screen).

    With augmented reality being such a hot topic lately, it is disappointing to see how poorly Unity handles WebCamTexture's on mobile devices.

    Is there any way I can submit this as a feature request, and if not can we have one of the Android developers explain why this isn't possible? Vuforia handles camera textures perfectly and smoothly. The downside is it is not a native solution, it takes over your entire application which makes integration with other plugins really difficult (OpenIAP, Facebook SDK, our custom plugin for Push Notifications, etc) and it is not customizable - You cannot specify a resolution higher than what they deem 'acceptable'.

    If Vuforia can achieve smooth camera textures with a plugin, I'd like to see Unity step in and fix their own implementation. Perhaps separating phone camera textures into their own class, separate from WebCamTextures if necessary.
     
  2. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,600
    >> I recently discovered "MarkNonReadable" which has given me a massive performance boost with WebCamTextures on iOS. (I have decent resolution WCT's running relatively smooth only an iPhone4, which is awesome).

    No, this uses ios-specific stuff (longer answer would be more complicated, but oh well)
    As a heads-up - in 5.0 we "kill" this API (it is ios-only anyway) and we will do the best of two worlds: very fast gl-side update AND possibility to read memory on demand (also quite fast)
     
  3. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,121
    So would we see an improvement to Android WCT performance with those changes?
     
  4. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,600
    >>So would we see an improvement to Android WCT performance with those changes?
    no, as i said it is all ios specific. As for android - the worst part is that current extension that can allow ios-like fast-track demands to tweak your shaders (you need special sampler type), so while we are thinking about implementing bits (so you can use it even if after some customizations) we are not there yet
     
  5. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,121
    Disappointing, but thanks for the answer.