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

What does this feature mean - support for rendering Unity on top of native UI?

Discussion in '2019.1 Beta' started by yurykorzun, Jan 21, 2019.

  1. yurykorzun

    yurykorzun

    Joined:
    Oct 29, 2015
    Posts:
    41
    I can't find more information about this new feature in Unity 2019:
    iOS: Added support for rendering Unity on top of native UI on iOS and tvOS

    Can someone give more details?

    Thanks!
     
    Shorely likes this.
  2. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,026
    Hi!
    There's a new flag in Player settings in Resolution and Presentation settings - "Render over native UI". When this is checked, Unity will not set the whole alpha channel to 1 before giving the framebuffer to the OS for rendering. This makes it possible to e.g. set the camera to "Clear Color" mode, set alpha of the clear color to 0 and see the native iOS/Android UI below Unity view.
     
  3. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,026
    Yes.

    Btw, this flag is there (was initially Android-only and called "Preserve framebuffer alpha") since 2018.1.
    iOS support came later :)
     
    spider853 and Shorely like this.
  4. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,026
    Using regular render to texture.
    Keep in mind - this is iOS, tvOS and Android only. This won't work on desktop/consoles.
     
  5. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,026
    No, you might be able to do this on a mac, but not using this specific feature.
     
  6. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,026
    yup, should work
     
    Shorely likes this.
  7. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    You can do that on any platform. Just use an RGBA Render Texture.
     
  8. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,026
    Specifically: this provides an option to preserve the alpha channel when rendering to the backbuffer, and not only render textures.
     
    Shorely likes this.
  9. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,026
    Probably, I'm not sure.
    The feature was intended initially for "I have this awesome native UI that e.g. plays a video, I was some 3D content on top and be able to still see my awesome native UI".
     
    Shorely likes this.
  10. GeorgeCH

    GeorgeCH

    Joined:
    Oct 5, 2016
    Posts:
    222