Search Unity

Question Rendering UNITY in Safe Area of IOS.

Discussion in 'Editor & General Support' started by DraCieLisAWAL, Jan 4, 2024.

  1. DraCieLisAWAL

    DraCieLisAWAL

    Joined:
    Jan 18, 2020
    Posts:
    4
    Hi,
    I have an application in IOS that loads Unity. Now, when Unity is loaded, I want it to be rendered in Safe Area (not just some part of UI BUT WHOLE UNITY - it's a 3d Game). The game is already developed and I want it to render in the safe area only.
    I have tried the safe area script and it just helps in bringing UI elements in the safe area. Is there any way I can render whole of the Unity in the safe area. Really need this as with Iphone 15 onwards, dynamic island is really hampering my game's performance.
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,892
    Do you have Unity embedded in a native iOS app? If so, you can set the view size of the Unity content accordingly. You still have to display a frame or something, not just leaving the borders black - most likely Apple will reject such apps as this is a clear sign of low quality and rather unexpected for users (they may regard it as a bug).

    If you use Unity in the regular way (not embedded) then it will always render to fullscreen.
    Since you're having performance issues, reducing the view size is not the solution in this case. Profile the game on the device to learn what is affecting performance the most and then find ways to optimize that.

    A common way on desktop to reduce the rendering load is to render at a lower resolution and then upscale the image. This is typicaly called "renderscale" and quite helpful if the game is GPU bound. I don't know if this is a setting available for iOS but it should be if you use Universal Render Pipeline.

    If you are using builtin render pipeline on mobile you're leaving performance untapped.
     
    ABCodeworld likes this.
  3. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,755
    You can have black borders equal to the safe area, so you don't render stuff there, but Apple will most probably won't accept it.

    There is also no renderscale setting in iOS.

    Also built-in is probably still faster on mobile that URP in many use cases, not sure if your game falls into one of them or not.

    Finally: iPhone 15 was shown running Resident Evil 4 Remake, if you have performance issues on this device you're probably doing something wrong.
     
  4. DraCieLisAWAL

    DraCieLisAWAL

    Joined:
    Jan 18, 2020
    Posts:
    4
    Correcting myself here, I meant hampering game's visuals and not performance.
     
  5. DraCieLisAWAL

    DraCieLisAWAL

    Joined:
    Jan 18, 2020
    Posts:
    4
    Quoting from Unity as a library github read me file, Unity supports rendering only full screen. Can't really find how to solve this.
    upload_2024-1-5_14-54-40.png