Search Unity

  1. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    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:
    1,484
    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:
    1,484
    Yes.

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

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    1,484
    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:
    1,484
    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:
    1,484
    yup, should work
     
    Shorely likes this.
  7. HonorableDaniel

    HonorableDaniel

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

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    1,484
    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:
    1,484
    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
unityunity