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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Render on touch!!

Discussion in 'Scripting' started by Armooey, Mar 8, 2021.

  1. Armooey

    Armooey

    Joined:
    Jun 8, 2017
    Posts:
    3
    Hi everyone
    I was thinking of developing a mobile application that uses AR, so I decided to use unity.
    But major part of the app is just like simple native apps and not requires any 3d rendering and that stuff.
    I have wondered is there a way to limit unity to render a frame just on touch or when an event happens?
    Simply instead of rendering 30 FPS for example, It renders the UI when it's needed just like regular applications.
     
  2. Adrian

    Adrian

    Joined:
    Apr 5, 2008
    Posts:
    1,051
    You can lower the frame rate but that will also lower the interval in which input is processed, meaning if you want to raise the frame rate again, there'll be a delay before you'll process the input.

    Starting with Unity 2019.3, you can use OnDemandRendering, which was created for this. It allows you to continue updating Unity and input at a higher frame rate but skip rendering for some frames. This way, you can quickly ramp the frame rate back up as soon as you detect input. This is rather low-level and requires you to implement the details, I don't think there's anything that you can just drop in your project.

    Alternatively, there's also Unity as a Library, which allows you to embed Unity into an app. So you can make the UI natively and switch into Unity for AR. You can combine native UI and Unity but it's not very straightforward.
     
    Armooey likes this.
  3. Armooey

    Armooey

    Joined:
    Jun 8, 2017
    Posts:
    3
    Thanks for your informative answer :)